[8/8] net/nfp: fix representor port link status update problem

Message ID 20240905062511.2710102-9-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
ci/Intel-compilation warning apply issues

Commit Message

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

The link status of representor port is reported by the flower
firmware through control message and it already parsed and
stored in the 'link' field of representor port structure.

The original logic read link status from the control BAR again,
and use it rather then the 'link' field of the representor port
structure in the following logic wrongly.

Fix this by delete the read control BAR statement and use the
right link status value.

Fixes: c4de52eca76c ("net/nfp: remove redundancy for representor port")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org

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/flower/nfp_flower_representor.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 054ea1a938..5db7d50618 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -29,18 +29,13 @@  nfp_flower_repr_link_update(struct rte_eth_dev *dev,
 		__rte_unused int wait_to_complete)
 {
 	int ret;
-	uint32_t nn_link_status;
-	struct nfp_net_hw *pf_hw;
 	struct rte_eth_link *link;
 	struct nfp_flower_representor *repr;
 
 	repr = dev->data->dev_private;
 	link = &repr->link;
 
-	pf_hw = repr->app_fw_flower->pf_hw;
-	nn_link_status = nn_cfg_readw(&pf_hw->super, NFP_NET_CFG_STS);
-
-	ret = nfp_net_link_update_common(dev, link, nn_link_status);
+	ret = nfp_net_link_update_common(dev, link, link->link_status);
 
 	return ret;
 }