From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>,
Michael Baum <michaelba@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix masked indirect age action validation
Date: Tue, 1 Jul 2025 12:32:53 +0200 [thread overview]
Message-ID: <20250701103253.318225-1-dsosnowski@nvidia.com> (raw)
Masked indirect age flow action is not supported in
actions templates.
Up to this patch, this case was checked only through
debug assertion. As a side effect, in a build without assertions,
this lead to a segfault on the attempt to create
a table using actions template with masked indirect age action.
To prevent the segfault, this patch adds relevant validation
to actions template creation and removes the debug assertion
which now becomes redundant.
Fixes: 04a4de756e14 ("net/mlx5: support flow age action with HWS")
Cc: michaelba@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 4ecc2bacfc..6dc16f80d3 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1351,10 +1351,6 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
return -1;
}
break;
- case MLX5_INDIRECT_ACTION_TYPE_AGE:
- /* Not supported, prevent by validate function. */
- MLX5_ASSERT(0);
- break;
case MLX5_INDIRECT_ACTION_TYPE_CT:
if (flow_hw_ct_compile(dev, MLX5_HW_INV_QUEUE,
idx, &acts->rule_acts[action_dst])) {
@@ -6405,6 +6401,10 @@ flow_hw_validate_action_indirect(struct rte_eth_dev *dev,
*action_flags |= MLX5_FLOW_ACTION_INDIRECT_COUNT;
break;
case RTE_FLOW_ACTION_TYPE_AGE:
+ if (action->conf && mask->conf)
+ return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
+ action,
+ "Fixed indirect age action is not supported");
ret = flow_hw_validate_action_age(dev, action, *action_flags,
*fixed_cnt, error);
if (ret < 0)
--
2.39.5
reply other threads:[~2025-07-01 10:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250701103253.318225-1-dsosnowski@nvidia.com \
--to=dsosnowski@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=michaelba@nvidia.com \
--cc=orika@nvidia.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).