From patchwork Thu Nov 9 12:00:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 118444 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6508182qgn; Thu, 9 Nov 2017 04:09:43 -0800 (PST) X-Google-Smtp-Source: ABhQp+T7vg0KRN+3WC//r9NZusmOiWp33qEd646ARR7XbL/hC/Hb6vKyzORs3Fah+2o168cmEsaS X-Received: by 10.55.55.146 with SMTP id e140mr354431qka.106.1510229382980; Thu, 09 Nov 2017 04:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510229382; cv=none; d=google.com; s=arc-20160816; b=u6NGvyvGt5RIxA+gR+MfuV4uePwTCdwOW1rm+8GeH4qg9/faCReR0++CqiUs8QC1qO STHcvfEfdYeXgktULUs8U5broo5K5vgEx6Hg9WHf0wujeP75eUwxmmwuVEFUcf4mX5iq NDPKgLsfGQMH4HsDf+9lT4nwgx0gzEhJ0fKqs3lHUetEWzP3hOQIG5nlzpUPS1IN2PVO aFxUfk54p2xwbeQ/LfTqVLFMaRXRHeireJp1xQDipREmqB1gHr/pYEQ/8wkNcC2UX21t HearJdG9idLmdrUXO/Y4TVD18WBM9q4fAvsafM5aUrS3lKT4dSEfYQvClOQByZ632W2K g1TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=inP2eqCSU0ozLW6quEX9/lk4NjJ1sQhbiHoPPynllkU=; b=QtXikDaZpsiKZhJBrbrInRAcmJk2MJOe2jYS43bqpngcOlc3MZ2y/E6ugtA89+1Yrr ZnkguCi1OR1fU4Z9TdcUFVnNhjz+eLDmLnWNLEvUno+2gBoEEPXIr1f0KC2753+I9ZS5 w2c229p9rWY9T7jQ4LehkPG0l/U9AFUDNy/5DtuoQnaqcx8vAwX8OG0+njJnYNcBpp9K TkLizytMAGhTWIAK7iMtKzelDLNKBOFIIHGKK+irc8hn0awNVsE35S9iKv6oBL2OTjoB q/YdQ4PoeNDsAHhLSFJeiadVhc1lf31aGxwQkSyPa3tM3tMaPXzVikqSNnlj/XoaHh4i XYMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id n72si6108192qki.55.2017.11.09.04.09.42; Thu, 09 Nov 2017 04:09:42 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 9E12D60CDF; Thu, 9 Nov 2017 12:09:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 528E861013; Thu, 9 Nov 2017 12:03:11 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7666F60CCA; Thu, 9 Nov 2017 12:02:32 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id D915A609FD for ; Thu, 9 Nov 2017 12:00:33 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 59E8D184E87 for ; Thu, 9 Nov 2017 15:00:32 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ri6EVqlgLb-0WXm46kV; Thu, 09 Nov 2017 15:00:32 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id InclDaSPWn-0VnqGPbF; Thu, 09 Nov 2017 15:00:31 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 9 Nov 2017 15:00:29 +0300 Message-Id: <1510228830-21766-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510228830-21766-1-git-send-email-odpbot@yandex.ru> References: <1510228830-21766-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 242 Subject: [lng-odp] [PATCH API-NEXT v4 2/3] linux-gen: packet: dummy ones complement implementation X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Added dummy implementation of ones complement calls. Linux generic implementation does not calculate the sum for all incoming packets as it would be wasteful in SW. It's better to wait until application asks it with odp_chksum_ones_comp16(). Later on, the sum could be stored into the packet header, if we found a way to get it from the HW. Signed-off-by: Petri Savolainen --- /** Email created from pull request 242 (psavol:next-checksum-metadata) ** https://github.com/Linaro/odp/pull/242 ** Patch: https://github.com/Linaro/odp/pull/242.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 02aa905e6f9d4be66e19ccdb577e40a293be2902 **/ platform/linux-generic/odp_packet.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 3b2fac212..84790ba23 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1284,6 +1284,14 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset) return 0; } +uint16_t odp_packet_ones_comp(odp_packet_t pkt, odp_packet_data_range_t *range) +{ + (void)pkt; + range->length = 0; + range->offset = 0; + return 0; +} + void odp_packet_flow_hash_set(odp_packet_t pkt, uint32_t flow_hash) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);