[dpdk-stable] patch 'net/hns3: fix return value of setting VLAN offload' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:29 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 8081044a6f8bfc1dc46a2d9866b7550f446adbf5 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Thu, 26 Mar 2020 15:14:33 +0800
Subject: [PATCH] net/hns3: fix return value of setting VLAN offload

[ upstream commit e7f4213c304bd8d71fc3ca7702c85c434eff0805 ]

Currently, the '.vlan_offload_set' ops implementation function named
hns3vf_vlan_offload_set always return 0 in hns3 VF PMD driver.

This patch fixes it with the following modification in the function
named hns3vf_vlan_offload_set.
1. Avoid setting hardware configuration and return -EIO during resetting.
2. Add the return value detection process for calling internal static
   function named hns3vf_en_hw_strip_rxvtag.

Fixes: a5475d61fa34 ("net/hns3: support VF")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 879851630d..6f8e909f62 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -896,6 +896,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 	unsigned int tmp_mask;
+	int ret = 0;
+
+	if (rte_atomic16_read(&hw->reset.resetting)) {
+		hns3_err(hw, "vf set vlan offload failed during resetting, "
+			     "mask = 0x%x", mask);
+		return -EIO;
+	}
 
 	tmp_mask = (unsigned int)mask;
 	/* Vlan stripping setting */
@@ -903,13 +910,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 		rte_spinlock_lock(&hw->lock);
 		/* Enable or disable VLAN stripping */
 		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
-			hns3vf_en_hw_strip_rxvtag(hw, true);
+			ret = hns3vf_en_hw_strip_rxvtag(hw, true);
 		else
-			hns3vf_en_hw_strip_rxvtag(hw, false);
+			ret = hns3vf_en_hw_strip_rxvtag(hw, false);
 		rte_spinlock_unlock(&hw->lock);
 	}
 
-	return 0;
+	return ret;
 }
 
 static int
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:45.154745176 +0100
+++ 0014-net-hns3-fix-return-value-of-setting-VLAN-offload.patch	2020-05-19 14:04:44.080645907 +0100
@@ -1,8 +1,10 @@
-From e7f4213c304bd8d71fc3ca7702c85c434eff0805 Mon Sep 17 00:00:00 2001
+From 8081044a6f8bfc1dc46a2d9866b7550f446adbf5 Mon Sep 17 00:00:00 2001
 From: Chengwen Feng <fengchengwen at huawei.com>
 Date: Thu, 26 Mar 2020 15:14:33 +0800
 Subject: [PATCH] net/hns3: fix return value of setting VLAN offload
 
+[ upstream commit e7f4213c304bd8d71fc3ca7702c85c434eff0805 ]
+
 Currently, the '.vlan_offload_set' ops implementation function named
 hns3vf_vlan_offload_set always return 0 in hns3 VF PMD driver.
 
@@ -13,7 +15,6 @@
    function named hns3vf_en_hw_strip_rxvtag.
 
 Fixes: a5475d61fa34 ("net/hns3: support VF")
-Cc: stable at dpdk.org
 
 Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -22,10 +23,10 @@
  1 file changed, 10 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
-index 08ae58a794..07f5ab6379 100644
+index 879851630d..6f8e909f62 100644
 --- a/drivers/net/hns3/hns3_ethdev_vf.c
 +++ b/drivers/net/hns3/hns3_ethdev_vf.c
-@@ -1150,6 +1150,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
+@@ -896,6 +896,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
  	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
  	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
  	unsigned int tmp_mask;
@@ -39,7 +40,7 @@
  
  	tmp_mask = (unsigned int)mask;
  	/* Vlan stripping setting */
-@@ -1157,13 +1164,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
+@@ -903,13 +910,13 @@ hns3vf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
  		rte_spinlock_lock(&hw->lock);
  		/* Enable or disable VLAN stripping */
  		if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)


More information about the stable mailing list