DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/nfp: fix barrier location
@ 2018-02-22 11:30 Alejandro Lucero
  2018-03-07 11:51 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Lucero @ 2018-02-22 11:30 UTC (permalink / raw)
  To: dev; +Cc: stable

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 <alejandro.lucero@netronome.com>
---
 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

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/nfp: fix barrier location
  2018-02-22 11:30 [dpdk-dev] [PATCH] net/nfp: fix barrier location Alejandro Lucero
@ 2018-03-07 11:51 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2018-03-07 11:51 UTC (permalink / raw)
  To: Alejandro Lucero, dev; +Cc: stable, Thomas Monjalon

On 2/22/2018 11:30 AM, Alejandro Lucero wrote:
> 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")
Cc: stable@dpdk.org

> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>

Applied to dpdk-next-net/master, thanks.


Unrelated to this patch but nfp driver is still missing:
1- SPDX licensing tags
2- new offloading API.

Can you please plan for them for this release? Specially second one is important
because missing it may break the driver for this release.

Thanks,
ferruh

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

end of thread, other threads:[~2018-03-07 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 11:30 [dpdk-dev] [PATCH] net/nfp: fix barrier location Alejandro Lucero
2018-03-07 11:51 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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