DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally
@ 2022-07-21 15:31 Nithin Dabilpuram
  2022-07-21 15:31 ` [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation Nithin Dabilpuram
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nithin Dabilpuram @ 2022-07-21 15:31 UTC (permalink / raw)
  To: Radu Nicolau, Akhil Goyal
  Cc: jerinj, dev, Nithin Dabilpuram, konstantin.ananyev

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")
Cc: konstantin.ananyev@intel.com

Signed-off-by: Nithin Dabilpuram <ndabilpuram@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 815b925..8a25b83 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1998,12 +1998,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 = 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;
-
 		tx_queueid++;
 
 		/* init RX queues */
@@ -2925,6 +2919,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;
@@ -3046,6 +3041,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] & RTE_ETH_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 = RTE_MBUF_F_TX_IPV4;
+		lcore_conf[lcore_id].outbound.ipv6_offloads = RTE_MBUF_F_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 |= RTE_MBUF_F_TX_IP_CKSUM;
 	}
 
 	/*
-- 
2.8.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation
  2022-07-21 15:31 [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Nithin Dabilpuram
@ 2022-07-21 15:31 ` Nithin Dabilpuram
  2022-08-25  8:13   ` Akhil Goyal
  2022-08-25  8:11 ` [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Akhil Goyal
  2022-08-28  8:52 ` Akhil Goyal
  2 siblings, 1 reply; 5+ messages in thread
From: Nithin Dabilpuram @ 2022-07-21 15:31 UTC (permalink / raw)
  To: Ruifeng Wang, Radu Nicolau, Akhil Goyal
  Cc: jerinj, dev, Nithin Dabilpuram, rbhansali

Fix issue with ip header pointer computation to pick the right offset.

Fixes: 6eb3ba03995c ("examples/ipsec-secgw: support poll mode NEON LPM lookup")
Cc: rbhansali@marvell.com

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 examples/ipsec-secgw/ipsec_neon.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/ipsec_neon.h b/examples/ipsec-secgw/ipsec_neon.h
index 3f2d0a0..f6ba287 100644
--- a/examples/ipsec-secgw/ipsec_neon.h
+++ b/examples/ipsec-secgw/ipsec_neon.h
@@ -47,7 +47,7 @@ processx4_step3(struct rte_mbuf *pkts[FWDSTEP], uint16_t dst_port[FWDSTEP],
 			pkt->ol_flags |= tx_offloads;
 
 			ip = (struct rte_ipv4_hdr *)
-				(p[i] + RTE_ETHER_HDR_LEN + 1);
+				(((uintptr_t)p[i]) + RTE_ETHER_HDR_LEN);
 			ip->hdr_checksum = 0;
 
 			/* calculate IPv4 cksum in SW */
-- 
2.8.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally
  2022-07-21 15:31 [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Nithin Dabilpuram
  2022-07-21 15:31 ` [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation Nithin Dabilpuram
@ 2022-08-25  8:11 ` Akhil Goyal
  2022-08-28  8:52 ` Akhil Goyal
  2 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2022-08-25  8:11 UTC (permalink / raw)
  To: Nithin Kumar Dabilpuram, Radu Nicolau, konstantin.v.ananyev
  Cc: Jerin Jacob Kollanukkaran, dev, Nithin Kumar Dabilpuram, Fan Zhang


> Subject: [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally
> 
> 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")
> Cc: konstantin.ananyev@intel.com
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation
  2022-07-21 15:31 ` [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation Nithin Dabilpuram
@ 2022-08-25  8:13   ` Akhil Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2022-08-25  8:13 UTC (permalink / raw)
  To: Nithin Kumar Dabilpuram, Ruifeng Wang, Radu Nicolau
  Cc: Jerin Jacob Kollanukkaran, dev, Nithin Kumar Dabilpuram, Rahul Bhansali


> Subject: [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation
Title should be 
examples/ipsec-secgw: fix IP header manipulation

Will fix while applying.

> 
> Fix issue with ip header pointer computation to pick the right offset.
> 
> Fixes: 6eb3ba03995c ("examples/ipsec-secgw: support poll mode NEON LPM
> lookup")
> Cc: rbhansali@marvell.com
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally
  2022-07-21 15:31 [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Nithin Dabilpuram
  2022-07-21 15:31 ` [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation Nithin Dabilpuram
  2022-08-25  8:11 ` [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Akhil Goyal
@ 2022-08-28  8:52 ` Akhil Goyal
  2 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2022-08-28  8:52 UTC (permalink / raw)
  To: Nithin Kumar Dabilpuram, Radu Nicolau
  Cc: Jerin Jacob Kollanukkaran, dev, Nithin Kumar Dabilpuram,
	konstantin.ananyev

> Subject: [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally
> 
> 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")
> Cc: konstantin.ananyev@intel.com
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> ---
Series applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-28  8:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 15:31 [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Nithin Dabilpuram
2022-07-21 15:31 ` [PATCH 2/2] examples/ipsec-secgw: fix issue with IP hdr manipulation Nithin Dabilpuram
2022-08-25  8:13   ` Akhil Goyal
2022-08-25  8:11 ` [PATCH 1/2] examples/ipsec-secgw: use Tx cksum offload conditionally Akhil Goyal
2022-08-28  8:52 ` Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).