From patchwork Thu Sep 14 15:00:05 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: 112562 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp737573edb; Thu, 14 Sep 2017 08:03:20 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCimvSLE7KXxCpWnQ8o1+6TUT6y6FrkCWlUWFvMc6ZYlfOLCz4gE08bCuTZUqb/SrbS2wxo X-Received: by 10.55.163.201 with SMTP id m192mr3108103qke.27.1505401399878; Thu, 14 Sep 2017 08:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505401399; cv=none; d=google.com; s=arc-20160816; b=0rG2pU5qoRYo/gfzBST8bJSIDicbGR/JhjIqovOOYgkWzmc//umBoQYnJIQVtHgBUJ uaTeY6oFFUSzhQn4IfYEAfTBghRBP4PnSZMK+vCQXwRL3c/Yaa2naYDxl85zWL8qIvem ElH3o2+oQEx/rc90h/usa+38XR8etZFpVG45azXO7Ykx008ECSpnMwwvX4yrMVMKIWyP gMDAeOlc1UYsVbyE7g6u0BTnCd3kwCFY8cyM7tuZyfEnxeN6UoOvV2Tv9T3CdS9YmHPs J8mRlAUeOyvFq2jTFX9SDzhHZEzcsZ5YHUWaHytBYYFUN9XgaZ55h6pfTNmOWdfTJhIb ABaA== 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=0BVREzy2vVUueHxt5NT0rSDi+21cp4fKiWSDCAZPup0=; b=tKaLdi2JlATu5TEdiIhsNmuR7goFVfmjPjYtm4vez5Rx0sTZntz6IQ30995Md7b7wG c03MZ/sWoaGnS5M2Lczog+70OcuAFrudijZpUpaNK8BCc35euWdGDhYQB+VYLAfnzpRN dcKO6Alb79EQCyqqkR3A89HGoWqw0ldAvZ2vziPnxLwf1iUM03wyFWjPw/Qen/oSjllr EDDKvaXNbUpsnmPlYddPIlKc5e/TwtA/EunVGnBaMbs5LuxM62ggGrr3u27iakuSYn+K rezkaKiavpXqOavb+Hj/LuXXjXh1bkhvgxVU+kBwWfvtTS5HIF9X4q+DtTSF5Q4TDFoE e3sw== 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 h9si3342302qte.273.2017.09.14.08.03.19; Thu, 14 Sep 2017 08:03:19 -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 8C0AB609B3; Thu, 14 Sep 2017 15:03:19 +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, RCVD_IN_DNSWL_NONE,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 EAFC4609DA; Thu, 14 Sep 2017 15:00:48 +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 0484F6098C; Thu, 14 Sep 2017 15:00:25 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id B745660882 for ; Thu, 14 Sep 2017 15:00:23 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 37DD2185ED8 for ; Thu, 14 Sep 2017 18:00:22 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uyqjs4Xeq7-0MUePpH3; Thu, 14 Sep 2017 18:00:22 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gNZkqRzw9k-0L7ieSSX; Thu, 14 Sep 2017 18:00:21 +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, 14 Sep 2017 18:00:05 +0300 Message-Id: <1505401213-7265-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505401213-7265-1-git-send-email-odpbot@yandex.ru> References: <1505401213-7265-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 160 Subject: [lng-odp] [PATCH API-NEXT v11 4/12] 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 160 (bala-manoharan:api_sched_order_lock) ** https://github.com/Linaro/odp/pull/160 ** Patch: https://github.com/Linaro/odp/pull/160.patch ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: 438a3bab5df9c05dc06f0b4e4b22c0a7db0864fd **/ 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 914eab04a..9eb7ee06b 100644 --- a/helper/test/chksum.c +++ b/helper/test/chksum.c @@ -110,9 +110,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