From patchwork Fri Aug 25 10:00:07 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: 110976 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp722664ybm; Fri, 25 Aug 2017 03:02:09 -0700 (PDT) X-Received: by 10.200.9.108 with SMTP id z41mr11945581qth.234.1503655329552; Fri, 25 Aug 2017 03:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503655329; cv=none; d=google.com; s=arc-20160816; b=plf+dmF9/1Dh2HYgHgbULX4HwXFFF6jj3e4ASBjxZpzW1yjCDlu5wpvvuuSRpwiJ1j Ij7o+2HOlX9T9/OIKMIkRXGJby/4qjpIIz+SrJSHtlBzeu0v9OEpKRp11bDjnX20692b QMHZ/JCbMegbi/1DwR+oGY3TyP40V1wWrh0oAVPF4S2HR3gygsb1QTAeohWXALUD2MlW SBwYB5q9fchc5keqaMFtooNtHf39cx90clOMT2oQbCyq7XUa0xnssZyIE5EbFv8JzSwQ UzIK6Jktt32IzEnTQfHo8DwssYxk7BV4lWaS2ytdX7vRa1nazkEl/WMo0cIYuzRs5yq5 QNvA== 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=zrE3WXhsKNW8qEMgiNgx/4KzfLqJdrsRQU1/LkoYuDs=; b=LU7/nnZuvH0AydC7QDictZYUlwCYIkF37WvvcXYVg0BQRSCDa5aeinb3o+RHC88gkw 6LmbM+N69/AHbYYXQngETYXSh5HfO2iZ/+UXdTP05JlWrTCaNkAGbNuV8DM01Xq0KfxL hUWROBZt7wn2V8yKVPJjgXYG5lCsfUBDa+q0XFVDA7lDT70ZU01ZUjf69Ndni+cH48zq x2FBV+9scDgxhoBS+j+7XTG2MTfOL5z4piSN70rrtYU2K79HgyNqb5P2YjZLetUbQIUE RtOpHZI0vim7GxoylaAz+clLPyRMBpQvRVjTWoX35qbk5qrWWt3+px2AaC8QURA8iBjA 5kow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i65si5606371qkc.431.2017.08.25.03.02.09; Fri, 25 Aug 2017 03:02:09 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 2864865C08; Fri, 25 Aug 2017 10:02:09 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 711E065C01; Fri, 25 Aug 2017 10:00:46 +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 3CE8C65BFA; Fri, 25 Aug 2017 10:00:32 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 132A065BF7 for ; Fri, 25 Aug 2017 10:00:31 +0000 (UTC) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 34FF040820DC for ; Fri, 25 Aug 2017 13:00:28 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IuL1u7P8rS-0S688bA4; Fri, 25 Aug 2017 13:00:28 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id irVIP3ZZaC-0RrWEnZE; Fri, 25 Aug 2017 13:00:27 +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: Fri, 25 Aug 2017 13:00:07 +0300 Message-Id: <1503655207-26292-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503655207-26292-1-git-send-email-odpbot@yandex.ru> References: <1503655207-26292-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 132 Subject: [lng-odp] [PATCH v5 3/3] helper: chksum: verify odph_ipv4_chksum_*() functions 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: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 132 (lumag:fix-checksum) ** https://github.com/Linaro/odp/pull/132 ** Patch: https://github.com/Linaro/odp/pull/132.patch ** Base sha: 8705e548f330d23173283fcca62f4afb835a6380 ** Merge commit sha: 7ad532c561535935fe0e51774755fcd4c5bb7ebc **/ helper/test/chksum.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/helper/test/chksum.c b/helper/test/chksum.c index 1beae47f..4a957c32 100644 --- a/helper/test/chksum.c +++ b/helper/test/chksum.c @@ -108,9 +108,17 @@ int main(int argc ODPH_UNUSED, char *argv[] ODPH_UNUSED) ODPH_IPV4HDR_LEN); ip->proto = ODPH_IPPROTO_UDP; ip->id = odp_cpu_to_be_16(1); - ip->chksum = 0; odp_packet_has_ipv4_set(test_packet, 1); - odph_ipv4_csum_update(test_packet); + if (odph_ipv4_csum_update(test_packet) < 0) + status = -1; + + if (!odph_ipv4_csum_valid(test_packet)) + status = -1; + + printf("IP chksum = 0x%x\n", odp_be_to_cpu_16(ip->chksum)); + + if (odp_be_to_cpu_16(ip->chksum) != 0x3965) + status = -1; /* udp */ odp_packet_l4_offset_set(test_packet, ODPH_ETHHDR_LEN