RE: [PATCH net-next v20 08/13] rtase: Implement net_device_ops

From: Justin Lai
Date: Wed Jun 12 2024 - 23:18:01 EST


> On Fri, 7 Jun 2024 16:43:16 +0800 Justin Lai wrote:
> > +static void rtase_get_stats64(struct net_device *dev,
> > + struct rtnl_link_stats64 *stats) {
> > + const struct rtase_private *tp = netdev_priv(dev);
> > + const struct rtase_counters *counters;
> > +
> > + counters = tp->tally_vaddr;
> > +
> > + if (!counters)
> > + return;
>
> Same question about how this can be null as in the ethtool patch..

This check seems unnecessary, I will remove it.

>
> > + netdev_stats_to_stats64(stats, &dev->stats);
>
> Please dont use this field, there is a comment on it:
>
> struct net_device_stats stats; /* not used by modern drivers */
>
> You can store the fields you need for counters in struct rtase_private

Ok, I will remove all parts that use struct net_device_stats stats.

>
> > + dev_fetch_sw_netstats(stats, dev->tstats);