From: "Scott Wasson" <scott_wasson@affirmednetworks.com>
To: li_hong.bi@nokia-sbell.com, beilei.xing@intel.com, jia.guo@intel.com
Cc: dev@dpdk.org, scott_wasson <scott_wasson@affirmednetworks.com>,
laurent.hardy@6wind.com
Subject: [dpdk-dev] [PATCH] i40e: i40evf link status is always down with the Intel XL710 driver
Date: Wed, 13 May 2020 10:38:29 -0400 [thread overview]
Message-ID: <1589380709-6030-1-git-send-email-scott_wasson@affirmednetworks.com> (raw)
It is necessary to convert the link_speed, in Mbps, to the I40E_LINK_SPEED enum
Fixes: 3c8c0b68b590 ("net/i40e: set speed to undefined for default case")
Cc: laurent.hardy@6wind.com
Bugzilla ID: 461
Signed-off-by: scott_wasson <scott_wasson@affirmednetworks.com>
---
drivers/net/i40e/i40e_ethdev_vf.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index bb5d28a..7aa48f3 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1363,7 +1363,30 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
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;
- vf->link_speed = pf_msg->event_data.link_event.link_speed;
+
+ switch (pf_msg->event_data.link_event.link_speed) {
+ case ETH_SPEED_NUM_100M:
+ vf->link_speed = I40E_LINK_SPEED_100MB;
+ break;
+ case ETH_SPEED_NUM_1G:
+ vf->link_speed = I40E_LINK_SPEED_1GB;
+ break;
+ case ETH_SPEED_NUM_10G:
+ vf->link_speed = I40E_LINK_SPEED_10GB;
+ break;
+ case ETH_SPEED_NUM_20G:
+ vf->link_speed = I40E_LINK_SPEED_20GB;
+ break;
+ case ETH_SPEED_NUM_25G:
+ vf->link_speed = I40E_LINK_SPEED_25GB;
+ break;
+ case ETH_SPEED_NUM_40G:
+ vf->link_speed = I40E_LINK_SPEED_40GB;
+ break;
+ default:
+ vf->link_speed = I40E_LINK_SPEED_UNKNOWN;
+ break;
+ }
break;
case VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_PF_DRIVER_CLOSE event");
--
1.7.6.3
next reply other threads:[~2020-05-13 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 14:38 Scott Wasson [this message]
2020-05-14 9:40 ` Laurent Hardy
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=1589380709-6030-1-git-send-email-scott_wasson@affirmednetworks.com \
--to=scott_wasson@affirmednetworks.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jia.guo@intel.com \
--cc=laurent.hardy@6wind.com \
--cc=li_hong.bi@nokia-sbell.com \
/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).