net/mlx5e: TC, Continue the attr process even if encap entry is invalid
authorJianbo Liu <jianbol@nvidia.com>
Wed, 23 Apr 2025 08:36:09 +0000 (11:36 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Apr 2025 01:19:56 +0000 (18:19 -0700)
Previously the offload of the rule with header rewrite and mirror to
both internal and external destinations is skipped if the encap entry
is not valid. But it shouldn't because driver will try to offload it
again if neighbor is updated and encap entry is valid, to replace the
old FTE added for slow path. But the extra split attr doesn't exist at
that time as the process is skipped, driver then fails to offload it.
To fix this issue, remove the checking and continue the attr process
if encap entry is invalid.

Fixes: b11bde56246e ("net/mlx5e: TC, Offload rewrite and mirror to both internal and external dests")
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250423083611.324567-4-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 9ba99609999f4f47a36fb5186d917bcd51007110..f1d908f611349ff1df1f7785bc7c38294c9d2746 100644 (file)
@@ -1750,9 +1750,6 @@ extra_split_attr_dests_needed(struct mlx5e_tc_flow *flow, struct mlx5_flow_attr
            !list_is_first(&attr->list, &flow->attrs))
                return 0;
 
-       if (flow_flag_test(flow, SLOW))
-               return 0;
-
        esw_attr = attr->esw_attr;
        if (!esw_attr->split_count ||
            esw_attr->split_count == esw_attr->out_count - 1)
@@ -1766,7 +1763,7 @@ extra_split_attr_dests_needed(struct mlx5e_tc_flow *flow, struct mlx5_flow_attr
        for (i = esw_attr->split_count; i < esw_attr->out_count; i++) {
                /* external dest with encap is considered as internal by firmware */
                if (esw_attr->dests[i].vport == MLX5_VPORT_UPLINK &&
-                   !(esw_attr->dests[i].flags & MLX5_ESW_DEST_ENCAP_VALID))
+                   !(esw_attr->dests[i].flags & MLX5_ESW_DEST_ENCAP))
                        ext_dest = true;
                else
                        int_dest = true;