[PATCH 21.11] net/nfp: fix reconfigure logic in PF initialization

Chaoyong He chaoyong.he at corigine.com
Fri Nov 17 04:14:58 CET 2023


[ upstream commit 1e80c07472aeed5669c79c0430b8aeece5129a20 ]

There exists exit point between the reconfigure logic and the store
logic of the PF initialization, this may lead one situation that value
in the config bar is not same with the value stored in the data
structure.

Fix this by move up the store statement.

Fixes: b812daadad0d ("nfp: add Rx and Tx")

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 37593fd216..83232d4b73 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -167,6 +167,8 @@ nfp_net_start(struct rte_eth_dev *dev)
 	if (nfp_net_reconfig(hw, new_ctrl, update) < 0)
 		return -EIO;
 
+	hw->ctrl = new_ctrl;
+
 	/*
 	 * Allocating rte mbufs for configured rx queues.
 	 * This requires queues being enabled before
@@ -183,8 +185,6 @@ nfp_net_start(struct rte_eth_dev *dev)
 		nfp_eth_set_configured(dev->process_private,
 				       hw->nfp_idx, 1);
 
-	hw->ctrl = new_ctrl;
-
 	return 0;
 
 error:
-- 
2.39.1



More information about the stable mailing list