From patchwork Tue Sep 5 10:06:32 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: 111652 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp2635901qge; Tue, 5 Sep 2017 03:21:11 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4YY3E6JpMBBCcHv3lTI3nSjnV9J83YT+ucymtgiNEEL3wGJI54VUguAEr60tmIzxkCNZ3n X-Received: by 10.200.37.227 with SMTP id f32mr4752461qtf.226.1504606871478; Tue, 05 Sep 2017 03:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504606871; cv=none; d=google.com; s=arc-20160816; b=saAbndJtwOH6qASa1/LFo7g1Cgx3njjC7eGkoaykRMC0p3w5vXkR4aGTpi7nnqkkTb WUTpLtvF/5ft007tSZ1bjEzkn0jU7mfohBq30ey6fugvLXwKM69CQ+HcUunPehEX7MDs FR87aXaxrV52RYWp9MVUgpadCpGIJHloY3lYONkWsmZCBcXZa2X1nJZSZB9tiEqS/oUV HXY/0iK0T/UGscFcStwDCCeLL1+Y0dw0dgVBS3kbb2LDhoeT/KsBE7HlYj0EJVYuML4A 2+rWf9PWFizbweclgT5VDFBbfT1iMRCWwcYx6DDN2/hoduCmuPb++cZ3EAtlWBFCxLoW thjg== 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=z7PXYBoh0PK6x26HOcGPXfgQRH/Iu3vkTL1L0x0X9Z4=; b=XWvM+FD/J5N9IkWR6oqhyEvdbnmk7++QxuR40KePjmY/xzIvXYpj879HfUmwTypkJ4 D7j3AXN6vJUY9VDmT2buT9gjmlZKyVBWpA3EOQVmGLZ00GD2ysSA9W0Fq7c8ahNSm4Zv RkOiS8ycDIbYNIo7RtJ3LbtTZ5K1oP3GXuPxZ9RG0S7FLEkVuFCbA9V5134TuyRVpPk6 65vAGDZysYFUcoGGF4jT2+TL988qKx4otPtItQ8bR4l4Qe01dA56bJ3tHztedRxFWgec /lOPWxYL5jHougITOPp8bRxIFvsVOsmRZY9lhtn6qGHb1ZAcfkEd6AYGZQ3KygF7WOBm 6JhQ== 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 w7si316301qtc.420.2017.09.05.03.21.11; Tue, 05 Sep 2017 03:21:11 -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 0628261E1A; Tue, 5 Sep 2017 10:21:11 +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 4D17062AE3; Tue, 5 Sep 2017 10:09:45 +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 8044360D79; Tue, 5 Sep 2017 10:09:07 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 050CC60D8F for ; Tue, 5 Sep 2017 10:06:48 +0000 (UTC) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward105j.mail.yandex.net (Yandex) with ESMTP id AE05D181527 for ; Tue, 5 Sep 2017 13:06:41 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 9s92USKlqd-6fhCmK6k; Tue, 05 Sep 2017 13:06:41 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id oPs3E3RFkM-6fOiACYO; Tue, 05 Sep 2017 13:06:41 +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, 5 Sep 2017 13:06:32 +0300 Message-Id: <1504605995-28026-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504605995-28026-1-git-send-email-odpbot@yandex.ru> References: <1504605995-28026-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 124 Subject: [lng-odp] [PATCH v4 2/5] 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: 7508c5ac906bb7cb1d339b4c5e924f3a18e504ca ** Merge commit sha: 086fe31f96e49f97f945702d0691f019245b959c **/ 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 8d1dcd84..f2a54b75 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -668,6 +668,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) { @@ -677,12 +678,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,