patch 'net/mlx5: prevent querying aged flows on uninit port' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 14 01:09:38 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/afe47440d13a52b9493c3e8776fa0d369436806b

Thanks.

Luca Boccassi

---
>From afe47440d13a52b9493c3e8776fa0d369436806b Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz at nvidia.com>
Date: Wed, 21 Feb 2024 05:23:22 +0200
Subject: [PATCH] net/mlx5: prevent querying aged flows on uninit port

[ upstream commit 3b1ccc5833b0bd89931e90c5e843134839ba46ce ]

In HWS template API, the aging mechanism doesn't support shared host
mode now. When the guest's counter is set to 0, the aging won't be
initialized.

The current implementation didn't prevent the user from querying the
aged flows on the uninitialized port. The access of invalid pointers
would cause a crash.

With this commit, the flag of the per port aging initialization will
be checked. This would help to get rid of the invalid accessing.

Fixes: 04a4de756e14 ("net/mlx5: support flow age action with HWS")

Signed-off-by: Bing Zhao <bingz at nvidia.com>
Acked-by: Suanming Mou <suanmingm at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 6b889e9f81..2b90748d04 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8526,6 +8526,10 @@ flow_hw_get_q_aged_flows(struct rte_eth_dev *dev, uint32_t queue_id,
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
 					  NULL, "empty context");
+	if (!priv->hws_age_req)
+		return rte_flow_error_set(error, ENOENT,
+					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					  NULL, "No aging initialized");
 	if (priv->hws_strict_queue) {
 		if (queue_id >= age_info->hw_q_age->nb_rings)
 			return rte_flow_error_set(error, EINVAL,
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-14 00:09:22.613646054 +0000
+++ 0042-net-mlx5-prevent-querying-aged-flows-on-uninit-port.patch	2024-03-14 00:09:20.641615777 +0000
@@ -1 +1 @@
-From 3b1ccc5833b0bd89931e90c5e843134839ba46ce Mon Sep 17 00:00:00 2001
+From afe47440d13a52b9493c3e8776fa0d369436806b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3b1ccc5833b0bd89931e90c5e843134839ba46ce ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -27 +28 @@
-index bd5c46b6ad..91d1c59fbd 100644
+index 6b889e9f81..2b90748d04 100644
@@ -30 +31 @@
-@@ -11219,6 +11219,10 @@ flow_hw_get_q_aged_flows(struct rte_eth_dev *dev, uint32_t queue_id,
+@@ -8526,6 +8526,10 @@ flow_hw_get_q_aged_flows(struct rte_eth_dev *dev, uint32_t queue_id,


More information about the stable mailing list