patch 'net/mlx5: fix connection tracking action validation' has been queued to stable release 22.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Mar 14 01:09:42 CET 2024
Hi,
FYI, your patch has been queued to stable release 22.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/16/24. 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/ff41fc17f18c2f43cf675427a920ddf727a651c8
Thanks.
Luca Boccassi
---
>From ff41fc17f18c2f43cf675427a920ddf727a651c8 Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Tue, 27 Feb 2024 15:52:22 +0200
Subject: [PATCH] net/mlx5: fix connection tracking action validation
[ upstream commit bd2db022c1ad154cd996b7b858c9f04f5a458416 ]
In mlx5 PMD, handles to indirect connection tracking flow actions
are encoded as 32-bit unsigned integers, where port ID is stored
in bits 28-25. Because of this, connection tracking flow actions
cannot be created on ports with IDs higher than 15.
This patch adds missing validation.
Fixes: 463170a7c934 ("net/mlx5: support connection tracking with HWS")
Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Ori Kam <orika at nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 9 +++++++++
drivers/net/mlx5/mlx5_flow_hw.c | 7 +++++++
2 files changed, 16 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 4ce6da50e8..7ed04bdb15 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -13143,6 +13143,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev,
return rte_flow_error_set(error, ENOTSUP,
RTE_FLOW_ERROR_TYPE_ACTION, NULL,
"Connection is not supported");
+ if (dev->data->port_id >= MLX5_INDIRECT_ACT_CT_MAX_PORT) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "CT supports port indexes up to "
+ RTE_STR(MLX5_ACTION_CTX_CT_MAX_PORT));
+ return 0;
+ }
idx = flow_dv_aso_ct_alloc(dev, error);
if (!idx)
return rte_flow_error_set(error, rte_errno,
@@ -15812,6 +15819,8 @@ flow_dv_action_create(struct rte_eth_dev *dev,
case RTE_FLOW_ACTION_TYPE_CONNTRACK:
ret = flow_dv_translate_create_conntrack(dev, action->conf,
err);
+ if (!ret)
+ break;
idx = MLX5_INDIRECT_ACT_CT_GEN_IDX(PORT_ID(priv), ret);
break;
default:
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 948c56099f..fe50d23987 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -7708,6 +7708,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,
"CT is not enabled");
return 0;
}
+ if (dev->data->port_id >= MLX5_INDIRECT_ACT_CT_MAX_PORT) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+ "CT supports port indexes up to "
+ RTE_STR(MLX5_ACTION_CTX_CT_MAX_PORT));
+ return 0;
+ }
ct = mlx5_ipool_zmalloc(pool->cts, &ct_idx);
if (!ct) {
rte_flow_error_set(error, rte_errno,
--
2.39.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-03-14 00:09:22.819810014 +0000
+++ 0046-net-mlx5-fix-connection-tracking-action-validation.patch 2024-03-14 00:09:20.681616571 +0000
@@ -1 +1 @@
-From bd2db022c1ad154cd996b7b858c9f04f5a458416 Mon Sep 17 00:00:00 2001
+From ff41fc17f18c2f43cf675427a920ddf727a651c8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit bd2db022c1ad154cd996b7b858c9f04f5a458416 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 75a8a223ab..ddf19e9a51 100644
+index 4ce6da50e8..7ed04bdb15 100644
@@ -26 +27 @@
-@@ -13889,6 +13889,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev,
+@@ -13143,6 +13143,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev,
@@ -40 +41 @@
-@@ -16586,6 +16593,8 @@ flow_dv_action_create(struct rte_eth_dev *dev,
+@@ -15812,6 +15819,8 @@ flow_dv_action_create(struct rte_eth_dev *dev,
@@ -50 +51 @@
-index c8440262d8..43bde71c93 100644
+index 948c56099f..fe50d23987 100644
@@ -53 +54 @@
-@@ -10346,6 +10346,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,
+@@ -7708,6 +7708,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,
More information about the stable
mailing list