From: Kathleen Capella Date: Mon, 7 Mar 2022 19:26:44 +0000 (+0000) Subject: net/iavf: replace SMP barrier with thread fence in Rx X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8b421290fb427b7bd402d520b54eff1065e65221;p=dpdk.git net/iavf: replace SMP barrier with thread fence in Rx Replace the SMP barrier with atomic thread fence for iavf hw ring scan in the bulk Rx path. This patch introduces a change to the iavf driver that was already added to the i40e driver [1] as part of the adoption of the use of compiler atomics. [1]Commit 8649e2356689 ("net/i40e: replace SMP barrier with thread fence in Rx") Signed-off-by: Kathleen Capella Reviewed-by: Joyce Kong Reviewed-by: Qi Zhang --- diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 16e8d021f9..d2cc3ed4bd 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -1843,7 +1843,8 @@ iavf_rx_scan_hw_ring_flex_rxd(struct iavf_rx_queue *rxq) for (j = IAVF_LOOK_AHEAD - 1; j >= 0; j--) s[j] = rte_le_to_cpu_16(rxdp[j].wb.status_error0); - rte_smp_rmb(); + /* This barrier is to order loads of different words in the descriptor */ + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); /* Compute how many contiguous DD bits were set */ for (j = 0, nb_dd = 0; j < IAVF_LOOK_AHEAD; j++) { @@ -1946,7 +1947,8 @@ iavf_rx_scan_hw_ring(struct iavf_rx_queue *rxq) IAVF_RXD_QW1_STATUS_SHIFT; } - rte_smp_rmb(); + /* This barrier is to order loads of different words in the descriptor */ + rte_atomic_thread_fence(__ATOMIC_ACQUIRE); /* Compute how many contiguous DD bits were set */ for (j = 0, nb_dd = 0; j < IAVF_LOOK_AHEAD; j++) {