From patchwork Tue Nov 7 15:00:20 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: 118179 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp631248edm; Tue, 7 Nov 2017 07:05:48 -0800 (PST) X-Google-Smtp-Source: ABhQp+RWWwHeZTllzteDyKmqjnaKByZVsZsI80eKtMpwKMSQ5ane1h9/i5W/meBMxKe6wPL5HS1d X-Received: by 10.129.208.10 with SMTP id v10mr12000704ywi.192.1510067148451; Tue, 07 Nov 2017 07:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510067148; cv=none; d=google.com; s=arc-20160816; b=uuXOtpbRF0lZf4qGLrWjkRrM0fVRNPzWWdS4/9rSpGU8VWZ4PGtTiD+6jkN4+DLuM0 fYu2+yGekHcQkQapldAr4M6ATMjj+6Vf8NZaocupTZUawMMDcP4d1wdsRZRRKFSAVNjM HQ5uSlF9vR5fTiKnO8XQb9UEt/5SdzyoC5/aUSD5s2/Iv9NDeBBF9A6dGCho8irKWryN Qykd/HdQZv9i9AhgUwkm6Q3BgBu45a2oSLVElwoudsuudhoCQAdgjZ2cz7Q6f3p1H/5p hxCuMWFygCc442ur1EsLkzH2EhMl55Ob6SRhk/LXVZe39Jw+dPgorKCKcdyHJllmFeCh 9FZQ== 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=FDUg7I9GyzstH0lFydMOv/OC3iPsgXwTx2xvU+DOlLM=; b=naO/7818sVnbHXhhvsahZWrVrYGJ6bfzrrBgveI1jwSuhFxFXlrWn8z0YMiw3UVoBF En+Zd1Eyp4lFR5Zt5TFlfW0KIuhHOCannK+DHsQrzihXk8kxAY3jAijbHW7UR1hFW41/ qJiLI3MIo4wjMLluusG55a5s3uOeKfbTGD4wTDk7jgGYPVajuYRHwLvi0CzybMyxAqPB IAuOiAJhULhQ47A7DeApX7cApqMAHlAkgRSCGqV1RwArmKK0Mg+LtTEtYivsHohuvqFt gQyk/uaqBuS3sSdN4RNpbMDlTK91GslhCuEErFB0RtvC4qrwPfo9T5c4JwqGk0qPZlN/ Zk0w== 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 200si310633ywy.508.2017.11.07.07.05.48; Tue, 07 Nov 2017 07:05:48 -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 0BB4F60A79; Tue, 7 Nov 2017 15:05:48 +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 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 28FEA60C6A; Tue, 7 Nov 2017 15:01:17 +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 5BAE560D73; Tue, 7 Nov 2017 15:01:14 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id D541560A79 for ; Tue, 7 Nov 2017 15:00:23 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward103o.mail.yandex.net (Yandex) with ESMTP id B4332588280E for ; Tue, 7 Nov 2017 18:00:22 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Nn5fEzCsDJ-0MIW7WrX; Tue, 07 Nov 2017 18:00:22 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7O1nyguxgE-0Mv8fm0r; Tue, 07 Nov 2017 18:00:22 +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: Tue, 7 Nov 2017 18:00:20 +0300 Message-Id: <1510066821-31264-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510066821-31264-1-git-send-email-odpbot@yandex.ru> References: <1510066821-31264-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 280 Subject: [lng-odp] [PATCH API-NEXT v1 1/2] helper: use new odp checksum API 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 Use odp_chksum_ones_comp16 which may be platform-optimized. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 280 (lumag:chksum) ** https://github.com/Linaro/odp/pull/280 ** Patch: https://github.com/Linaro/odp/pull/280.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 93032be4dd8c5d534c9898a54df6cb7977522c80 **/ helper/include/odp/helper/chksum.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/helper/include/odp/helper/chksum.h b/helper/include/odp/helper/chksum.h index 1bf950c8b..f8d05236a 100644 --- a/helper/include/odp/helper/chksum.h +++ b/helper/include/odp/helper/chksum.h @@ -44,21 +44,7 @@ typedef enum { */ static inline odp_u16sum_t odph_chksum(void *buffer, int len) { - uint16_t *buf = (uint16_t *)buffer; - uint32_t sum = 0; - uint16_t result; - - for (sum = 0; len > 1; len -= 2) - sum += *buf++; - - if (len == 1) - sum += *(unsigned char *)buf; - - sum = (sum >> 16) + (sum & 0xFFFF); - sum += (sum >> 16); - result = ~sum; - - return (__odp_force odp_u16sum_t) result; + return ~odp_chksum_ones_comp16(buffer, len); } /**