DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	stable@dpdk.org, Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 1/3] net/nfp: fix the reconfigure logic in PF initialization
Date: Sat, 28 Oct 2023 14:23:13 +0800	[thread overview]
Message-ID: <20231028062315.1843075-2-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231028062315.1843075-1-chaoyong.he@corigine.com>

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@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@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


  reply	other threads:[~2023-10-28  6:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  6:23 [PATCH 0/3] Fix some reconfigure problem Chaoyong He
2023-10-28  6:23 ` Chaoyong He [this message]
2023-10-28  6:23 ` [PATCH 2/3] net/nfp: fix the reconfigure logic in VF initialization Chaoyong He
2023-10-28  6:23 ` [PATCH 3/3] net/nfp: fix the reconfigure logic of set mac address Chaoyong He
2023-10-31 12:55 ` [PATCH 0/3] Fix some reconfigure problem Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231028062315.1843075-2-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).