Re: [PATCH v2 12/14] habanalabs/gaudi: Add ethtool support using coresight

From: Jakub Kicinski
Date: Mon Sep 14 2020 - 16:07:20 EST


On Mon, 14 Sep 2020 03:24:13 +0200 Andrew Lunn wrote:
> > +static void gaudi_nic_get_internal_stats(struct net_device *netdev, u64 *data)
> > +{
> > + struct gaudi_nic_device **ptr = netdev_priv(netdev);
> > + struct gaudi_nic_device *gaudi_nic = *ptr;
> > + struct hl_device *hdev = gaudi_nic->hdev;
> > + u32 port = gaudi_nic->port;
> > + u32 num_spmus;
> > + int i;
> > +
> > + num_spmus = (port & 1) ? NIC_SPMU1_STATS_LEN : NIC_SPMU0_STATS_LEN;
> > +
> > + gaudi_sample_spmu_nic(hdev, port, num_spmus, data);
> > + data += num_spmus;
> > +
> > + /* first entry is title */
> > + data[0] = 0;
>
> You have been looking at statistics names recently. What do you think
> of this data[0]?

Highly counter-productive, users will commonly grep for statistics.
Header which says "TX stats:" is a bad idea.