DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/17] net/cnxk: update mbuf next field for multi segment
@ 2026-06-11  7:32 Rahul Bhansali
  2026-06-11  7:32 ` [PATCH 02/17] common/cnxk: add API of SA valid for cn20k platform Rahul Bhansali
                   ` (17 more replies)
  0 siblings, 18 replies; 41+ messages in thread
From: Rahul Bhansali @ 2026-06-11  7:32 UTC (permalink / raw)
  To: dev, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Harman Kalra
  Cc: jerinj, Rahul Bhansali

As per the requirement of rte_mbuf_raw_reset_bulk(), the mbuf's
'next' and 'nb_segs' fields are required to be reset.
This reset these field for multi-segment mbufs on cn9k platform.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn9k_rx.h |  8 --------
 drivers/net/cnxk/cn9k_tx.h | 42 ++++++++++++++++++--------------------
 2 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/drivers/net/cnxk/cn9k_rx.h b/drivers/net/cnxk/cn9k_rx.h
index 79b56fe160..5ccdc5dee1 100644
--- a/drivers/net/cnxk/cn9k_rx.h
+++ b/drivers/net/cnxk/cn9k_rx.h
@@ -410,8 +410,6 @@ cn9k_nix_cqe_to_mbuf(const struct nix_cqe_hdr_s *cq, const uint32_t tag,
 		 * Hence, flag argument is not required.
 		 */
 		nix_cqe_xtract_mseg(rx, mbuf, val, 0);
-	else
-		mbuf->next = NULL;
 }
 
 static inline uint16_t
@@ -826,12 +824,6 @@ cn9k_nix_recv_pkts_vector(void *rx_queue, struct rte_mbuf **rx_pkts,
 			nix_cqe_xtract_mseg((union nix_rx_parse_u *)
 						(cq0 + CQE_SZ(3) + 8), mbuf3,
 					    mbuf_initializer, flags);
-		} else {
-			/* Update that no more segments */
-			mbuf0->next = NULL;
-			mbuf1->next = NULL;
-			mbuf2->next = NULL;
-			mbuf3->next = NULL;
 		}
 
 		/* Store the mbufs to rx_pkts */
diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h
index 32665d2050..0ec448e36c 100644
--- a/drivers/net/cnxk/cn9k_tx.h
+++ b/drivers/net/cnxk/cn9k_tx.h
@@ -665,14 +665,14 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq, struct rte_mbuf *m, struct rte_m
 #else
 	RTE_SET_USED(cookie);
 #endif
-#ifdef RTE_ENABLE_ASSERT
-	m->next = NULL;
-	m->nb_segs = 1;
-#endif
-	m = m_next;
-	if (!m)
+	if (likely(!m_next))
 		goto done;
 
+	if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) {
+		m->next = NULL;
+		m->nb_segs = 1;
+	}
+	m = m_next;
 	/* Fill mbuf segments */
 	do {
 		m_next = m->next;
@@ -704,12 +704,13 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq, struct rte_mbuf *m, struct rte_m
 			sg_u = sg->u;
 			slist++;
 		}
-#ifdef RTE_ENABLE_ASSERT
-		m->next = NULL;
-#endif
+		if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+			m->next = NULL;
 		m = m_next;
 	} while (nb_segs);
 
+	if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+		rte_io_wmb();
 done:
 	sg->u = sg_u;
 	sg->segs = i;
@@ -720,9 +721,6 @@ cn9k_nix_prepare_mseg(struct cn9k_eth_txq *txq, struct rte_mbuf *m, struct rte_m
 	segdw += (off >> 1) + 1 + !!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
 	send_hdr->w0.sizem1 = segdw - 1;
 
-#ifdef RTE_ENABLE_ASSERT
-	rte_io_wmb();
-#endif
 	return segdw;
 }
 
@@ -950,10 +948,10 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 	RTE_SET_USED(cookie);
 #endif
 
-#ifdef RTE_ENABLE_ASSERT
-	m->next = NULL;
-	m->nb_segs = 1;
-#endif
+	if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)) {
+		m->next = NULL;
+		m->nb_segs = 1;
+	}
 	m = m_next;
 	/* Fill mbuf segments */
 	do {
@@ -984,9 +982,8 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 			sg_u = sg->u;
 			slist++;
 		}
-#ifdef RTE_ENABLE_ASSERT
-		m->next = NULL;
-#endif
+		if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+			m->next = NULL;
 		m = m_next;
 	} while (nb_segs);
 
@@ -1002,9 +999,6 @@ cn9k_nix_prepare_mseg_vec_list(struct cn9k_eth_txq *txq,
 		 !!(flags & NIX_TX_OFFLOAD_TSTAMP_F);
 	send_hdr->w0.sizem1 = segdw - 1;
 
-#ifdef RTE_ENABLE_ASSERT
-	rte_io_wmb();
-#endif
 	return segdw;
 }
 
@@ -1089,6 +1083,10 @@ cn9k_nix_xmit_pkts_mseg_vector(uint64x2_t *cmd0, uint64x2_t *cmd1,
 		}
 	}
 
+	/* Multi segment mbufs */
+	if (!(flags & NIX_TX_OFFLOAD_MBUF_NOFF_F))
+		rte_io_wmb();
+
 	for (j = 0; j < NIX_DESCS_PER_LOOP;) {
 		/* Fit consecutive packets in same LMTLINE. */
 		if ((segdw[j] + segdw[j + 1]) <= 8) {
-- 
2.34.1


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

end of thread, other threads:[~2026-06-11 17:23 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11  7:32 [PATCH 01/17] net/cnxk: update mbuf next field for multi segment Rahul Bhansali
2026-06-11  7:32 ` [PATCH 02/17] common/cnxk: add API of SA valid for cn20k platform Rahul Bhansali
2026-06-11  7:32 ` [PATCH 03/17] common/cnxk: additional NIX SQ ctx fields prints Rahul Bhansali
2026-06-11  7:32 ` [PATCH 04/17] common/cnxk: update NIX irq handler Rahul Bhansali
2026-06-11  7:32 ` [PATCH 05/17] common/cnxk: configure LSO mask for single segments Rahul Bhansali
2026-06-11  7:33 ` [PATCH 06/17] net/cnxk: reserve memory for lookup mem at probe Rahul Bhansali
2026-06-11  7:33 ` [PATCH 07/17] drivers: add support for devargs skip size Rahul Bhansali
2026-06-11  7:33 ` [PATCH 08/17] net/cnxk: update inbound SA pkind for " Rahul Bhansali
2026-06-11  7:33 ` [PATCH 09/17] common/cnxk: fix cnxk xstats names Rahul Bhansali
2026-06-11  7:33 ` [PATCH 10/17] common/cnxk: fix event type for soft expiry Rahul Bhansali
2026-06-11  7:33 ` [PATCH 11/17] net/cnxk: enable CPT CQ by default for inline IPsec Rahul Bhansali
2026-06-11  7:33 ` [PATCH 12/17] net/cnxk: fix unsigned integer underflow in LSO calculation Rahul Bhansali
2026-06-11  7:33 ` [PATCH 13/17] net/cnxk: derive ethdev from SA for inbound CPT CQ events Rahul Bhansali
2026-06-11  7:33 ` [PATCH 14/17] net/cnxk: fix bitwise operand size mismatch in link mode Rahul Bhansali
2026-06-11  7:33 ` [PATCH 15/17] common/cnxk: add cipher key length check in key set Rahul Bhansali
2026-06-11  7:33 ` [PATCH 16/17] common/cnxk: fix Klocwork static analysis issues Rahul Bhansali
2026-06-11  7:33 ` [PATCH 17/17] common/cnxk: add auth key len check in inbound SA Rahul Bhansali
2026-06-11 14:20 ` [PATCH v2 01/22] net/cnxk: update mbuf next field for multi segment Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 02/22] common/cnxk: add API of SA valid for cn20k platform Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 03/22] common/cnxk: additional NIX SQ ctx fields prints Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 04/22] common/cnxk: update NIX irq handler Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 05/22] common/cnxk: configure LSO mask for single segments Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 06/22] net/cnxk: reserve memory for lookup mem at probe Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 07/22] drivers: add support for devargs skip size Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 08/22] net/cnxk: update inbound SA pkind for " Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 09/22] common/cnxk: fix cnxk xstats names Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 10/22] common/cnxk: fix event type for soft expiry Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 11/22] net/cnxk: enable CPT CQ by default for inline IPsec Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 12/22] net/cnxk: fix unsigned integer underflow in LSO calculation Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 13/22] net/cnxk: derive ethdev from SA for inbound CPT CQ events Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 14/22] net/cnxk: fix bitwise operand size mismatch in link mode Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 15/22] common/cnxk: add cipher key length check in key set Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 16/22] common/cnxk: fix Klocwork static analysis issues Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 17/22] common/cnxk: add auth key len check in inbound SA Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 18/22] common/cnxk: add FEC configuration support Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 19/22] net/cnxk: add FEC get set and capability ops Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 20/22] event/cnxk: fix Klocwork static analysis issues Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 21/22] crypto/cnxk: enforce DES/3DES cipher key length Rahul Bhansali
2026-06-11 14:20   ` [PATCH v2 22/22] common/cnxk: fix TM link config selection in debug dump Rahul Bhansali
2026-06-11 15:26   ` [PATCH v2 01/22] net/cnxk: update mbuf next field for multi segment Stephen Hemminger
2026-06-11 17:23 ` [PATCH 01/17] " Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox