Skip to content

Commit ef06c9e

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: Allow one failure when offloading tc encap rules under multipath
In a similar manner to uplink/VF LAG, under multipath we add encap peer rule on the second port as well. However, unlike the LAG case, we do want to allow failure for adding one of the rules. This happens due to using a routing hint while doing the route lookup when one path (next hop device) is down. Introduce a new flag to indicate that route lookup failed for encap flow. Note that a flow may still not be offloaded to hw due to missing neighbour, in that case, the neigh update event will take care of it. Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Or Gerlitz <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 95dc190 commit ef06c9e

File tree

1 file changed

+12
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+12
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ enum {
7575
MLX5E_TC_FLOW_HAIRPIN_RSS = BIT(MLX5E_TC_FLOW_BASE + 2),
7676
MLX5E_TC_FLOW_SLOW = BIT(MLX5E_TC_FLOW_BASE + 3),
7777
MLX5E_TC_FLOW_DUP = BIT(MLX5E_TC_FLOW_BASE + 4),
78+
MLX5E_TC_FLOW_NOT_READY = BIT(MLX5E_TC_FLOW_BASE + 5),
7879
};
7980

8081
#define MLX5E_TC_MAX_SPLITS 1
@@ -1047,6 +1048,11 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv,
10471048
struct mlx5_esw_flow_attr slow_attr;
10481049
int out_index;
10491050

1051+
if (flow->flags & MLX5E_TC_FLOW_NOT_READY) {
1052+
kvfree(attr->parse_attr);
1053+
return;
1054+
}
1055+
10501056
if (flow->flags & MLX5E_TC_FLOW_OFFLOADED) {
10511057
if (flow->flags & MLX5E_TC_FLOW_SLOW)
10521058
mlx5e_tc_unoffload_from_slow_path(esw, flow, &slow_attr);
@@ -2800,8 +2806,12 @@ __mlx5e_add_fdb_flow(struct mlx5e_priv *priv,
28002806
goto err_free;
28012807

28022808
err = mlx5e_tc_add_fdb_flow(priv, flow, extack);
2803-
if (err)
2804-
goto err_free;
2809+
if (err) {
2810+
if (!(err == -ENETUNREACH && mlx5_lag_is_multipath(in_mdev)))
2811+
goto err_free;
2812+
2813+
flow->flags |= MLX5E_TC_FLOW_NOT_READY;
2814+
}
28052815

28062816
return flow;
28072817

0 commit comments

Comments
 (0)