* [PATCH] net/mlx5: fix flag non-template rule cleanup
@ 2025-06-05 10:07 Junfeng Guo
2025-06-10 13:19 ` Raslan Darawsheh
0 siblings, 1 reply; 2+ messages in thread
From: Junfeng Guo @ 2025-06-05 10:07 UTC (permalink / raw)
To: dev
Cc: stable, dsosnowski, viacheslavo, bingz, orika, suanmingm, matan,
junfengg
Set the flag nt_rule to be FALSE whenever the flow rule is created
through template API. This would ensure that this flow is always
treated as template API flow after mlx5_ipool_malloc without being
zeroing via memset.
Otherwise, some tables or template actions may be still in use for
port init stage when attaching a port for template or non-template
rule, in scenarios where the uninitialized memory nt_rule happens
to contain a TRUE value.
Fixes: 2fda185a8c1c ("net/mlx5: reuse flow fields")
Fixes: 63296851fadb ("net/mlx5: support flow rule update")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfengg@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index e26093522f..af2e7a84a5 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -3935,6 +3935,7 @@ flow_hw_async_flow_create_generic(struct rte_eth_dev *dev,
rte_errno = ENOMEM;
goto error;
}
+ flow->nt_rule = false;
rule_acts = flow_hw_get_dr_action_buffer(priv, table, action_template_index, queue);
/*
* Set the table here in order to know the destination table
@@ -4141,7 +4142,7 @@ flow_hw_async_flow_update(struct rte_eth_dev *dev,
}
aux = mlx5_flow_hw_aux(dev->data->port_id, of);
nf = &aux->upd_flow;
- memset(nf, 0, sizeof(struct rte_flow_hw));
+ nf->nt_rule = false;
rule_acts = flow_hw_get_dr_action_buffer(priv, table, action_template_index, queue);
/*
* Set the table here in order to know the destination table
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/mlx5: fix flag non-template rule cleanup
2025-06-05 10:07 [PATCH] net/mlx5: fix flag non-template rule cleanup Junfeng Guo
@ 2025-06-10 13:19 ` Raslan Darawsheh
0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2025-06-10 13:19 UTC (permalink / raw)
To: Junfeng Guo, dev
Cc: stable, dsosnowski, viacheslavo, bingz, orika, suanmingm, matan
Hi,
On 05/06/2025 1:07 PM, Junfeng Guo wrote:
> Set the flag nt_rule to be FALSE whenever the flow rule is created
> through template API. This would ensure that this flow is always
> treated as template API flow after mlx5_ipool_malloc without being
> zeroing via memset.
>
> Otherwise, some tables or template actions may be still in use for
> port init stage when attaching a port for template or non-template
> rule, in scenarios where the uninitialized memory nt_rule happens
> to contain a TRUE value.
>
> Fixes: 2fda185a8c1c ("net/mlx5: reuse flow fields")
> Fixes: 63296851fadb ("net/mlx5: support flow rule update")
> Cc: stable@dpdk.org
>
> Signed-off-by: Junfeng Guo <junfengg@nvidia.com>
> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-10 13:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-05 10:07 [PATCH] net/mlx5: fix flag non-template rule cleanup Junfeng Guo
2025-06-10 13:19 ` Raslan Darawsheh
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).