diff mbox series

[net-next] ax88796c: fix fetching error stats from percpu containers

Message ID 20211023121148.113466-1-alobakin@pm.me (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ax88796c: fix fetching error stats from percpu containers | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Alexander Lobakin Oct. 23, 2021, 12:19 p.m. UTC
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(-)

--
2.33.1

Comments

Łukasz Stelmach Oct. 25, 2021, 7:54 p.m. UTC | #1
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
>
>
>
>
Jakub Kicinski Oct. 26, 2021, 2:23 a.m. UTC | #2
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!
diff mbox series

Patch

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;