From patchwork Tue Aug 22 08:00:07 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: 110618 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp5007387obb; Tue, 22 Aug 2017 01:05:29 -0700 (PDT) X-Received: by 10.237.57.106 with SMTP id l97mr2734779qte.128.1503389129614; Tue, 22 Aug 2017 01:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503389129; cv=none; d=google.com; s=arc-20160816; b=eU8UNzS//DNmrwHcfWxr2xnFbNv9bvPDqAaAHLnd6LWu9f6rGQA+zAF2hoQFQVO7bO XKal0e09mTNELR9FcelbWOUAze5FkBRNtsNB78M0VhXCN1uISxjd7gHLLDwxZRmK85rW HYIm1/JG/tM/vz2DWm/H8kwXI/JxfnMrg7H+QJ7mhSiA0Uk8gNGvfhjx5tq5hflITNfR 4gq3m0RFPE2w7+58arxTDRSg8+bb1WKs2HTWIYteTrEHwjtmJncAJnNVxFM9aLxKkvPQ sTmpTef/kkwGcGqP2ikhh0wxrQJHGQzmzOBPFKxVOQxHNHC38UJ2Kx8VKNcd5s2XF57w dySA== 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=f5p4EIpIxKsxQLfNxJ5LprGzFBIxGwBq/5peJ8t552Y=; b=OHuCbJcJzEjhroeoDAOOg0lb7ExYUOmFsswqssR7SJ60SRo3lmuasmSOoGqke8+zp0 WO/utiGmEYs9BYZL8ETHpM8XVra6k1StBkRxBAbpguPN44SVG7PYJ9hBqKD4HnXG/ijw 9gWmj8XuYVmf77VnULp+3O8BrtwqDbpPZsooAo3vlSBSmkwyVOg7cg11SfUv+v/Yi+rS AF+5egPmLvOcAswThX+ex6p5KEPF22P+I+d94+bMEe9WJkiqxs566nc6k/4ykT7o5yUS coR0sL+vovd5bWIJOsnjxvopkaqKnM1HfE6QsVE4v9mnDaEh2aq6tfqWBoIvSTZhdGYn FVmw== 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 9si11229778qtd.312.2017.08.22.01.05.29; Tue, 22 Aug 2017 01:05:29 -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 4A25C644C8; Tue, 22 Aug 2017 08:05:29 +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 73EEB644DD; Tue, 22 Aug 2017 08:01:30 +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 BFD8D644A3; Tue, 22 Aug 2017 08:01:06 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 25946644E6 for ; Tue, 22 Aug 2017 08:00:20 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 80996510149A for ; Tue, 22 Aug 2017 11:00:15 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ckPh9ZHQ6U-0Fo8w86Q; Tue, 22 Aug 2017 11:00:15 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IVkIzK7jNZ-0E0urYxx; Tue, 22 Aug 2017 11:00:14 +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, 22 Aug 2017 11:00:07 +0300 Message-Id: <1503388810-6999-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503388810-6999-1-git-send-email-odpbot@yandex.ru> References: <1503388810-6999-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 124 Subject: [lng-odp] [PATCH v3 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: aecb3c7a442b426761f1e6f43308a1e9ea709ef3 ** Merge commit sha: 23658e7f5acf9d3621ec7a8f617db98a26ee1bda **/ 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 a4884b91..693c0c97 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,