From patchwork Fri May 24 14:57:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 53691 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6DCF12C16; Fri, 24 May 2019 16:57:36 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [84.52.114.115]) by dpdk.org (Postfix) with ESMTP id AA9D825D9; Fri, 24 May 2019 16:57:34 +0200 (CEST) Received: from olwe.oktetlabs.ru (olwe.oktetlabs.ru [192.168.37.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 4E9217F407; Fri, 24 May 2019 17:57:34 +0300 (MSK) From: Ivan Malov To: Olivier Matz Cc: dev@dpdk.org, Tomasz Kulasek , stable@dpdk.org Date: Fri, 24 May 2019 17:57:14 +0300 Message-Id: <20190524145714.18903-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net: fix encapsulation markers for inner L3 offset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The API to prepare checksum offloads employs outer IP checksum flag to tell regular IPv4 packets from tunnel packets with outer IPv4 encapsulation. This flag cannot serve as a marker for the said purpose because a packet can have outer IPv4 encapsulation and may not have outer IP checksum offload request. Fix the API by changing the said criterion to test outer IPv4 flag rather than outer IP checksum flag. Use simpler spelling of the conditional expression. Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") Cc: Tomasz Kulasek Cc: stable@dpdk.org Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Acked-by: Konstantin Ananyev --- lib/librte_net/rte_net.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h index 1697071..c15b518 100644 --- a/lib/librte_net/rte_net.h +++ b/lib/librte_net/rte_net.h @@ -128,8 +128,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, return 0; #endif - if ((ol_flags & PKT_TX_OUTER_IP_CKSUM) || - (ol_flags & PKT_TX_OUTER_IPV6)) + if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) inner_l3_offset += m->outer_l2_len + m->outer_l3_len; #ifdef RTE_LIBRTE_ETHDEV_DEBUG