[PATCH v2 05/10] net/nfp: fix problem caused by configure function
Chaoyong He
chaoyong.he at corigine.com
Sat Oct 12 04:41:02 CEST 2024
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")
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>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/nfp/nfp_ethdev.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 405386e882..2fe6b1a292 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -527,26 +527,36 @@ nfp_net_start(struct rte_eth_dev *dev)
static int
nfp_net_set_link_up(struct rte_eth_dev *dev)
{
+ int ret;
struct nfp_net_hw *hw;
struct nfp_net_hw_priv *hw_priv;
hw = dev->data->dev_private;
hw_priv = dev->process_private;
- 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 (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;
struct nfp_net_hw_priv *hw_priv;
hw = dev->data->dev_private;
hw_priv = dev->process_private;
- 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 (ret < 0)
+ return ret;
+
+ return 0;
}
static void
--
2.39.1
More information about the dev
mailing list