From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alejandro Lucero Subject: [PATCH] net/nfp: fix barrier location Date: Thu, 22 Feb 2018 11:30:39 +0000 Message-ID: <1519299039-2475-1-git-send-email-alejandro.lucero@netronome.com> Cc: stable@dpdk.org To: dev@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The barrier needs to be after reading the DD bit. It has not been a problem because the potential reads which can not happen before reading the DD bit seem to be far enough, so the compiler is not rescheduling them. However, a refactoring could make this problem to arise. Fixes: b812daadad0d ("nfp: add Rx and Tx") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 5180a31..fc501d6 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2019,16 +2019,16 @@ enum nfp_qcp_ptr { break; } + rxds = &rxq->rxds[rxq->rd_p]; + if ((rxds->rxd.meta_len_dd & PCIE_DESC_RX_DD) == 0) + break; + /* * Memory barrier to ensure that we won't do other * reads before the DD bit. */ rte_rmb(); - rxds = &rxq->rxds[rxq->rd_p]; - if ((rxds->rxd.meta_len_dd & PCIE_DESC_RX_DD) == 0) - break; - /* * We got a packet. Let's alloc a new mbuff for refilling the * free descriptor ring as soon as possible -- 1.9.1