patch 'net/nfp: fix link change return value' has been queued to stable release 23.11.3

Xueming Li xuemingl at nvidia.com
Mon Nov 11 07:28:24 CET 2024


Hi,

FYI, your patch has been queued to stable release 23.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/30/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=882c4f80f60bf33988eb31bf85d6104e7461be6d

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 882c4f80f60bf33988eb31bf85d6104e7461be6d Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he at corigine.com>
Date: Sat, 12 Oct 2024 10:41:02 +0800
Subject: [PATCH] net/nfp: fix link change return value
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 0ca4f216b89162ce8142d665a98924bdf4a23a6e ]

The return value of 'nfp_eth_set_configured()' is three ways, the
original logic considered it as two ways wrongly.

Fixes: 61d4008fe6bb ("net/nfp: support setting link up/down")

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>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/nfp/nfp_ethdev.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 7495b01f16..e704c90dc5 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -201,30 +201,40 @@ error:
 static int
 nfp_net_set_link_up(struct rte_eth_dev *dev)
 {
+	int ret;
 	struct nfp_net_hw *hw;

 	hw = dev->data->dev_private;

 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
 		/* Configure the physical port down */
-		return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1);
+		ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1);
 	else
-		return nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1);
+		ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }

 /* Set the link down. */
 static int
 nfp_net_set_link_down(struct rte_eth_dev *dev)
 {
+	int ret;
 	struct nfp_net_hw *hw;

 	hw = dev->data->dev_private;

 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
 		/* Configure the physical port down */
-		return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0);
+		ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0);
 	else
-		return nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0);
+		ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }

 static uint8_t
--
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-11 14:23:09.547676450 +0800
+++ 0098-net-nfp-fix-link-change-return-value.patch	2024-11-11 14:23:05.252192837 +0800
@@ -1 +1 @@
-From 0ca4f216b89162ce8142d665a98924bdf4a23a6e Mon Sep 17 00:00:00 2001
+From 882c4f80f60bf33988eb31bf85d6104e7461be6d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 0ca4f216b89162ce8142d665a98924bdf4a23a6e ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -17,2 +19,2 @@
- drivers/net/nfp/nfp_ethdev.c | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
+ drivers/net/nfp/nfp_ethdev.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
@@ -21 +23 @@
-index 4b31785b9f..ef1c2a94b7 100644
+index 7495b01f16..e704c90dc5 100644
@@ -24 +26 @@
-@@ -527,26 +527,36 @@ error:
+@@ -201,30 +201,40 @@ error:
@@ -30 +31,0 @@
- 	struct nfp_net_hw_priv *hw_priv;
@@ -33 +33,0 @@
- 	hw_priv = dev->process_private;
@@ -35,2 +35,7 @@
--	return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1);
-+	ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 1);
+ 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ 		/* Configure the physical port down */
+-		return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1);
++		ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 1);
+ 	else
+-		return nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1);
++		ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1);
@@ -49 +53,0 @@
- 	struct nfp_net_hw_priv *hw_priv;
@@ -52 +55,0 @@
- 	hw_priv = dev->process_private;
@@ -54,2 +57,7 @@
--	return nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0);
-+	ret = nfp_eth_set_configured(hw_priv->pf_dev->cpp, hw->nfp_idx, 0);
+ 	if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ 		/* Configure the physical port down */
+-		return nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0);
++		ret = nfp_eth_set_configured(hw->cpp, hw->nfp_idx, 0);
+ 	else
+-		return nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0);
++		ret = nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 0);
@@ -62 +70 @@
- static void
+ static uint8_t


More information about the stable mailing list