[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84835bee-a074-eb46-f1e4-03e53cd7f9ec@intel.com>
Date: Fri, 17 Feb 2023 16:01:15 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@...rochip.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<woojung.huh@...rochip.com>, <UNGLinuxDriver@...rochip.com>,
<andrew@...n.ch>, <f.fainelli@...il.com>, <olteanv@...il.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>
Subject: Re: [PATCH v2 net-next 3/5] net: dsa: microchip: add eth mac grouping
for ethtool statistics
From: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@...rochip.com>
Date: Fri, 17 Feb 2023 16:32:09 +0530
> Add support for ethtool standard device statistics grouping.
> Support ethernet mac statistics grouping using eth-mac groups
> parameter in ethtool command.
>
> Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@...rochip.com>
[...]
> +void ksz8_get_eth_mac_stats(struct ksz_device *dev, int port,
> + struct ethtool_eth_mac_stats *mac_stats)
> +{
> + struct ksz_port_mib *mib;
> + u64 *ctr;
> +
> + mib = &dev->ports[port].mib;
> +
> + mutex_lock(&mib->cnt_mutex);
> + ctr = mib->counters;
> +
> + while (mib->cnt_ptr < dev->info->mib_cnt) {
> + dev->dev_ops->r_mib_pkt(dev, port, mib->cnt_ptr,
> + NULL, &mib->counters[mib->cnt_ptr]);
(for example here)
> + ++mib->cnt_ptr;
Reason for the pre-increment? :)
> + }
> +
> + mac_stats->FramesTransmittedOK = ctr[KSZ8_TX_MCAST] +
> + ctr[KSZ8_TX_BCAST] +
> + ctr[KSZ8_TX_UCAST] +
> + ctr[KSZ8_TX_PAUSE] -
> + ctr[KSZ8_TX_DISCARDS];
[...]
Thanks,
Olek
Powered by blists - more mailing lists