All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ax88796c: fix fetching error stats from percpu containers
@ 2021-10-23 12:19 Alexander Lobakin
       [not found] ` <CGME20211025195411eucas1p1f3a6830d6d0fdaac54633a0c321a55a0@eucas1p1.samsung.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Lobakin @ 2021-10-23 12:19 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Łukasz Stelmach, Alexander Lobakin, netdev, linux-kernel

rx_dropped, tx_dropped, rx_frame_errors and rx_crc_errors are being
wrongly fetched from the target container rather than source percpu
ones.
No idea if that goes from the vendor driver or was brainoed during
the refactoring, but fix it either way.

Fixes: a97c69ba4f30e ("net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver")
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
 drivers/net/ethernet/asix/ax88796c_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c
index cfc597f72e3d..91fa0499ea6a 100644
--- a/drivers/net/ethernet/asix/ax88796c_main.c
+++ b/drivers/net/ethernet/asix/ax88796c_main.c
@@ -672,10 +672,10 @@ static void ax88796c_get_stats64(struct net_device *ndev,
 		stats->tx_packets += tx_packets;
 		stats->tx_bytes   += tx_bytes;

-		rx_dropped      += stats->rx_dropped;
-		tx_dropped      += stats->tx_dropped;
-		rx_frame_errors += stats->rx_frame_errors;
-		rx_crc_errors   += stats->rx_crc_errors;
+		rx_dropped      += s->rx_dropped;
+		tx_dropped      += s->tx_dropped;
+		rx_frame_errors += s->rx_frame_errors;
+		rx_crc_errors   += s->rx_crc_errors;
 	}

 	stats->rx_dropped = rx_dropped;
--
2.33.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ax88796c: fix fetching error stats from percpu containers
       [not found] ` <CGME20211025195411eucas1p1f3a6830d6d0fdaac54633a0c321a55a0@eucas1p1.samsung.com>
@ 2021-10-25 19:54   ` Lukasz Stelmach
  2021-10-26  2:23     ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Stelmach @ 2021-10-25 19:54 UTC (permalink / raw)
  To: Alexander Lobakin; +Cc: David S. Miller, Jakub Kicinski, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

It was <2021-10-23 sob 12:19>, when Alexander Lobakin wrote:
> rx_dropped, tx_dropped, rx_frame_errors and rx_crc_errors are being
> wrongly fetched from the target container rather than source percpu
> ones.
> No idea if that goes from the vendor driver or was brainoed during
> the refactoring, but fix it either way.

It may be the latter. Thank you for fixing.

>
> Fixes: a97c69ba4f30e ("net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver")
> Signed-off-by: Alexander Lobakin <alobakin@pm.me>
> ---
>  drivers/net/ethernet/asix/ax88796c_main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

Acked-by: Łukasz Stelmach <l.stelmach@samsung.com>

> diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c
> index cfc597f72e3d..91fa0499ea6a 100644
> --- a/drivers/net/ethernet/asix/ax88796c_main.c
> +++ b/drivers/net/ethernet/asix/ax88796c_main.c
> @@ -672,10 +672,10 @@ static void ax88796c_get_stats64(struct net_device *ndev,
>  		stats->tx_packets += tx_packets;
>  		stats->tx_bytes   += tx_bytes;
>
> -		rx_dropped      += stats->rx_dropped;
> -		tx_dropped      += stats->tx_dropped;
> -		rx_frame_errors += stats->rx_frame_errors;
> -		rx_crc_errors   += stats->rx_crc_errors;
> +		rx_dropped      += s->rx_dropped;
> +		tx_dropped      += s->tx_dropped;
> +		rx_frame_errors += s->rx_frame_errors;
> +		rx_crc_errors   += s->rx_crc_errors;
>  	}
>
>  	stats->rx_dropped = rx_dropped;
> --
> 2.33.1
>
>
>
>

-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ax88796c: fix fetching error stats from percpu containers
  2021-10-25 19:54   ` Lukasz Stelmach
@ 2021-10-26  2:23     ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2021-10-26  2:23 UTC (permalink / raw)
  To: Lukasz Stelmach, Alexander Lobakin; +Cc: David S. Miller, netdev, linux-kernel

On Mon, 25 Oct 2021 21:54:01 +0200 Lukasz Stelmach wrote:
> It was <2021-10-23 sob 12:19>, when Alexander Lobakin wrote:
> > rx_dropped, tx_dropped, rx_frame_errors and rx_crc_errors are being
> > wrongly fetched from the target container rather than source percpu
> > ones.
> > No idea if that goes from the vendor driver or was brainoed during
> > the refactoring, but fix it either way.  
> 
> It may be the latter. Thank you for fixing.
> 
> >
> > Fixes: a97c69ba4f30e ("net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver")
> > Signed-off-by: Alexander Lobakin <alobakin@pm.me>
> > ---
> >  drivers/net/ethernet/asix/ax88796c_main.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >  
> 
> Acked-by: Łukasz Stelmach <l.stelmach@samsung.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-26  2:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-23 12:19 [PATCH net-next] ax88796c: fix fetching error stats from percpu containers Alexander Lobakin
     [not found] ` <CGME20211025195411eucas1p1f3a6830d6d0fdaac54633a0c321a55a0@eucas1p1.samsung.com>
2021-10-25 19:54   ` Lukasz Stelmach
2021-10-26  2:23     ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.