From patchwork Wed Aug 16 08: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: 110210 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp460114qge; Wed, 16 Aug 2017 01:03:44 -0700 (PDT) X-Received: by 10.55.177.133 with SMTP id a127mr913745qkf.303.1502870624209; Wed, 16 Aug 2017 01:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502870624; cv=none; d=google.com; s=arc-20160816; b=q1qq/4/Ew1sMGCfdeVhB2XZtBKGZAUN09zfQjVI3EJoGqRW6Ko7dV1R4eE4ECHe+gS 5/91MFGkfe8Gv8V/KHtw0iXlj4h9OeJwWWOZURb7JSqumils5M8sj5DtB6ShIXEKReDC A6jfkuC14ZyGW34cCiOAQkxU6Xto0k+dX1Csx99v+jpjrCkimTuUGf9GOtmio/8o7HHY 9W04dIemHDhtITk9mFd9DgyPXCaLIhuYu+9wej+zQlWVrDnTWBjtWkT8sw/Axq3vRhBe KxykQaQy1APk7OvIJ4pfJ+F4XXnHDPQYHQfQzHnzTGQcfgSmDv7tMYNVLABYgINDjqWo lFeA== 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=PsFxWpjWHvnHW6Aiba5YGsqQD9cWlZIQ7SxVOF6UOyI=; b=cL7MToZf7lkbjU358nUbG//PZaBDax7NRtdLBlbwqZ15wyn+5elFG6VJbW8WbsIuip 07y6bienEepRLGPmFt7pJcYCKsY8qSTg35LDoLADzTstDB2LsvVsWDd5zZn0SZzlsjHJ Qbe4FYopDwv5SIdHqLkuCY79HfXW1c3RAaMmc5a0Nn0JvHxNE9nG/fQMh5lFjbU0dhV+ oR7Ziv+JjsD2YgksqIh+1dOXBwyoWjRInrohzfbolmySgSQpcuH3+F+Ib08Ylxq+T74q +Qt0iXQjXBdEPfMNbLdp2tbPvIljH0z9Ve+VeBtfD2yFMNaBXKWpKskdYUWCHG0TTWAp nq5A== 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 a5si285013qkg.33.2017.08.16.01.03.43; Wed, 16 Aug 2017 01:03:44 -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 D029E644B4; Wed, 16 Aug 2017 08:03:43 +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 027A6644B7; Wed, 16 Aug 2017 08: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 3E7EA62DF8; Wed, 16 Aug 2017 08:00:57 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 70E32644B5 for ; Wed, 16 Aug 2017 08:00:37 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward104p.mail.yandex.net (Yandex) with ESMTP id AD3101841A8 for ; Wed, 16 Aug 2017 11:00:34 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6bt3It26PN-0YECbwes; Wed, 16 Aug 2017 11:00:34 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lI5XI3wvqw-0Y1K6E8h; Wed, 16 Aug 2017 11:00:34 +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: Wed, 16 Aug 2017 11:00:05 +0300 Message-Id: <1502870408-2658-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502870408-2658-1-git-send-email-odpbot@yandex.ru> References: <1502870408-2658-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 124 Subject: [lng-odp] [PATCH v2 3/6] linux-gen: dpdk: enable per pktio RX IP/UDP/TCP checksum offload 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: Bogdan Pricope Signed-off-by: Bogdan Pricope --- /** Email created from pull request 124 (bogdanPricope:dpdk_hw_csum_pr) ** https://github.com/Linaro/odp/pull/124 ** Patch: https://github.com/Linaro/odp/pull/124.patch ** Base sha: 90d4ce1b3b25ca18446131906007571cc0ed0191 ** Merge commit sha: 223e557905dfa62704233e593e0a052a44fb3b4e **/ platform/linux-generic/pktio/dpdk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 9b402478..a5e1d4b5 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -666,6 +666,7 @@ static int dpdk_setup_port(pktio_entry_t *pktio_entry) int ret; pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk; struct rte_eth_rss_conf rss_conf; + uint16_t hw_ip_checksum = 0; /* Always set some hash functions to enable DPDK RSS hash calculation */ if (pkt_dpdk->hash.all_bits == 0) { @@ -675,12 +676,17 @@ static int dpdk_setup_port(pktio_entry_t *pktio_entry) rss_conf_to_hash_proto(&rss_conf, &pkt_dpdk->hash); } + if (pktio_entry->s.config.pktin.bit.ipv4_chksum || + pktio_entry->s.config.pktin.bit.udp_chksum || + pktio_entry->s.config.pktin.bit.tcp_chksum) + hw_ip_checksum = 1; + struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .split_hdr_size = 0, .header_split = 0, - .hw_ip_checksum = 0, + .hw_ip_checksum = hw_ip_checksum, .hw_vlan_filter = 0, .hw_strip_crc = 0, .enable_scatter = 0,