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

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


[ upstream commit 61847adc98057c0e500c65110a83181b7db4ebc9 ]

There exists exit point between the reconfigure logic and the store
logic of the VF 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: 7f8e73201dae ("net/nfp: move VF functions into its own file")

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

diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 14d4864c1e..ed80487acb 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -122,6 +122,8 @@ nfp_netvf_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
@@ -131,8 +133,6 @@ nfp_netvf_start(struct rte_eth_dev *dev)
 		goto error;
 	}
 
-	hw->ctrl = new_ctrl;
-
 	return 0;
 
 error:
-- 
2.39.1



More information about the stable mailing list