[dpdk-stable] patch 'net/hns3: fix queue flow action validation' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:28:39 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. 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.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/0c355fecc0a6662a3fb9e97e56186e9565dd678b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 0c355fecc0a6662a3fb9e97e56186e9565dd678b Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang at huawei.com>
Date: Mon, 30 Aug 2021 16:26:49 +0800
Subject: [PATCH] net/hns3: fix queue flow action validation
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit aa3497d4450a603ca18ae4971a96e3890824d887 ]

The used_rx_queues only takes effect after device is started, and
its value is incorrect before the device is started. Therefore, it
is not suitable for flow action to use it to verify the queue index
before the device is started.

E.g. Enable dedicated queue in bonding device will configure a queue
flow action before start its slave devices. The above problem will
make this reasonable flow action configuration fail.

This patch use the nb_rx_queues from the configuration phase to
achieve verification.

Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Fixes: f8e7fcbfd0b8 ("net/hns3: support flow action of queue region")

Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 70c45f6bc5..7f8dd91d11 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -275,10 +275,10 @@ hns3_handle_action_queue(struct rte_eth_dev *dev,
 	struct hns3_hw *hw = &hns->hw;
 
 	queue = (const struct rte_flow_action_queue *)action->conf;
-	if (queue->index >= hw->used_rx_queues) {
+	if (queue->index >= hw->data->nb_rx_queues) {
 		hns3_err(hw, "queue ID(%u) is greater than number of "
 			  "available queue (%u) in driver.",
-			  queue->index, hw->used_rx_queues);
+			  queue->index, hw->data->nb_rx_queues);
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  action, "Invalid queue ID in PF");
@@ -308,8 +308,8 @@ hns3_handle_action_queue_region(struct rte_eth_dev *dev,
 
 	if ((!rte_is_power_of_2(conf->queue_num)) ||
 		conf->queue_num > hw->rss_size_max ||
-		conf->queue[0] >= hw->used_rx_queues ||
-		conf->queue[0] + conf->queue_num > hw->used_rx_queues) {
+		conf->queue[0] >= hw->data->nb_rx_queues ||
+		conf->queue[0] + conf->queue_num > hw->data->nb_rx_queues) {
 		return rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ACTION_CONF, action,
 			"Invalid start queue ID and queue num! the start queue "
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:03.677735225 +0800
+++ 0035-net-hns3-fix-queue-flow-action-validation.patch	2021-11-10 14:17:01.780746827 +0800
@@ -1 +1 @@
-From aa3497d4450a603ca18ae4971a96e3890824d887 Mon Sep 17 00:00:00 2001
+From 0c355fecc0a6662a3fb9e97e56186e9565dd678b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit aa3497d4450a603ca18ae4971a96e3890824d887 ]
@@ -20 +22,0 @@
-Cc: stable at dpdk.org
@@ -29 +31 @@
-index fc77979c5f..841e0b9da3 100644
+index 70c45f6bc5..7f8dd91d11 100644


More information about the stable mailing list