diff mbox series

[1/1] mvpp2: ethtool rxtx stats fix

Message ID 20200614071917.k46e3wvumqp6bj3x@SvensMacBookAir.sven.lan
State Accepted
Delegated to: David Miller
Headers show
Series [1/1] mvpp2: ethtool rxtx stats fix | expand

Commit Message

Sven Auhagen June 14, 2020, 7:19 a.m. UTC
The ethtool rx and tx queue statistics are reporting wrong values.
Fix reading out the correct ones.

Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Matteo Croce June 15, 2020, 12:23 a.m. UTC | #1
On Sun, Jun 14, 2020 at 7:19 AM Sven Auhagen <sven.auhagen@voleatech.de> wrote:
>
> The ethtool rx and tx queue statistics are reporting wrong values.
> Fix reading out the correct ones.
>
> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>

Hi Sven,

seems to work as expected now:

# ethtool -S eth2 |grep rxq
    rxq_0_desc_enqueue: 983
    rxq_0_queue_full_drops: 0
    rxq_0_packets_early_drops: 0
    rxq_0_packets_bm_drops: 0
    rxq_1_desc_enqueue: 14
    rxq_1_queue_full_drops: 0
    rxq_1_packets_early_drops: 0
    rxq_1_packets_bm_drops: 0
    rxq_2_desc_enqueue: 12
    rxq_2_queue_full_drops: 0
    rxq_2_packets_early_drops: 0
    rxq_2_packets_bm_drops: 0
    rxq_3_desc_enqueue: 4
    rxq_3_queue_full_drops: 0
    rxq_3_packets_early_drops: 0
    rxq_3_packets_bm_drops: 0

If you manage to find the commit which introduced this tag, please add
a Fixes tag.

Thanks,
Sven Auhagen June 15, 2020, 9:08 a.m. UTC | #2
On Mon, Jun 15, 2020 at 12:23:20AM +0000, Matteo Croce wrote:
> On Sun, Jun 14, 2020 at 7:19 AM Sven Auhagen <sven.auhagen@voleatech.de> wrote:
> >
> > The ethtool rx and tx queue statistics are reporting wrong values.
> > Fix reading out the correct ones.
> >
> > Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
> 
> Hi Sven,
> 
> seems to work as expected now:
> 
> # ethtool -S eth2 |grep rxq
>     rxq_0_desc_enqueue: 983
>     rxq_0_queue_full_drops: 0
>     rxq_0_packets_early_drops: 0
>     rxq_0_packets_bm_drops: 0
>     rxq_1_desc_enqueue: 14
>     rxq_1_queue_full_drops: 0
>     rxq_1_packets_early_drops: 0
>     rxq_1_packets_bm_drops: 0
>     rxq_2_desc_enqueue: 12
>     rxq_2_queue_full_drops: 0
>     rxq_2_packets_early_drops: 0
>     rxq_2_packets_bm_drops: 0
>     rxq_3_desc_enqueue: 4
>     rxq_3_queue_full_drops: 0
>     rxq_3_packets_early_drops: 0
>     rxq_3_packets_bm_drops: 0
> 
> If you manage to find the commit which introduced this tag, please add
> a Fixes tag.

Hi Matteo,

I looked through the commits from the past 2 years but no luck.
This must have been in there for a while.

Best
Sven

> 
> Thanks,
> -- 
> Matteo Croce
> 
> perl -e 'for($t=0;;$t++){print chr($t*($t>>8|$t>>13)&255)}' |aplay
David Miller June 15, 2020, 8:44 p.m. UTC | #3
From: Sven Auhagen <sven.auhagen@voleatech.de>
Date: Sun, 14 Jun 2020 09:19:17 +0200

> The ethtool rx and tx queue statistics are reporting wrong values.
> Fix reading out the correct ones.
> 
> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>

Applied and queued up for -stable, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 2b5dad2ec650..5d4ec95be869 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -1544,7 +1544,7 @@  static void mvpp2_read_stats(struct mvpp2_port *port)
 	for (q = 0; q < port->ntxqs; q++)
 		for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_txq_regs); i++)
 			*pstats++ += mvpp2_read_index(port->priv,
-						      MVPP22_CTRS_TX_CTR(port->id, i),
+						      MVPP22_CTRS_TX_CTR(port->id, q),
 						      mvpp2_ethtool_txq_regs[i].offset);
 
 	/* Rxqs are numbered from 0 from the user standpoint, but not from the
@@ -1553,7 +1553,7 @@  static void mvpp2_read_stats(struct mvpp2_port *port)
 	for (q = 0; q < port->nrxqs; q++)
 		for (i = 0; i < ARRAY_SIZE(mvpp2_ethtool_rxq_regs); i++)
 			*pstats++ += mvpp2_read_index(port->priv,
-						      port->first_rxq + i,
+						      port->first_rxq + q,
 						      mvpp2_ethtool_rxq_regs[i].offset);
 }