lkml.org 
[lkml]   [2022]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v1 1/1] net: dsa: microchip: add stats64 support for ksz8 series of switches
On Tue, Dec 06, 2022 at 11:41:33AM -0800, Jakub Kicinski wrote:
> On Mon, 5 Dec 2022 06:29:04 +0100 Oleksij Rempel wrote:
> > + stats->rx_packets = raw->rx_bcast + raw->rx_mcast + raw->rx_ucast +
> > + raw->rx_pause;
> > + stats->tx_packets = raw->tx_bcast + raw->tx_mcast + raw->tx_ucast +
> > + raw->tx_pause;
>
> FWIW for normal netdevs / NICs the rtnl_link_stat pkts do not include
> pause frames, normally. Otherwise one can't maintain those stats in SW
> (and per-ring stats, if any, don't add up to the full link stats).
> But if you have a good reason to do this - I won't nack..

Pause frames are accounted by rx/tx_bytes by HW. Since pause frames may
have different size, it is not possible to correct byte counters, so I
need to add them to the packet counters.

Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

\
 
 \ /
  Last update: 2022-12-07 07:17    [W:0.097 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site