DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40e: i40evf link status is always down with the Intel XL710 driver
@ 2020-05-13 14:38 Scott Wasson
  2020-05-14  9:40 ` Laurent Hardy
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Wasson @ 2020-05-13 14:38 UTC (permalink / raw)
  To: li_hong.bi, beilei.xing, jia.guo; +Cc: dev, scott_wasson, laurent.hardy

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-14  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 14:38 [dpdk-dev] [PATCH] i40e: i40evf link status is always down with the Intel XL710 driver Scott Wasson
2020-05-14  9:40 ` Laurent Hardy

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).