From patchwork Mon Mar 7 19:26:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kathleen Capella X-Patchwork-Id: 108585 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9785BA0093; Mon, 7 Mar 2022 20:26:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 245E340688; Mon, 7 Mar 2022 20:26:56 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id CA5C04014E for ; Mon, 7 Mar 2022 20:26:54 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 36BD9153B; Mon, 7 Mar 2022 11:26:54 -0800 (PST) Received: from n1sdp-1.usa.Arm.com (n1sdp-1.usa.arm.com [10.118.91.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2E7F73F7F5; Mon, 7 Mar 2022 11:26:54 -0800 (PST) From: Kathleen Capella To: Jingjing Wu , Beilei Xing Cc: dev@dpdk.org, nd@arm.com, honnappa.nagarahalli@arm.com, joyce.kong@arm.com, Kathleen Capella Subject: [PATCH] net/iavf: replace SMP barrier with thread fence Date: Mon, 7 Mar 2022 19:26:44 +0000 Message-Id: <20220307192644.31721-1-kathleen.capella@arm.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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] https://patches.dpdk.org/project/dpdk/patch/20210706065404.25137-3- joyce.kong@arm.com/ Signed-off-by: Kathleen Capella Reviewed-by: Joyce Kong Reviewed-by: Qi Zhang --- drivers/net/iavf/iavf_rxtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index cb779879cb..47f12a9b28 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++) {