From patchwork Wed May 31 14:40:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 100792 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp356761qge; Wed, 31 May 2017 07:42:43 -0700 (PDT) X-Received: by 10.200.56.243 with SMTP id g48mr28802833qtc.79.1496241763280; Wed, 31 May 2017 07:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496241763; cv=none; d=google.com; s=arc-20160816; b=Yxo8uJchvrOFh2LA6PlDAPklzZHOUst/edfEtR2pLfdCtnMaYoVq5iWUBW1IU3oRb6 YhQgIDFh3HvPgyqYr7SmpTZz+mbBS9TnKV/fupxZRf4EXnq/wohTBDGpo1JioMgENRSd 9U7YnuXwGEyqlC3YuY4ZNYTUqcNDydzfQNVpzESzHYkX9+ZmK1Mqb5PHeNclJHcF8Ffe cMYel49dAAAalViB8EIKTmVS3rhPTKrHqQygb3pGgcbDbmVpRsgsU78eEBsCoOgPHOYs oLIdIOlzNl5OLjfAhYDKXmYuzIy+w0RryozV8f9cuikm0udEpHVLGtaeSv+kx+/13cbM ecrw== 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:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=LF3Xz8YPzLpI8yIgv2It+t/LTYDKVpKnbrwyjxuY//I=; b=YyO+q4qL5CWrVg/bP8b8lRpXdH7kzrfCWXfQSU+O0TvHuSXou7hiQGP7530gsA1Yu5 VhNH0GO37EelzGA8X5iCubpYyiRNlaTwvZz7sypzCXtm/FWuEz+aqpqSXqVGm+2kOFIK a3hsdjxBaDgJ6gxH5VnsU9GVtvJeAXAsrrrh6y9tileltOxoRjbxbnWwiLV6xifGTlxk zHBl71rYgTBWDsLjw7U1UllD4WKo2QbEGZ3AqMSqoqbEu2GiMXrSqbjM0diqXI1DL3S5 BVR/SmCLXSo3yCS1wZp9iNY3yu4D4FTRDoRMrXxQvrrQpFF6cBo818bLkgqxdePl7qHe thdQ== 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d127si15895579qkf.71.2017.05.31.07.42.43; Wed, 31 May 2017 07:42:43 -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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E892660D3C; Wed, 31 May 2017 14:42:42 +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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, 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 DFCE760CA0; Wed, 31 May 2017 14:41:27 +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 7FE1F60690; Wed, 31 May 2017 14:41:19 +0000 (UTC) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by lists.linaro.org (Postfix) with ESMTPS id DAE6060690 for ; Wed, 31 May 2017 14:41:16 +0000 (UTC) Received: by mail-wm0-f42.google.com with SMTP id m7so34457555wmg.0 for ; Wed, 31 May 2017 07:41:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LF3Xz8YPzLpI8yIgv2It+t/LTYDKVpKnbrwyjxuY//I=; b=R3yySs1JfyQrOVOJba1V9FrL9IQLhrIrouKzy61cPKWac5ED3Ftj8u4ZZ5mianoqSd RTBoQRyb+LbrSmv24X3uvmUy5fwwIpKymb8k0Ylw2XSZ/fc7BSqrmfdsLqStpn3mrmCO Qsdj1lMx/3Ot1C3n7oXIb+BlR4lRmo/p3OFVPomvJU7g9KzGTF+hFOjnsAbs1GBSrRy4 DWas/WDxlXobE+qLd4HO0RWQa5FPiYE5YDatchxtPdbDlUyCzc2/LvBgwm6h1eZ7x3H2 SY2W5BLS96Q/cT11EaRLo0ohLMEVfuWkBYWqkn5h7glzV5aaZCogRJloeBntrslweoy5 /6FQ== X-Gm-Message-State: AODbwcAY+FdvtCLDW2S7Q2GDWgpIuTg6qb7Kl2HRwYZy9CUCFQXshJN+ 1yMHol1EYQ0tlX/oS+9nSjdv X-Received: by 10.223.183.20 with SMTP id l20mr18094475wre.178.1496241675792; Wed, 31 May 2017 07:41:15 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id e23sm22483032wre.54.2017.05.31.07.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 07:41:15 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Wed, 31 May 2017 17:40:57 +0300 Message-Id: <1496241660-27492-4-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> References: <1496241660-27492-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [PATCH 3/6] 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" Signed-off-by: Bogdan Pricope --- platform/linux-generic/pktio/dpdk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.1 diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index a7fb888..94d2abe 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -189,6 +189,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) { @@ -198,13 +199,18 @@ 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, .max_rx_pkt_len = pkt_dpdk->data_room, .split_hdr_size = 0, .header_split = 0, - .hw_ip_checksum = 0, + .hw_ip_checksum = hw_ip_checksum, .hw_vlan_filter = 0, .jumbo_frame = 1, .hw_strip_crc = 0,