mlxsw: couple of fixes
Subsystems (3)
cover mlxsw: couple of fixes
From: Jiri Pirko <[email protected]>
Cuple of fixes from Arkadi
Arkadi Sharshevsky (2):
mlxsw: spectrum_dpipe: Fix incorrect entry index
mlxsw: spectrum_router: Fix rif counter freeing routine
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 3 ++- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.3
PATCH 1/2 mlxsw: spectrum_dpipe: Fix incorrect entry index
From: Arkadi Sharshevsky <[email protected]>
In case of disabled counters the entry index will be incorrect. Fix this by moving the entry index set before the counter status check.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c +2 -1
@@ -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);
Signature · 1 line
2.9.3
PATCH 2/2 mlxsw: spectrum_router: Fix rif counter freeing routine
In reply to Jiri PirkoFrom: Arkadi Sharshevsky <[email protected]>
During rif counter freeing the counter index can be invalid. Add check of validity before freeing the counter.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +3 -0
@@ -206,6 +206,9 @@ void mlxsw_sp_rif_counter_free(struct mlxsw_sp *mlxsw_sp, {unsigned int *p_counter_index; +if (!mlxsw_sp_rif_counter_valid_get (rif, dir)) +return ; + p_counter_index =mlxsw_sp_rif_p_counter_get (rif, dir);if (WARN_ON (!p_counter_index))return ;
Signature · 1 line
2.9.3
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Thu, 18 May 2017 09:18:51 +0200
Quoted 1 line
Couple of fixes from Arkadi
Series applied.