Commit 84be2fda authored by Eli Cohen's avatar Eli Cohen Committed by Saeed Mahameed

net/mlx5: Fix condition for termination table cleanup

When we destroy rules from slow path we need to avoid destroying
termination tables since termination tables are never created in slow
path. By doing so we avoid destroying the termination table created for the
slow path.

Fixes: d8a2034f ("net/mlx5: Don't use termination tables in slow path")
Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
Reviewed-by: default avatarOz Shlomo <ozsh@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent 8c702a53
...@@ -403,7 +403,6 @@ enum { ...@@ -403,7 +403,6 @@ enum {
MLX5_ESW_ATTR_FLAG_VLAN_HANDLED = BIT(0), MLX5_ESW_ATTR_FLAG_VLAN_HANDLED = BIT(0),
MLX5_ESW_ATTR_FLAG_SLOW_PATH = BIT(1), MLX5_ESW_ATTR_FLAG_SLOW_PATH = BIT(1),
MLX5_ESW_ATTR_FLAG_NO_IN_PORT = BIT(2), MLX5_ESW_ATTR_FLAG_NO_IN_PORT = BIT(2),
MLX5_ESW_ATTR_FLAG_HAIRPIN = BIT(3),
}; };
struct mlx5_esw_flow_attr { struct mlx5_esw_flow_attr {
......
...@@ -300,7 +300,6 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, ...@@ -300,7 +300,6 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
bool split = !!(attr->split_count); bool split = !!(attr->split_count);
struct mlx5_flow_handle *rule; struct mlx5_flow_handle *rule;
struct mlx5_flow_table *fdb; struct mlx5_flow_table *fdb;
bool hairpin = false;
int j, i = 0; int j, i = 0;
if (esw->mode != MLX5_ESWITCH_OFFLOADS) if (esw->mode != MLX5_ESWITCH_OFFLOADS)
...@@ -398,21 +397,16 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, ...@@ -398,21 +397,16 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
goto err_esw_get; goto err_esw_get;
} }
if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec)) { if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec))
rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, attr, rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, attr,
&flow_act, dest, i); &flow_act, dest, i);
hairpin = true; else
} else {
rule = mlx5_add_flow_rules(fdb, spec, &flow_act, dest, i); rule = mlx5_add_flow_rules(fdb, spec, &flow_act, dest, i);
}
if (IS_ERR(rule)) if (IS_ERR(rule))
goto err_add_rule; goto err_add_rule;
else else
atomic64_inc(&esw->offloads.num_flows); atomic64_inc(&esw->offloads.num_flows);
if (hairpin)
attr->flags |= MLX5_ESW_ATTR_FLAG_HAIRPIN;
return rule; return rule;
err_add_rule: err_add_rule:
...@@ -501,7 +495,7 @@ __mlx5_eswitch_del_rule(struct mlx5_eswitch *esw, ...@@ -501,7 +495,7 @@ __mlx5_eswitch_del_rule(struct mlx5_eswitch *esw,
mlx5_del_flow_rules(rule); mlx5_del_flow_rules(rule);
if (attr->flags & MLX5_ESW_ATTR_FLAG_HAIRPIN) { if (!(attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH)) {
/* unref the term table */ /* unref the term table */
for (i = 0; i < MLX5_MAX_FLOW_FWD_VPORTS; i++) { for (i = 0; i < MLX5_MAX_FLOW_FWD_VPORTS; i++) {
if (attr->dests[i].termtbl) if (attr->dests[i].termtbl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment