DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix descriptor scan on Arm
@ 2025-12-02  6:04 xiejianhua
  0 siblings, 0 replies; only message in thread
From: xiejianhua @ 2025-12-02  6:04 UTC (permalink / raw)
  To: Bruce Richardson, Anatoly Burakov, dev
  Cc: Yuhailong, Joyce Kong, Ruifeng Wang, Jianhua Xie

From: Yuhailong <yuhailong1088@phytium.com.cn>

This patch borrows i40 patch:
commit 65b2ec7b4f6b ("net/i40e: fix descriptor scan on Arm")

For Arm platforms, reading descs can get re-ordered, then the status
of DD bits will be discontinuous, so add the logic to only process
continuous descs by checking DD bits.

Cc: Joyce Kong <joyce.kong@arm.com>
Cc: Ruifeng Wang <ruifeng.wang@arm.com>

Signed-off-by: Yuhailong <yuhailong1088@phytium.com.cn>
Signed-off-by: Jianhua Xie <xiejianhua@phytium.com.cn>
---
 drivers/net/intel/ice/ice_rxtx.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/intel/ice/ice_rxtx.c b/drivers/net/intel/ice/ice_rxtx.c
index 74db0fbec9..b9358e49ba 100644
--- a/drivers/net/intel/ice/ice_rxtx.c
+++ b/drivers/net/intel/ice/ice_rxtx.c
@@ -1888,7 +1888,7 @@ ice_rx_scan_hw_ring(struct ci_rx_queue *rxq)
 	struct rte_mbuf *mb;
 	uint16_t stat_err0;
 	uint16_t pkt_len, hdr_len;
-	int32_t s[ICE_LOOK_AHEAD], nb_dd;
+	int32_t s[ICE_LOOK_AHEAD], nb_dd, var = 0;
 	int32_t i, j, nb_rx = 0;
 	uint64_t pkt_flags = 0;
 	uint32_t *ptype_tbl = rxq->ice_vsi->adapter->ptype_tbl;
@@ -1930,8 +1930,18 @@ ice_rx_scan_hw_ring(struct ci_rx_queue *rxq)
 		rte_smp_rmb();
 
 		/* Compute how many status bits were set */
-		for (j = 0, nb_dd = 0; j < ICE_LOOK_AHEAD; j++)
-			nb_dd += s[j] & (1 << ICE_RX_FLEX_DESC_STATUS0_DD_S);
+		for (j = 0, nb_dd = 0; j < ICE_LOOK_AHEAD; j++) {
+			var = s[j] & (1 << ICE_RX_FLEX_DESC_STATUS0_DD_S);
+#ifdef RTE_ARCH_ARM
+			/* For Arm platforms, only compute continuous status bits */
+			if (var)
+				nb_dd += 1;
+			else
+				break;
+#else
+			nb_dd += var;
+#endif
+		}
 
 		nb_rx += nb_dd;
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-02  6:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-02  6:04 [PATCH] net/ice: fix descriptor scan on Arm xiejianhua

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).