From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 94D6B1B517 for ; Fri, 30 Nov 2018 00:13:00 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:18:51 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW7E032075; Fri, 30 Nov 2018 01:12:55 +0200 From: Yongseok Koh To: Didier Pallard Cc: Konstantin Ananyev , dpdk stable Date: Thu, 29 Nov 2018 15:10:08 -0800 Message-Id: <20181129231202.30436-14-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'net: fix Intel prepare function for IP checksum offload' has been queued to LTS release 17.11.5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:13:01 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 2cde73859e2e2530ebe8247dc43704e7be7354f8 Mon Sep 17 00:00:00 2001 From: Didier Pallard Date: Wed, 19 Sep 2018 16:42:08 +0200 Subject: [PATCH] net: fix Intel prepare function for IP checksum offload [ upstream commit ae0207d4b5048a6af9bc30e0956d30461b813148 ] Current Intel tx prepare function does not properly handle the case where only IP checksum is requested, without requesting any L4 checksum or TSO: IP checksum is not properly reset to 0 and output packet may contain invalid IP checksum. Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") Signed-off-by: Didier Pallard Acked-by: Konstantin Ananyev --- lib/librte_net/rte_net.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h index 79c764adc..5e80dd896 100644 --- a/lib/librte_net/rte_net.h +++ b/lib/librte_net/rte_net.h @@ -124,14 +124,16 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) (ol_flags & PKT_TX_OUTER_IPV6)) inner_l3_offset += m->outer_l2_len + m->outer_l3_len; - if ((ol_flags & PKT_TX_UDP_CKSUM) == PKT_TX_UDP_CKSUM) { - if (ol_flags & PKT_TX_IPV4) { - ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, - inner_l3_offset); + if (ol_flags & PKT_TX_IPV4) { + ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + inner_l3_offset); - if (ol_flags & PKT_TX_IP_CKSUM) - ipv4_hdr->hdr_checksum = 0; + if (ol_flags & PKT_TX_IP_CKSUM) + ipv4_hdr->hdr_checksum = 0; + } + if ((ol_flags & PKT_TX_UDP_CKSUM) == PKT_TX_UDP_CKSUM) { + if (ol_flags & PKT_TX_IPV4) { udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr + m->l3_len); udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ipv4_hdr, @@ -148,12 +150,6 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) } else if ((ol_flags & PKT_TX_TCP_CKSUM) || (ol_flags & PKT_TX_TCP_SEG)) { if (ol_flags & PKT_TX_IPV4) { - ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, - inner_l3_offset); - - if (ol_flags & PKT_TX_IP_CKSUM) - ipv4_hdr->hdr_checksum = 0; - /* non-TSO tcp or TSO */ tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + m->l3_len); -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:45.918977040 -0800 +++ 0014-net-fix-Intel-prepare-function-for-IP-checksum-offlo.patch 2018-11-29 15:01:44.988966000 -0800 @@ -1,15 +1,16 @@ -From ae0207d4b5048a6af9bc30e0956d30461b813148 Mon Sep 17 00:00:00 2001 +From 2cde73859e2e2530ebe8247dc43704e7be7354f8 Mon Sep 17 00:00:00 2001 From: Didier Pallard Date: Wed, 19 Sep 2018 16:42:08 +0200 Subject: [PATCH] net: fix Intel prepare function for IP checksum offload +[ upstream commit ae0207d4b5048a6af9bc30e0956d30461b813148 ] + Current Intel tx prepare function does not properly handle the case where only IP checksum is requested, without requesting any L4 checksum or TSO: IP checksum is not properly reset to 0 and output packet may contain invalid IP checksum. Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") -Cc: stable@dpdk.org Signed-off-by: Didier Pallard Acked-by: Konstantin Ananyev @@ -18,10 +19,10 @@ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h -index b6ab6e1d5..e59760a0a 100644 +index 79c764adc..5e80dd896 100644 --- a/lib/librte_net/rte_net.h +++ b/lib/librte_net/rte_net.h -@@ -122,14 +122,16 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) +@@ -124,14 +124,16 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) (ol_flags & PKT_TX_OUTER_IPV6)) inner_l3_offset += m->outer_l2_len + m->outer_l3_len; @@ -44,7 +45,7 @@ udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr + m->l3_len); udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ipv4_hdr, -@@ -146,12 +148,6 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) +@@ -148,12 +150,6 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) } else if ((ol_flags & PKT_TX_TCP_CKSUM) || (ol_flags & PKT_TX_TCP_SEG)) { if (ol_flags & PKT_TX_IPV4) {