[PATCH 1/3] net/nfp: fix the reconfigure logic in PF initialization

Chaoyong He chaoyong.he at corigine.com
Sat Oct 28 08:23:13 CEST 2023


There exists exit point between the reconfigure logic and the stroe
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")
Cc: stable at dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
Reviewed-by: Peng Zhang <peng.zhang 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 76317925ec..0a0e3d6375 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -141,6 +141,8 @@ nfp_net_start(struct rte_eth_dev *dev)
 	if (nfp_reconfig(hw, new_ctrl, update) != 0)
 		return -EIO;
 
+	hw->ctrl = new_ctrl;
+
 	/* Enable packet type offload by extend ctrl word1. */
 	cap_extend = hw->cap_ext;
 	if ((cap_extend & NFP_NET_CFG_CTRL_PKT_TYPE) != 0)
@@ -171,8 +173,6 @@ nfp_net_start(struct rte_eth_dev *dev)
 	else
 		nfp_eth_set_configured(dev->process_private, net_hw->nfp_idx, 1);
 
-	hw->ctrl = new_ctrl;
-
 	for (i = 0; i < dev->data->nb_rx_queues; i++)
 		dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
 	for (i = 0; i < dev->data->nb_tx_queues; i++)
-- 
2.39.1



More information about the stable mailing list