From: Chaoyong He <chaoyong.he@corigine.com>
To: stable@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 23.11] net/nfp: fix VF link speed problem
Date: Mon, 24 Feb 2025 16:01:42 +0800 [thread overview]
Message-ID: <20250224080142.436542-1-chaoyong.he@corigine.com> (raw)
From: Long Wu <long.wu@corigine.com>
[ upstream commit c43d2aab426bdc6e22142b4c5667d6d1634248de ]
The previous logic does not update the 'rte_eth_device' link status
when the port link status changed, which cause the firmware won't be
notified by the PMD.
Furthermore, the physical representor port should also notify firmware
its current speed with multi-pf firmware.
Fix these problems by modify the related logic, also add needed helper
function at the same time.
Fixes: eae7dadbe987 ("net/nfp: update link status reporting")
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/flower/nfp_flower_ctrl.c | 14 ++++++++++++++
drivers/net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/flower/nfp_flower_representor.h | 2 ++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c
index 102daa3d70..574e4fa056 100644
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.c
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c
@@ -419,6 +419,8 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower,
struct rte_mbuf *pkt_burst)
{
uint32_t port;
+ uint16_t link_status;
+ struct rte_eth_dev *eth_dev;
struct nfp_flower_representor *repr;
struct nfp_flower_cmsg_port_mod *msg;
@@ -447,11 +449,23 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower,
}
repr->link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
+
+ link_status = repr->link.link_status;
if ((msg->info & NFP_FLOWER_CMSG_PORT_MOD_INFO_LINK) != 0)
repr->link.link_status = RTE_ETH_LINK_UP;
else
repr->link.link_status = RTE_ETH_LINK_DOWN;
+ if (link_status != repr->link.link_status) {
+ eth_dev = rte_eth_dev_get_by_name(repr->name);
+ if (eth_dev == NULL) {
+ PMD_DRV_LOG(ERR, "Can not get ethernet device by name %s.", repr->name);
+ return -EINVAL;
+ }
+
+ nfp_flower_repr_link_update(eth_dev, 0);
+ }
+
return 0;
}
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index ada28d07c6..a86b6bb580 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -18,7 +18,7 @@ enum nfp_repr_type {
NFP_REPR_TYPE_MAX, /*<< Number of representor types */
};
-static int
+int
nfp_flower_repr_link_update(struct rte_eth_dev *dev,
__rte_unused int wait_to_complete)
{
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.h b/drivers/net/nfp/flower/nfp_flower_representor.h
index 8053617562..ea912ddcd4 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.h
+++ b/drivers/net/nfp/flower/nfp_flower_representor.h
@@ -24,5 +24,7 @@ struct nfp_flower_representor {
};
int nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower);
+int nfp_flower_repr_link_update(struct rte_eth_dev *dev,
+ __rte_unused int wait_to_complete);
#endif /* __NFP_FLOWER_REPRESENTOR_H__ */
--
2.43.5
reply other threads:[~2025-02-24 8:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250224080142.436542-1-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=long.wu@corigine.com \
--cc=oss-drivers@corigine.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).