Skip to content

Commit

Permalink
net/mlx5: E-Switch, Fix drop counters use before creation
Browse files Browse the repository at this point in the history
First use of drop counters happens in esw_apply_vport_conf function,
while they are allocated later in the flow. Fix that by moving
esw_vport_create_drop_counters function to be called before the first use.

Fixes: b8a0dbe ("net/mlx5e: E-switch, Add steering drop counters")
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Eugenia Emantayev authored and Saeed Mahameed committed Feb 20, 2018
1 parent 96de67a commit 26a0f6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,10 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num,

esw_debug(esw->dev, "Enabling VPORT(%d)\n", vport_num);

/* Create steering drop counters for ingress and egress ACLs */
if (vport_num && esw->mode == SRIOV_LEGACY)
esw_vport_create_drop_counters(vport);

/* Restore old vport configuration */
esw_apply_vport_conf(esw, vport);

Expand All @@ -1545,10 +1549,6 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num,
if (!vport_num)
vport->info.trusted = true;

/* create steering drop counters for ingress and egress ACLs */
if (vport_num && esw->mode == SRIOV_LEGACY)
esw_vport_create_drop_counters(vport);

esw_vport_change_handle_locked(vport);

esw->enabled_vports++;
Expand Down

0 comments on commit 26a0f6e

Please sign in to comment.