* [patch net 0/2] mlxsw: couple of fixes
@ 2017-05-18 7:18 Jiri Pirko
2017-05-18 7:18 ` [patch net 1/2] mlxsw: spectrum_dpipe: Fix incorrect entry index Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-05-18 7:18 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, arkadis, mlxsw
From: Jiri Pirko <jiri@mellanox.com>
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(-)
--
2.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread* [patch net 1/2] mlxsw: spectrum_dpipe: Fix incorrect entry index
2017-05-18 7:18 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
@ 2017-05-18 7:18 ` Jiri Pirko
2017-05-18 7:18 ` [patch net 2/2] mlxsw: spectrum_router: Fix rif counter freeing routine Jiri Pirko
2017-05-18 15:05 ` [patch net 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-05-18 7:18 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, arkadis, mlxsw
From: Arkadi Sharshevsky <arkadis@mellanox.com>
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: 2ba5999f009d ("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>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
index ea56f6a..5f0a7bc 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
@@ -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);
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [patch net 2/2] mlxsw: spectrum_router: Fix rif counter freeing routine
2017-05-18 7:18 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2017-05-18 7:18 ` [patch net 1/2] mlxsw: spectrum_dpipe: Fix incorrect entry index Jiri Pirko
@ 2017-05-18 7:18 ` Jiri Pirko
2017-05-18 15:05 ` [patch net 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2017-05-18 7:18 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, arkadis, mlxsw
From: Arkadi Sharshevsky <arkadis@mellanox.com>
During rif counter freeing the counter index can be invalid. Add check
of validity before freeing the counter.
Fixes: e0c0afd8aa4e ("mlxsw: spectrum: Support for counters on router interfaces")
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 33cec1c..9f89c41 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -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;
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [patch net 0/2] mlxsw: couple of fixes
2017-05-18 7:18 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2017-05-18 7:18 ` [patch net 1/2] mlxsw: spectrum_dpipe: Fix incorrect entry index Jiri Pirko
2017-05-18 7:18 ` [patch net 2/2] mlxsw: spectrum_router: Fix rif counter freeing routine Jiri Pirko
@ 2017-05-18 15:05 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-05-18 15:05 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, arkadis, mlxsw
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 18 May 2017 09:18:51 +0200
> Couple of fixes from Arkadi
Series applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-18 15:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18 7:18 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2017-05-18 7:18 ` [patch net 1/2] mlxsw: spectrum_dpipe: Fix incorrect entry index Jiri Pirko
2017-05-18 7:18 ` [patch net 2/2] mlxsw: spectrum_router: Fix rif counter freeing routine Jiri Pirko
2017-05-18 15:05 ` [patch net 0/2] mlxsw: couple of fixes David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox