mirror of https://gitee.com/openkylin/linux.git
mlxsw: spectrum_dpipe: Fix incorrect entry index
In case of disabled counters the entry index will be incorrect. Fix this
by moving the entry index set before the counter status check.
Fixes: 2ba5999f00
("mlxsw: spectrum: Add Support for erif table entries access")
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1ac91bff9c
commit
6dd4aba36f
|
@ -199,10 +199,11 @@ static int mlxsw_sp_erif_entry_get(struct mlxsw_sp *mlxsw_sp,
|
|||
|
||||
entry->counter_valid = false;
|
||||
entry->counter = 0;
|
||||
entry->index = mlxsw_sp_rif_index(rif);
|
||||
|
||||
if (!counters_enabled)
|
||||
return 0;
|
||||
|
||||
entry->index = mlxsw_sp_rif_index(rif);
|
||||
err = mlxsw_sp_rif_counter_value_get(mlxsw_sp, rif,
|
||||
MLXSW_SP_RIF_COUNTER_EGRESS,
|
||||
&cnt);
|
||||
|
|
Loading…
Reference in New Issue