From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: getelson@nvidia.com, <mkashani@nvidia.com>,
rasland@nvidia.com, stable@dpdk.org,
"Dariusz Sosnowski" <dsosnowski@nvidia.com>,
"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>
Subject: [PATCH] net/mlx5: fix non-template RSS expansion
Date: Tue, 12 Aug 2025 13:07:16 +0300 [thread overview]
Message-ID: <20250812100717.134263-1-getelson@nvidia.com> (raw)
The PMD checked flow pointer for NULL value after a call to
flow_hw_create_flow(). The function API does not define flow pointer
value if the function call has failed.
The patch fixes error verification after flow_hw_create_flow()
returned - a calling function must check flow_hw_create_flow() return
value.
Fixes: f74914c9956e ("net/mlx5: fix non-template IPv6 flow RSS hash")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
| 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
--git a/drivers/net/mlx5/mlx5_nta_rss.c b/drivers/net/mlx5/mlx5_nta_rss.c
index 8f00510445..b7738f910d 100644
--- a/drivers/net/mlx5/mlx5_nta_rss.c
+++ b/drivers/net/mlx5/mlx5_nta_rss.c
@@ -67,7 +67,7 @@ mlx5_nta_ptype_rss_flow_create(struct mlx5_nta_rss_ctx *ctx,
ctx->pattern, ctx->actions,
MLX5_FLOW_ITEM_PTYPE, MLX5_FLOW_ACTION_RSS,
ctx->external, &flow, ctx->error);
- if (flow) {
+ if (ret == 0) {
SLIST_INSERT_HEAD(ctx->head, flow, nt2hws->next);
if (dbg_log) {
DRV_LOG(NOTICE,
@@ -276,6 +276,7 @@ mlx5_hw_rss_ptype_create_miss_flow(struct rte_eth_dev *dev,
uint32_t ptype_group, bool external,
struct rte_flow_error *error)
{
+ int ret;
struct rte_flow_hw *flow = NULL;
const struct rte_flow_attr miss_attr = {
.ingress = 1,
@@ -300,10 +301,10 @@ mlx5_hw_rss_ptype_create_miss_flow(struct rte_eth_dev *dev,
[MLX5_RSS_PTYPE_ACTION_INDEX + 1] = { .type = RTE_FLOW_ACTION_TYPE_END }
};
- flow_hw_create_flow(dev, MLX5_FLOW_TYPE_GEN, &miss_attr,
- miss_pattern, miss_actions, 0, MLX5_FLOW_ACTION_RSS,
- external, &flow, error);
- return flow;
+ ret = flow_hw_create_flow(dev, MLX5_FLOW_TYPE_GEN, &miss_attr,
+ miss_pattern, miss_actions, 0,
+ MLX5_FLOW_ACTION_RSS, external, &flow, error);
+ return ret == 0 ? flow : NULL;
}
static struct rte_flow_hw *
@@ -316,7 +317,7 @@ mlx5_hw_rss_ptype_create_base_flow(struct rte_eth_dev *dev,
enum mlx5_flow_type flow_type,
struct rte_flow_error *error)
{
- int i = 0;
+ int ret, i = 0;
struct rte_flow_hw *flow = NULL;
struct rte_flow_action actions[MLX5_HW_MAX_ACTS];
enum mlx5_indirect_type indirect_type;
@@ -345,9 +346,9 @@ mlx5_hw_rss_ptype_create_base_flow(struct rte_eth_dev *dev,
} while (actions[i++].type != RTE_FLOW_ACTION_TYPE_END);
action_flags &= ~MLX5_FLOW_ACTION_RSS;
action_flags |= MLX5_FLOW_ACTION_JUMP;
- flow_hw_create_flow(dev, flow_type, attr, pattern, actions,
- item_flags, action_flags, external, &flow, error);
- return flow;
+ ret = flow_hw_create_flow(dev, flow_type, attr, pattern, actions,
+ item_flags, action_flags, external, &flow, error);
+ return ret == 0 ? flow : NULL;
}
const struct rte_flow_action_rss *
@@ -425,6 +426,7 @@ flow_nta_create_single(struct rte_eth_dev *dev,
enum mlx5_flow_type flow_type,
struct rte_flow_error *error)
{
+ int ret;
struct rte_flow_hw *flow = NULL;
struct rte_flow_action copy[MLX5_HW_MAX_ACTS];
const struct rte_flow_action *_actions;
@@ -456,10 +458,9 @@ flow_nta_create_single(struct rte_eth_dev *dev,
_actions = actions;
}
end:
- flow_hw_create_flow(dev, flow_type, attr, items,
- _actions, item_flags, action_flags,
- external, &flow, error);
- return flow;
+ ret = flow_hw_create_flow(dev, flow_type, attr, items, _actions,
+ item_flags, action_flags, external, &flow, error);
+ return ret == 0 ? flow : NULL;
}
/*
--
2.48.1
reply other threads:[~2025-08-12 10:09 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=20250812100717.134263-1-getelson@nvidia.com \
--to=getelson@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=mkashani@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@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).