From patchwork Sat Jan 13 04:00:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 124407 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp30494lje; Fri, 12 Jan 2018 20:02:15 -0800 (PST) X-Google-Smtp-Source: ACJfBot29OJhz6e0gL4yRa5aWGK9anhzH3Pqlg3ehhYNTEIkCNhSYGEVV13TYVPhdbFKesvly8Wn X-Received: by 10.237.39.33 with SMTP id n30mr3219898qtd.142.1515816135344; Fri, 12 Jan 2018 20:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515816135; cv=none; d=google.com; s=arc-20160816; b=pSk+C00wIhE+aNvb4hFhxsm8fjyDT9I0+nYKdVtsMsnFNvDJsRRNXp4zb9NcGU+NaD 14eJUXnrdth8ahZ08tNuqljVTOtY1AkHwQWOWvpdSRtX0qrSwzNORUyeNQQ3JsQ8esvj XxA+MwSnK0Ir7VJakwCH7e3N0aTgzj2Jn5wFuqeFRF+qkahCCol7oVTLvz7XcChDOEVK apv4cExzDDR2eSwz+CReCauA67wRm2FYMvrsnyh65Sny1HsXb30tcX8lOJCck/5zz98T ll5Iop3Kj65i7HjY3Zoha6ssmQm51VVt0K5dBvOALkvWyjMmvL2llKZaxuFMoz2+xvXR ZzWw== 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=vhKgu0mdSUwgjsroxZu0IOpM7UZDs5LCUF8nW60nKZ0=; b=O2F24wowDBp9l8TgsnLow9IJBp/TcieZEz8D23H+rf8IPlUsJcWSMwidynaANwLoUh wK8BVpP3lDL9kNip4ZqZreZqc57O4eOBcwaubVCZ3zEAwuGbg+59riUOcVKtSaNwrY/Z 2wAikyRm6VUUuuqibkKVA6FRcSHlUy4/F8jmz55/wVMI9Pf0EBXmRso5OJo1VQtdHQVy KERwM51B7FbyBurPqmM9f4umi0Ok1TLk3XlkWN2mWEHqCrMpttVTiGAYfsaLi+7H8n0V QSOCwKzu46mJ/daqjmnIG6SZwlNNfCXQ3CGL2uW+ZQQ7BTwnTmySpZXZBtzvjwOUXLT4 v53Q== 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 14si905407qtw.350.2018.01.12.20.02.15; Fri, 12 Jan 2018 20:02:15 -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 0E29761755; Sat, 13 Jan 2018 04:02:15 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 A15246175B; Sat, 13 Jan 2018 04:00:28 +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 9413B616B9; Sat, 13 Jan 2018 04:00:15 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 43B486097D for ; Sat, 13 Jan 2018 04:00:12 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 19DF134C4084 for ; Sat, 13 Jan 2018 07:00:11 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EI5n7ZNO7K-0B4CT9L1; Sat, 13 Jan 2018 07:00:11 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id GnJsmNomDX-0AG0HNYv; Sat, 13 Jan 2018 07:00:10 +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: Sat, 13 Jan 2018 07:00:04 +0300 Message-Id: <1515816008-7212-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515816008-7212-1-git-send-email-odpbot@yandex.ru> References: <1515816008-7212-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 389 Subject: [lng-odp] [PATCH v1] [WIP 3/7] linux-gen: pktio: introduce checksum settings 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 389 (lumag:parse-checksums) ** https://github.com/Linaro/odp/pull/389 ** Patch: https://github.com/Linaro/odp/pull/389.patch ** Base sha: 49ebafae0edebbc750742d8874ad0a7588286dea ** Merge commit sha: ab214b82da2a920444a5e65d029f3f42a98ec314 **/ platform/linux-generic/include/odp_packet_io_internal.h | 1 + platform/linux-generic/odp_packet_io.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 25e037182..851515810 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -151,6 +151,7 @@ struct pktio_entry { odp_pktio_config_t config; /**< Device configuration */ classifier_t cls; /**< classifier linked with this pktio*/ odp_pktio_stats_t stats; /**< statistic counters for pktio */ + odp_proto_chksums_t in_chksums; /**< Checksums validation settings */ enum { STATS_SYSFS = 0, STATS_ETHTOOL, diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index ffbc73b26..1f1d46423 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -432,6 +432,12 @@ int odp_pktio_config(odp_pktio_t hdl, const odp_pktio_config_t *config) entry->s.config = *config; + entry->s.in_chksums.all_chksum = 0; + entry->s.in_chksums.chksum.ipv4 = config->pktin.bit.ipv4_chksum; + entry->s.in_chksums.chksum.tcp = config->pktin.bit.tcp_chksum; + entry->s.in_chksums.chksum.udp = config->pktin.bit.udp_chksum; + entry->s.in_chksums.chksum.sctp = config->pktin.bit.sctp_chksum; + if (entry->s.ops->config) res = entry->s.ops->config(entry, config);