* [dpdk-dev] [PATCH] net/iavf: fix link status
@ 2020-09-18 9:47 murphy yang
2020-09-23 23:27 ` Zhang, Qi Z
0 siblings, 1 reply; 2+ messages in thread
From: murphy yang @ 2020-09-18 9:47 UTC (permalink / raw)
To: dev; +Cc: murphy, stable
From: murphy <murphyx.yang@intel.com>
If the PF driver supports the new speed reporting capabilities
then use link_event_adv instead of link_event to get the speed.
Fixes: 5330b042977c ("net/iavf: fix link speed")
Cc: stable@dpdk.org
Signed-off-by: murphy <murphyx.yang@intel.com>
---
drivers/net/iavf/iavf_vchnl.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 76f8e38d1..c4956dc58 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -195,14 +195,13 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
case VIRTCHNL_EVENT_LINK_CHANGE:
PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
vf->link_up = pf_msg->event_data.link_event.link_status;
+ enum virtchnl_link_speed speed;
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) {
- vf->link_speed =
- pf_msg->event_data.link_event_adv.link_speed;
+ speed = pf_msg->event_data.link_event_adv.link_speed;
} else {
- enum virtchnl_link_speed speed;
speed = pf_msg->event_data.link_event.link_speed;
- vf->link_speed = iavf_convert_link_speed(speed);
}
+ vf->link_speed = iavf_convert_link_speed(speed);
iavf_dev_link_update(dev, 0);
rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
break;
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] net/iavf: fix link status
2020-09-18 9:47 [dpdk-dev] [PATCH] net/iavf: fix link status murphy yang
@ 2020-09-23 23:27 ` Zhang, Qi Z
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2020-09-23 23:27 UTC (permalink / raw)
To: Yang, MurphyX, dev; +Cc: Yang, MurphyX, stable
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of murphy yang
> Sent: Friday, September 18, 2020 5:47 PM
> To: dev@dpdk.org
> Cc: Yang, MurphyX <murphyx.yang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/iavf: fix link status
>
> From: murphy <murphyx.yang@intel.com>
>
> If the PF driver supports the new speed reporting capabilities then use
> link_event_adv instead of link_event to get the speed.
>
> Fixes: 5330b042977c ("net/iavf: fix link speed")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: murphy <murphyx.yang@intel.com>
> ---
> drivers/net/iavf/iavf_vchnl.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 76f8e38d1..c4956dc58 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -195,14 +195,13 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev,
> uint8_t *msg,
> case VIRTCHNL_EVENT_LINK_CHANGE:
> PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_LINK_CHANGE event");
> vf->link_up = pf_msg->event_data.link_event.link_status;
> + enum virtchnl_link_speed speed;
> if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_ADV_LINK_SPEED)
> {
> - vf->link_speed =
> - pf_msg->event_data.link_event_adv.link_speed;
> + speed = pf_msg->event_data.link_event_adv.link_speed;
According to vritual channel spec, link_event_adv.link_speed should store the link_speed provided in Mbps, it no need to be further converted.
If the value is wrong, it should be fixed in kernel driver.
> } else {
> - enum virtchnl_link_speed speed;
> speed = pf_msg->event_data.link_event.link_speed;
> - vf->link_speed = iavf_convert_link_speed(speed);
> }
> + vf->link_speed = iavf_convert_link_speed(speed);
> iavf_dev_link_update(dev, 0);
> rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
> NULL);
> break;
> --
> 2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-23 23:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 9:47 [dpdk-dev] [PATCH] net/iavf: fix link status murphy yang
2020-09-23 23:27 ` Zhang, Qi Z
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).