DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] net/ixgbe: add a proper memory barrier for LoongArch
@ 2023-04-07  8:50 Min Zhou
  2023-04-21  1:12 ` zhoumin
  0 siblings, 1 reply; 4+ messages in thread
From: Min Zhou @ 2023-04-07  8:50 UTC (permalink / raw)
  To: qiming.yang, wenjun1.wu, zhoumin; +Cc: dev, maobibo

Segmentation fault has been observed while running the
ixgbe_recv_pkts_lro() function to receive packets on the Loongson
3C5000 processor which has 64 cores and 4 NUMA nodes.

Reason is the read ordering of the status and the rest of the
descriptor fields in this function may not be correct on the
LoongArch processor. We should add rte_rmb() to ensure the read
ordering be correct.

We also did the same thing in the ixgbe_recv_pkts() function.

Signed-off-by: Min Zhou <zhoumin@loongson.cn>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index c9d6ca9efe..16391a42f9 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1823,6 +1823,9 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		staterr = rxdp->wb.upper.status_error;
 		if (!(staterr & rte_cpu_to_le_32(IXGBE_RXDADV_STAT_DD)))
 			break;
+#if defined(RTE_ARCH_LOONGARCH)
+		rte_rmb();
+#endif
 		rxd = *rxdp;
 
 		/*
@@ -2122,6 +2125,9 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
 		if (!(staterr & IXGBE_RXDADV_STAT_DD))
 			break;
 
+#if defined(RTE_ARCH_LOONGARCH)
+		rte_rmb();
+#endif
 		rxd = *rxdp;
 
 		PMD_RX_LOG(DEBUG, "port_id=%u queue_id=%u rx_id=%u "
-- 
2.31.1


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

end of thread, other threads:[~2023-04-24 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-07  8:50 [PATCH 1/1] net/ixgbe: add a proper memory barrier for LoongArch Min Zhou
2023-04-21  1:12 ` zhoumin
2023-04-22  0:29   ` bibo, mao
2023-04-24 12:30     ` zhoumin

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