[dpdk-stable] patch 'net/iavf: fix link speed' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:23 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From b639786c5f18b036a2dbe95637281ad75083ccad Mon Sep 17 00:00:00 2001
From: Alvin Zhang <alvinx.zhang at intel.com>
Date: Thu, 30 Apr 2020 11:21:11 +0800
Subject: [PATCH] net/iavf: fix link speed

[ upstream commit 5330b042977c61b1600700013c6ef2509d496b16 ]

If the PF driver does not support the new speed reporting capabilities
then use link_event instead of link_event_adv to get the speed.

Fixes: 48de41ca11f0 ("net/avf: enable link status update")

Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
Acked-by: Beilei Xing <beilei.xing at intel.com>
---
 drivers/net/iavf/iavf_vchnl.c | 41 ++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index cf0f6458ed..149673b9b3 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -132,6 +132,38 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 	return err;
 }
 
+static uint32_t
+iavf_convert_link_speed(enum virtchnl_link_speed virt_link_speed)
+{
+	uint32_t speed;
+
+	switch (virt_link_speed) {
+	case VIRTCHNL_LINK_SPEED_100MB:
+		speed = 100;
+		break;
+	case VIRTCHNL_LINK_SPEED_1GB:
+		speed = 1000;
+		break;
+	case VIRTCHNL_LINK_SPEED_10GB:
+		speed = 10000;
+		break;
+	case VIRTCHNL_LINK_SPEED_40GB:
+		speed = 40000;
+		break;
+	case VIRTCHNL_LINK_SPEED_20GB:
+		speed = 20000;
+		break;
+	case VIRTCHNL_LINK_SPEED_25GB:
+		speed = 25000;
+		break;
+	default:
+		speed = 0;
+		break;
+	}
+
+	return speed;
+}
+
 static void
 iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
 			uint16_t msglen)
@@ -153,7 +185,14 @@ 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;
-		vf->link_speed = pf_msg->event_data.link_event_adv.link_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;
+		} else {
+			enum virtchnl_link_speed speed;
+			speed = pf_msg->event_data.link_event.link_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);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:52.225467416 +0100
+++ 0188-net-iavf-fix-link-speed.patch	2020-05-19 14:04:44.536654173 +0100
@@ -1,25 +1,26 @@
-From 5330b042977c61b1600700013c6ef2509d496b16 Mon Sep 17 00:00:00 2001
+From b639786c5f18b036a2dbe95637281ad75083ccad Mon Sep 17 00:00:00 2001
 From: Alvin Zhang <alvinx.zhang at intel.com>
 Date: Thu, 30 Apr 2020 11:21:11 +0800
 Subject: [PATCH] net/iavf: fix link speed
 
+[ upstream commit 5330b042977c61b1600700013c6ef2509d496b16 ]
+
 If the PF driver does not support the new speed reporting capabilities
 then use link_event instead of link_event_adv to get the speed.
 
 Fixes: 48de41ca11f0 ("net/avf: enable link status update")
-Cc: stable at dpdk.org
 
 Signed-off-by: Alvin Zhang <alvinx.zhang at intel.com>
 Acked-by: Beilei Xing <beilei.xing at intel.com>
 ---
- drivers/net/iavf/iavf_vchnl.c | 47 ++++++++++++++++++++++++++++++++++-
- 1 file changed, 46 insertions(+), 1 deletion(-)
+ drivers/net/iavf/iavf_vchnl.c | 41 ++++++++++++++++++++++++++++++++++-
+ 1 file changed, 40 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
-index 2a0cdd927f..5b8d32ee24 100644
+index cf0f6458ed..149673b9b3 100644
 --- a/drivers/net/iavf/iavf_vchnl.c
 +++ b/drivers/net/iavf/iavf_vchnl.c
-@@ -130,6 +130,44 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
+@@ -132,6 +132,38 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
  	return err;
  }
  
@@ -47,12 +48,6 @@
 +	case VIRTCHNL_LINK_SPEED_25GB:
 +		speed = 25000;
 +		break;
-+	case VIRTCHNL_LINK_SPEED_2_5GB:
-+		speed = 2500;
-+		break;
-+	case VIRTCHNL_LINK_SPEED_5GB:
-+		speed = 5000;
-+		break;
 +	default:
 +		speed = 0;
 +		break;
@@ -64,7 +59,7 @@
  static void
  iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
  			uint16_t msglen)
-@@ -151,7 +189,14 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t *msg,
+@@ -153,7 +185,14 @@ 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;


More information about the stable mailing list