[PATCH mlx5-next 2/5] net/mlx5: fs, treat ALLOW as a conflicting action upon merge
From: Edward Srouji
Date: Tue Nov 03 2026 - 13:15:26 EST
From: Michael Gur <michaelgur@xxxxxxxxxx>
Two rules with identical match criteria are allowed to merge into one
firmware entry, combining their actions - this is how a single match
fans out to multiple actions. That merge logic rejects combining
conflicting actions, e.g a DROP rule with a forwarding rule, since one
entry can't carry both, but never learned to do the same for ALLOW.
Two same-match rules, one requesting ALLOW and the other forwarding,
merge into a single entry that ends up requesting both, violating
firmware's rule that exactly one of forward/drop/allow may be set per
entry.
Reject merging same-match rules that disagree on ALLOW, the same way
already done for other actions.
Fixes: a7ee18bdee83 ("RDMA/mlx5: Allow creating a matcher for a NIC TX flow table")
Signed-off-by: Michael Gur <michaelgur@xxxxxxxxxx>
Reviewed-by: Mark Bloch <mbloch@xxxxxxxxxx>
Reviewed-by: Patrisious Haddad <phaddad@xxxxxxxxxx>
Signed-off-by: Edward Srouji <edwards@xxxxxxxxxx>
---
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index c8f6adae6f51a03d058e48aba376fa4cfbe263b9..70545053f9c42d6f6ccf439852d14f9b9e16419f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1929,6 +1929,7 @@ static bool check_conflicting_actions(const struct mlx5_flow_act *act1,
return false;
if (xored_actions & (MLX5_FLOW_CONTEXT_ACTION_DROP |
+ MLX5_FLOW_CONTEXT_ACTION_ALLOW |
MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT |
MLX5_FLOW_CONTEXT_ACTION_DECAP |
MLX5_FLOW_CONTEXT_ACTION_MOD_HDR |
--
2.49.0