[dpdk-stable] patch 'net/hns3: fix RSS key length' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:03:31 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 0bd1d3b49ce2c0c2c14ce5fb5fefa0c7677c9d7d Mon Sep 17 00:00:00 2001
From: Lijun Ou <oulijun at huawei.com>
Date: Fri, 10 Apr 2020 19:09:28 +0800
Subject: [PATCH] net/hns3: fix RSS key length

[ upstream commit 708e60a4e63c872573e11befa9a073125395343d ]

When upper application calls the rte_eth_dev_rss_hash_conf_get API
function to get the RSS key parameters, the function should return the
RSS key length supported by the device. Otherwise, an error will occur
when the upper application needs to use the RSS key length supported
by this specified hardware for judgment and configure the specified
key into hardware.

For example, in the following scenario:
When users want to use their own RSS key, but the length of the key is
bigger than the one of the supported by hardware.

As a result, users need to get the RSS key length supported by hardware
according to the above API firstly, and then compare the actual obtained
RSS key length with the length of their own RSS key.

If the driver does not return the actual value, error may occur when
user calls the rte_eth_dev_rss_hash_update API function to configure
their own key into hardware.

Besides, this patch fixes the problem of stepping on memory when the RSS
key array configured by users are less than the RSS key length supported
by the driver at the same time.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")

Signed-off-by: Lijun Ou <oulijun at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 9b6b72908f..ff2da5afd7 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -322,8 +322,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	rss_conf->rss_hf = rss_cfg->conf.types;
 
 	/* Get the RSS Key required by the user */
-	if (rss_conf->rss_key)
+	if (rss_conf->rss_key && rss_conf->rss_key_len >= HNS3_RSS_KEY_SIZE) {
 		memcpy(rss_conf->rss_key, rss_cfg->key, HNS3_RSS_KEY_SIZE);
+		rss_conf->rss_key_len = HNS3_RSS_KEY_SIZE;
+	}
 	rte_spinlock_unlock(&hw->lock);
 
 	return 0;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:47.562523801 +0100
+++ 0076-net-hns3-fix-RSS-key-length.patch	2020-05-19 14:04:44.240648808 +0100
@@ -1,8 +1,10 @@
-From 708e60a4e63c872573e11befa9a073125395343d Mon Sep 17 00:00:00 2001
+From 0bd1d3b49ce2c0c2c14ce5fb5fefa0c7677c9d7d Mon Sep 17 00:00:00 2001
 From: Lijun Ou <oulijun at huawei.com>
 Date: Fri, 10 Apr 2020 19:09:28 +0800
 Subject: [PATCH] net/hns3: fix RSS key length
 
+[ upstream commit 708e60a4e63c872573e11befa9a073125395343d ]
+
 When upper application calls the rte_eth_dev_rss_hash_conf_get API
 function to get the RSS key parameters, the function should return the
 RSS key length supported by the device. Otherwise, an error will occur
@@ -27,7 +29,6 @@
 by the driver at the same time.
 
 Fixes: c37ca66f2b27 ("net/hns3: support RSS")
-Cc: stable at dpdk.org
 
 Signed-off-by: Lijun Ou <oulijun at huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -38,10 +39,10 @@
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
-index 95a637ddc2..a6cab29c93 100644
+index 9b6b72908f..ff2da5afd7 100644
 --- a/drivers/net/hns3/hns3_rss.c
 +++ b/drivers/net/hns3/hns3_rss.c
-@@ -328,8 +328,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
+@@ -322,8 +322,10 @@ hns3_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
  	rss_conf->rss_hf = rss_cfg->conf.types;
  
  	/* Get the RSS Key required by the user */


More information about the stable mailing list