<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your help, patch queued to 23.11.4 LTS release staging</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Xueming</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Chaoyong He <chaoyong.he@corigine.com><br>
<b>Sent:</b> Monday, February 24, 2025 4:01 PM<br>
<b>To:</b> stable@dpdk.org <stable@dpdk.org><br>
<b>Cc:</b> oss-drivers@corigine.com <oss-drivers@corigine.com>; Long Wu <long.wu@corigine.com>; Chaoyong He <chaoyong.he@corigine.com><br>
<b>Subject:</b> [PATCH 23.11] net/nfp: fix VF link speed problem</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Long Wu <long.wu@corigine.com><br>
<br>
[ upstream commit c43d2aab426bdc6e22142b4c5667d6d1634248de ]<br>
<br>
The previous logic does not update the 'rte_eth_device' link status<br>
when the port link status changed, which cause the firmware won't be<br>
notified by the PMD.<br>
Furthermore, the physical representor port should also notify firmware<br>
its current speed with multi-pf firmware.<br>
<br>
Fix these problems by modify the related logic, also add needed helper<br>
function at the same time.<br>
<br>
Fixes: eae7dadbe987 ("net/nfp: update link status reporting")<br>
<br>
Signed-off-by: Long Wu <long.wu@corigine.com><br>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com><br>
---<br>
drivers/net/nfp/flower/nfp_flower_ctrl.c | 14 ++++++++++++++<br>
drivers/net/nfp/flower/nfp_flower_representor.c | 2 +-<br>
drivers/net/nfp/flower/nfp_flower_representor.h | 2 ++<br>
3 files changed, 17 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c<br>
index 102daa3d70..574e4fa056 100644<br>
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.c<br>
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c<br>
@@ -419,6 +419,8 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower,<br>
struct rte_mbuf *pkt_burst)<br>
{<br>
uint32_t port;<br>
+ uint16_t link_status;<br>
+ struct rte_eth_dev *eth_dev;<br>
struct nfp_flower_representor *repr;<br>
struct nfp_flower_cmsg_port_mod *msg;<br>
<br>
@@ -447,11 +449,23 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower,<br>
}<br>
<br>
repr->link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;<br>
+<br>
+ link_status = repr->link.link_status;<br>
if ((msg->info & NFP_FLOWER_CMSG_PORT_MOD_INFO_LINK) != 0)<br>
repr->link.link_status = RTE_ETH_LINK_UP;<br>
else<br>
repr->link.link_status = RTE_ETH_LINK_DOWN;<br>
<br>
+ if (link_status != repr->link.link_status) {<br>
+ eth_dev = rte_eth_dev_get_by_name(repr->name);<br>
+ if (eth_dev == NULL) {<br>
+ PMD_DRV_LOG(ERR, "Can not get ethernet device by name %s.", repr->name);<br>
+ return -EINVAL;<br>
+ }<br>
+<br>
+ nfp_flower_repr_link_update(eth_dev, 0);<br>
+ }<br>
+<br>
return 0;<br>
}<br>
<br>
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c<br>
index ada28d07c6..a86b6bb580 100644<br>
--- a/drivers/net/nfp/flower/nfp_flower_representor.c<br>
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c<br>
@@ -18,7 +18,7 @@ enum nfp_repr_type {<br>
NFP_REPR_TYPE_MAX, /*<< Number of representor types */<br>
};<br>
<br>
-static int<br>
+int<br>
nfp_flower_repr_link_update(struct rte_eth_dev *dev,<br>
__rte_unused int wait_to_complete)<br>
{<br>
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.h b/drivers/net/nfp/flower/nfp_flower_representor.h<br>
index 8053617562..ea912ddcd4 100644<br>
--- a/drivers/net/nfp/flower/nfp_flower_representor.h<br>
+++ b/drivers/net/nfp/flower/nfp_flower_representor.h<br>
@@ -24,5 +24,7 @@ struct nfp_flower_representor {<br>
};<br>
<br>
int nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower);<br>
+int nfp_flower_repr_link_update(struct rte_eth_dev *dev,<br>
+ __rte_unused int wait_to_complete);<br>
<br>
#endif /* __NFP_FLOWER_REPRESENTOR_H__ */<br>
-- <br>
2.43.5<br>
<br>
</div>
</span></font></div>
</body>
</html>