[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240614082351.7fc8d66c@kernel.org>
Date: Fri, 14 Jun 2024 08:23:51 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: FUJITA Tomonori <fujita.tomonori@...il.com>
Cc: netdev@...r.kernel.org, andrew@...n.ch, horms@...nel.org,
jiri@...nulli.us, pabeni@...hat.com, linux@...linux.org.uk,
hfdevel@....net, naveenm@...vell.com, jdamato@...tly.com
Subject: Re: [PATCH net-next v10 4/7] net: tn40xx: add basic Tx handling
On Fri, 14 Jun 2024 11:41:52 +0900 (JST) FUJITA Tomonori wrote:
> >> +static void tn40_get_stats(struct net_device *ndev,
> >> + struct rtnl_link_stats64 *stats)
> >> +{
> >> + struct tn40_priv *priv = netdev_priv(ndev);
> >> +
> >> + netdev_stats_to_stats64(stats, &priv->net_stats);
> >
> > You should hold the stats in driver priv, probably:
> >
> > from struct net_device:
> >
> > struct net_device_stats stats; /* not used by modern drivers */
> >
>
> Currently, net_device_stats struct is in tn40_priv struct. You meant
> the driver shouldn't use net_device_stats struct?
Oh, I misread, I just saw netdev_stats_to_stats64( and didn't read
further. Doesn't look like you're using any of the magic properties
of struct net_device_stats, so yes, just replace it with struct
rtnl_link_stats64 in the priv, and with minor adjustments that should be it.
> Note that some TX40xx chips support HW statistics. Seems that my NIC
> supports the feature so I plan to send a patch for that after the
> initial driver is merged.
Sounds like a good plan :)
Powered by blists - more mailing lists