patch 'examples/ipsec-secgw: use Tx checksum offload conditionally' has been queued to stable release 20.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 3 10:26:41 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.7

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/05/22. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/5f5d17a1149855eee2b8145e3f18bac976d13207

Thanks.

Luca Boccassi

---
>From 5f5d17a1149855eee2b8145e3f18bac976d13207 Mon Sep 17 00:00:00 2001
From: Nithin Dabilpuram <ndabilpuram at marvell.com>
Date: Thu, 21 Jul 2022 21:01:31 +0530
Subject: [PATCH] examples/ipsec-secgw: use Tx checksum offload conditionally

[ upstream commit 4edcee19fc20be7c28da3e06e3be5e8567162f01 ]

Use Tx checksum offload only when all the ports have it enabled as
the qconf for a particular lcore stores ipv4_offloads for all the
Tx ports and each lcore can Tx to any port.

Fixes: 03128be4cd4d ("examples/ipsec-secgw: allow disabling some Rx/Tx offloads")

Signed-off-by: Nithin Dabilpuram <ndabilpuram at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 091f54f065..c2fb95f890 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2262,12 +2262,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads)
 		qconf = &lcore_conf[lcore_id];
 		qconf->tx_queue_id[portid] = tx_queueid;
 
-		/* Pre-populate pkt offloads based on capabilities */
-		qconf->outbound.ipv4_offloads = PKT_TX_IPV4;
-		qconf->outbound.ipv6_offloads = PKT_TX_IPV6;
-		if (local_port_conf.txmode.offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)
-			qconf->outbound.ipv4_offloads |= PKT_TX_IP_CKSUM;
-
 		tx_queueid++;
 
 		/* init RX queues */
@@ -2807,6 +2801,7 @@ main(int32_t argc, char **argv)
 	uint64_t req_rx_offloads[RTE_MAX_ETHPORTS];
 	uint64_t req_tx_offloads[RTE_MAX_ETHPORTS];
 	struct eh_conf *eh_conf = NULL;
+	uint32_t ipv4_cksum_port_mask = 0;
 	size_t sess_sz;
 
 	nb_bufs_in_pool = 0;
@@ -2912,6 +2907,20 @@ main(int32_t argc, char **argv)
 				&req_tx_offloads[portid]);
 		port_init(portid, req_rx_offloads[portid],
 				req_tx_offloads[portid]);
+		if ((req_tx_offloads[portid] & DEV_TX_OFFLOAD_IPV4_CKSUM))
+			ipv4_cksum_port_mask = 1U << portid;
+	}
+
+	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
+		if (rte_lcore_is_enabled(lcore_id) == 0)
+			continue;
+
+		/* Pre-populate pkt offloads based on capabilities */
+		lcore_conf[lcore_id].outbound.ipv4_offloads = PKT_TX_IPV4;
+		lcore_conf[lcore_id].outbound.ipv6_offloads = PKT_TX_IPV6;
+		/* Update per lcore checksum offload support only if all ports support it */
+		if (ipv4_cksum_port_mask == enabled_port_mask)
+			lcore_conf[lcore_id].outbound.ipv4_offloads |= PKT_TX_IP_CKSUM;
 	}
 
 	/*
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-11-03 09:27:26.832335511 +0000
+++ 0023-examples-ipsec-secgw-use-Tx-checksum-offload-conditi.patch	2022-11-03 09:27:25.337421744 +0000
@@ -1 +1 @@
-From 4edcee19fc20be7c28da3e06e3be5e8567162f01 Mon Sep 17 00:00:00 2001
+From 5f5d17a1149855eee2b8145e3f18bac976d13207 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4edcee19fc20be7c28da3e06e3be5e8567162f01 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 815b9254ae..8a25b83535 100644
+index 091f54f065..c2fb95f890 100644
@@ -23 +24 @@
-@@ -1998,12 +1998,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads)
+@@ -2262,12 +2262,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads)
@@ -28,4 +29,4 @@
--		qconf->outbound.ipv4_offloads = RTE_MBUF_F_TX_IPV4;
--		qconf->outbound.ipv6_offloads = RTE_MBUF_F_TX_IPV6;
--		if (local_port_conf.txmode.offloads & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM)
--			qconf->outbound.ipv4_offloads |= RTE_MBUF_F_TX_IP_CKSUM;
+-		qconf->outbound.ipv4_offloads = PKT_TX_IPV4;
+-		qconf->outbound.ipv6_offloads = PKT_TX_IPV6;
+-		if (local_port_conf.txmode.offloads & DEV_TX_OFFLOAD_IPV4_CKSUM)
+-			qconf->outbound.ipv4_offloads |= PKT_TX_IP_CKSUM;
@@ -36 +37 @@
-@@ -2925,6 +2919,7 @@ main(int32_t argc, char **argv)
+@@ -2807,6 +2801,7 @@ main(int32_t argc, char **argv)
@@ -44 +45 @@
-@@ -3046,6 +3041,20 @@ main(int32_t argc, char **argv)
+@@ -2912,6 +2907,20 @@ main(int32_t argc, char **argv)
@@ -48 +49 @@
-+		if ((req_tx_offloads[portid] & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM))
++		if ((req_tx_offloads[portid] & DEV_TX_OFFLOAD_IPV4_CKSUM))
@@ -57,2 +58,2 @@
-+		lcore_conf[lcore_id].outbound.ipv4_offloads = RTE_MBUF_F_TX_IPV4;
-+		lcore_conf[lcore_id].outbound.ipv6_offloads = RTE_MBUF_F_TX_IPV6;
++		lcore_conf[lcore_id].outbound.ipv4_offloads = PKT_TX_IPV4;
++		lcore_conf[lcore_id].outbound.ipv6_offloads = PKT_TX_IPV6;
@@ -61 +62 @@
-+			lcore_conf[lcore_id].outbound.ipv4_offloads |= RTE_MBUF_F_TX_IP_CKSUM;
++			lcore_conf[lcore_id].outbound.ipv4_offloads |= PKT_TX_IP_CKSUM;


More information about the stable mailing list