diff options
author | Eugenia Emantayev <eugenia@mellanox.com> | 2018-01-31 02:36:29 -0500 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-02-20 15:53:00 -0500 |
commit | 26a0f6e82997d5c8345782b55d3a7894421f777f (patch) | |
tree | 1c279efdea268759dc4d4bd40dea678c9ed12829 | |
parent | 96de67a77293b4da48a05f6ec0385f60006a7ba6 (diff) |
net/mlx5: E-Switch, Fix drop counters use before creation
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: b8a0dbe3a90b ("net/mlx5e: E-switch, Add steering drop counters")
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index 5ecf2cddc16d..c2b1d7d351fc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | |||
@@ -1529,6 +1529,10 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num, | |||
1529 | 1529 | ||
1530 | esw_debug(esw->dev, "Enabling VPORT(%d)\n", vport_num); | 1530 | esw_debug(esw->dev, "Enabling VPORT(%d)\n", vport_num); |
1531 | 1531 | ||
1532 | /* Create steering drop counters for ingress and egress ACLs */ | ||
1533 | if (vport_num && esw->mode == SRIOV_LEGACY) | ||
1534 | esw_vport_create_drop_counters(vport); | ||
1535 | |||
1532 | /* Restore old vport configuration */ | 1536 | /* Restore old vport configuration */ |
1533 | esw_apply_vport_conf(esw, vport); | 1537 | esw_apply_vport_conf(esw, vport); |
1534 | 1538 | ||
@@ -1545,10 +1549,6 @@ static void esw_enable_vport(struct mlx5_eswitch *esw, int vport_num, | |||
1545 | if (!vport_num) | 1549 | if (!vport_num) |
1546 | vport->info.trusted = true; | 1550 | vport->info.trusted = true; |
1547 | 1551 | ||
1548 | /* create steering drop counters for ingress and egress ACLs */ | ||
1549 | if (vport_num && esw->mode == SRIOV_LEGACY) | ||
1550 | esw_vport_create_drop_counters(vport); | ||
1551 | |||
1552 | esw_vport_change_handle_locked(vport); | 1552 | esw_vport_change_handle_locked(vport); |
1553 | 1553 | ||
1554 | esw->enabled_vports++; | 1554 | esw->enabled_vports++; |