patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: stable@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 21.11] net/nfp: fix reconfigure logic in PF initialization
Date: Fri, 17 Nov 2023 11:14:58 +0800	[thread overview]
Message-ID: <20231117031500.1609817-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231117031500.1609817-1-chaoyong.he@corigine.com>

[ 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@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


  parent reply	other threads:[~2023-11-17  3:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  3:14 [PATCH 21.11] net/nfp: fix DMA error after abnormal exit Chaoyong He
2023-11-17  3:14 ` [PATCH 21.11] net/nfp: fix link status interrupt Chaoyong He
2023-11-17  3:14 ` Chaoyong He [this message]
2023-11-17  3:14 ` [PATCH 21.11] net/nfp: fix reconfigure logic in VF initialization Chaoyong He
2023-11-17  3:15 ` [PATCH 21.11] net/nfp: fix reconfigure logic of set MAC address Chaoyong He
2023-11-23 10:48 ` [PATCH 21.11] net/nfp: fix DMA error after abnormal exit Kevin Traynor

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=20231117031500.1609817-3-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=oss-drivers@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).