patch 'net/tap: fix IPv4 checksum offloading' has been queued to stable release 20.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 8 20:25:24 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/10/23. 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. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/8932ba110ac486f7fec81fa3bee5c2e25a2c0e8c

Thanks.

Luca Boccassi

---
>From 8932ba110ac486f7fec81fa3bee5c2e25a2c0e8c Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 24 Aug 2023 09:18:21 +0200
Subject: [PATCH] net/tap: fix IPv4 checksum offloading

[ upstream commit 3e9c82e88069b1e6e945479626b4c054edf8ba96 ]

Checking that one of RTE_MBUF_F_TX_IPV4 or RTE_MBUF_F_TX_IP_CKSUM is
present is not compliant with the offloading API which specifies that IP
checksum requires RTE_MBUF_F_TX_IP_CKSUM.
On the other hand, RTE_MBUF_F_TX_IP_CKSUM is invalid for IPv6 packets,
so we can simply check for RTE_MBUF_F_TX_IP_CKSUM and assume this is an
IPv4 packet.

Fixes: 8ae3023387e9 ("net/tap: add Rx/Tx checksum offload support")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit at amd.com>
---
 drivers/net/tap/rte_eth_tap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 2a7006c7b2..67b3a45fd2 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -570,7 +570,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,
 {
 	void *l3_hdr = packet + l2_len;
 
-	if (ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4)) {
+	if (ol_flags & PKT_TX_IP_CKSUM) {
 		struct rte_ipv4_hdr *iph = l3_hdr;
 		uint16_t cksum;
 
@@ -653,7 +653,7 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs,
 
 		nb_segs = mbuf->nb_segs;
 		if (txq->csum &&
-		    ((mbuf->ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4) ||
+		    ((mbuf->ol_flags & PKT_TX_IP_CKSUM ||
 		     (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM ||
 		     (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM))) {
 			unsigned int l4_len = 0;
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-11-08 19:23:53.247309215 +0000
+++ 0026-net-tap-fix-IPv4-checksum-offloading.patch	2023-11-08 19:23:51.809397038 +0000
@@ -1 +1 @@
-From 3e9c82e88069b1e6e945479626b4c054edf8ba96 Mon Sep 17 00:00:00 2001
+From 8932ba110ac486f7fec81fa3bee5c2e25a2c0e8c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3e9c82e88069b1e6e945479626b4c054edf8ba96 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 66335d2755..939c68db9a 100644
+index 2a7006c7b2..67b3a45fd2 100644
@@ -26 +27 @@
-@@ -559,7 +559,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,
+@@ -570,7 +570,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,
@@ -30,2 +31,2 @@
--	if (ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4)) {
-+	if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) {
+-	if (ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4)) {
++	if (ol_flags & PKT_TX_IP_CKSUM) {
@@ -35 +36 @@
-@@ -642,7 +642,7 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs,
+@@ -653,7 +653,7 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs,
@@ -39,4 +40,4 @@
--		    ((mbuf->ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_IPV4) ||
-+		    ((mbuf->ol_flags & RTE_MBUF_F_TX_IP_CKSUM ||
- 		      (mbuf->ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM ||
- 		      (mbuf->ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_TCP_CKSUM))) {
+-		    ((mbuf->ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4) ||
++		    ((mbuf->ol_flags & PKT_TX_IP_CKSUM ||
+ 		     (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM ||
+ 		     (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM))) {


More information about the stable mailing list