[4/8] net/nfp: rename PF speed update function

Message ID 20240905062511.2710102-5-chaoyong.he@corigine.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series fix the representor port link status and speed |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Sept. 5, 2024, 6:25 a.m. UTC
From: Qin Ke <qin.ke@corigine.com>

Rename PF speed update function of 'nfp_net_speed_aneg_update()'
to 'nfp_net_pf_speed_update()', which make codes more readable.

Also use maroc to replace the hard coded value.

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-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_net_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index c918469047..6761a16ef2 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -742,7 +742,7 @@  nfp_net_allmulticast_disable(struct rte_eth_dev *dev)
 }
 
 static void
-nfp_net_speed_aneg_update(struct rte_eth_dev *dev,
+nfp_net_pf_speed_update(struct rte_eth_dev *dev,
 		struct nfp_net_hw *hw,
 		struct nfp_net_hw_priv *hw_priv,
 		struct rte_eth_link *link)
@@ -807,14 +807,14 @@  nfp_net_link_update_common(struct rte_eth_dev *dev,
 	hw_priv = dev->process_private;
 	if (link->link_status == RTE_ETH_LINK_UP) {
 		if (hw_priv->is_pf)
-			nfp_net_speed_aneg_update(dev, hw, hw_priv, link);
+			nfp_net_pf_speed_update(dev, hw, hw_priv, link);
 		else
 			nfp_net_vf_speed_update(link, link_status);
 	}
 
 	ret = rte_eth_linkstatus_set(dev, link);
 	if (ret == 0) {
-		if (link->link_status != 0)
+		if (link->link_status == RTE_ETH_LINK_UP)
 			PMD_DRV_LOG(INFO, "NIC Link is Up");
 		else
 			PMD_DRV_LOG(INFO, "NIC Link is Down");