Skip to content

Commit 15ddd72

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: E-Switch, Fix shared fdb error flow
On error flow resources being freed in esw_master_egress_destroy_resources() but pointers not being set to null if error flow is from creating a bounce rule. Then in esw_acl_egress_ofld_cleanup() we try to access already freed pointers. Fix it by resetting the pointers to null. Also if error is from creating a second or later bounce rule then the flow group and table being used and cannot and should not be freed. Add a check to destroy the flow group and table if there are no bounce rules. mlx5_core.sf mlx5_core.sf.2: mlx5_destroy_flow_group:2306:(pid 2235): Flow group 4 wasn't destroyed, refcount > 1 mlx5_core.sf mlx5_core.sf.2: mlx5_destroy_flow_table:2295:(pid 2235): Flow table 3 wasn't destroyed, refcount > 1 Fixes: 5e0202e ("net/mlx5: E-switch, Handle multiple master egress rules") Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Shay Drory <shayd@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent ae4de89 commit 15ddd72

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,8 +2618,12 @@ static int esw_master_egress_create_resources(struct mlx5_eswitch *esw,
26182618

26192619
static void esw_master_egress_destroy_resources(struct mlx5_vport *vport)
26202620
{
2621+
if (!xa_empty(&vport->egress.offloads.bounce_rules))
2622+
return;
26212623
mlx5_destroy_flow_group(vport->egress.offloads.bounce_grp);
2624+
vport->egress.offloads.bounce_grp = NULL;
26222625
mlx5_destroy_flow_table(vport->egress.acl);
2626+
vport->egress.acl = NULL;
26232627
}
26242628

26252629
static int esw_set_master_egress_rule(struct mlx5_core_dev *master,

0 commit comments

Comments
 (0)