[dpdk-stable] patch 'net/mlx5: fix RSS queue type validation' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 25 10:02:45 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

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/26/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.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/5dddc14e74efb55760af7dced98dc45a4d7ddd5a

Thanks.

Luca Boccassi

---
>From 5dddc14e74efb55760af7dced98dc45a4d7ddd5a Mon Sep 17 00:00:00 2001
From: Xiaoyu Min <jackmin at nvidia.com>
Date: Mon, 16 Nov 2020 10:07:59 +0800
Subject: [PATCH] net/mlx5: fix RSS queue type validation

[ upstream commit 765633655c76292cf24cee3641e7f87e96a3e0d6 ]

When the RSS queues' types are not uniformed, i.e, mixed with normal Rx
queue and hairpin queue, PMD accept this flow after commit[1] instead of
rejecting it.

This because commit[1] creates Rx queue object as DevX type via DevX API
instead of IBV type via Verbs, in which the latter will check the queues'
type when creating Verbs ind table but the former doesn't check when
creating DevX ind table.

However, in any case, logically PMD should check whether the input
configuration of RSS action is reasonable or not, which should
include queues' type check as well as the others.

So add the check of RSS queues' type in validation function to fix issue.

[1]:
commit 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")

Fixes: 63bd16292c3a ("net/mlx5: support RSS on hairpin")

Signed-off-by: Xiaoyu Min <jackmin at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index b05dbaf9a1..b2e457faec 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1121,6 +1121,7 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
 	struct mlx5_priv *priv = dev->data->dev_private;
 	const struct rte_flow_action_rss *rss = action->conf;
 	int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
+	enum mlx5_rxq_type rxq_type = MLX5_RXQ_TYPE_UNDEFINED;
 	unsigned int i;
 
 	if (action_flags & MLX5_FLOW_FATE_ACTIONS)
@@ -1179,6 +1180,8 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 					  NULL, "No queues configured");
 	for (i = 0; i != rss->queue_num; ++i) {
+		struct mlx5_rxq_ctrl *rxq_ctrl;
+
 		if (rss->queue[i] >= priv->rxqs_n)
 			return rte_flow_error_set
 				(error, EINVAL,
@@ -1188,6 +1191,15 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
 			return rte_flow_error_set
 				(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF,
 				 &rss->queue[i], "queue is not configured");
+		rxq_ctrl = container_of((*priv->rxqs)[rss->queue[i]],
+					struct mlx5_rxq_ctrl, rxq);
+		if (i == 0)
+			rxq_type = rxq_ctrl->type;
+		if (rxq_type != rxq_ctrl->type)
+			return rte_flow_error_set
+				(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+				 &rss->queue[i],
+				 "combining hairpin and regular RSS queues is not supported");
 	}
 	if (attr->egress)
 		return rte_flow_error_set(error, ENOTSUP,
-- 
2.27.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-24 16:50:36.667402998 +0000
+++ 0003-net-mlx5-fix-RSS-queue-type-validation.patch	2020-11-24 16:50:36.541495723 +0000
@@ -1 +1 @@
-From 765633655c76292cf24cee3641e7f87e96a3e0d6 Mon Sep 17 00:00:00 2001
+From 5dddc14e74efb55760af7dced98dc45a4d7ddd5a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 765633655c76292cf24cee3641e7f87e96a3e0d6 ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -34 +35 @@
-index c4071cd939..ad891d6758 100644
+index b05dbaf9a1..b2e457faec 100644
@@ -37,2 +38 @@
-@@ -1411,6 +1411,7 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev,
- {
+@@ -1121,6 +1121,7 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
@@ -40,0 +41 @@
+ 	int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
@@ -44,2 +45,2 @@
- 	if (rss->func != RTE_ETH_HASH_FUNCTION_DEFAULT &&
-@@ -1476,6 +1477,8 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev,
+ 	if (action_flags & MLX5_FLOW_FATE_ACTIONS)
+@@ -1179,6 +1180,8 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
@@ -54 +55 @@
-@@ -1485,6 +1488,15 @@ mlx5_validate_action_rss(struct rte_eth_dev *dev,
+@@ -1188,6 +1191,15 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
@@ -68,2 +69,2 @@
- 	return 0;
- }
+ 	if (attr->egress)
+ 		return rte_flow_error_set(error, ENOTSUP,


More information about the stable mailing list