patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 20.11] net/nfp: fix reconfigure logic in PF initialization
@ 2023-11-09  2:33 Chaoyong He
  2023-11-09 11:34 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2023-11-09  2:33 UTC (permalink / raw)
  To: stable; +Cc: oss-drivers, Chaoyong He

[ 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_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 4b890e3375..102d8f2938 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -746,6 +746,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
@@ -764,8 +766,6 @@ nfp_net_start(struct rte_eth_dev *dev)
 					       hw->pf_port_idx, 1);
 	}
 
-	hw->ctrl = new_ctrl;
-
 	return 0;
 
 error:
-- 
2.39.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 20.11] net/nfp: fix reconfigure logic in PF initialization
  2023-11-09  2:33 [PATCH 20.11] net/nfp: fix reconfigure logic in PF initialization Chaoyong He
@ 2023-11-09 11:34 ` Luca Boccassi
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Boccassi @ 2023-11-09 11:34 UTC (permalink / raw)
  To: Chaoyong He; +Cc: stable, oss-drivers

On Thu, 9 Nov 2023 at 02:52, Chaoyong He <chaoyong.he@corigine.com> wrote:
>
> [ 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_net.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
> index 4b890e3375..102d8f2938 100644
> --- a/drivers/net/nfp/nfp_net.c
> +++ b/drivers/net/nfp/nfp_net.c
> @@ -746,6 +746,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
> @@ -764,8 +766,6 @@ nfp_net_start(struct rte_eth_dev *dev)
>                                                hw->pf_port_idx, 1);
>         }
>
> -       hw->ctrl = new_ctrl;
> -
>         return 0;
>
>  error:
> --
> 2.39.1

Thanks, applied both fixes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-09 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09  2:33 [PATCH 20.11] net/nfp: fix reconfigure logic in PF initialization Chaoyong He
2023-11-09 11:34 ` Luca Boccassi

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).