[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230217170822.w65c72hsbbnoqcab@skbuf>
Date: Fri, 17 Feb 2023 19:08:22 +0200
From: Vladimir Oltean <olteanv@...il.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, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Subject: Re: [PATCH v2 net-next 2/5] net: dsa: microchip: add eth ctrl
grouping for ethtool statistics
On Fri, Feb 17, 2023 at 04:32:08PM +0530, Rakesh Sankaranarayanan wrote:
> +void ksz8_get_eth_ctrl_stats(struct ksz_device *dev, int port,
> + struct ethtool_eth_ctrl_stats *ctrl_stats)
> +{
> + struct ksz_port_mib *mib;
> + u64 *cnt;
> +
> + mib = &dev->ports[port].mib;
> +
> + mutex_lock(&mib->cnt_mutex);
> +
> + cnt = &mib->counters[KSZ8_TX_PAUSE];
> + dev->dev_ops->r_mib_pkt(dev, port, KSZ8_TX_PAUSE, NULL, cnt);
> + ctrl_stats->MACControlFramesTransmitted = *cnt;
> +
> + cnt = &mib->counters[KSZ8_RX_PAUSE];
> + dev->dev_ops->r_mib_pkt(dev, port, KSZ8_RX_PAUSE, NULL, cnt);
> + ctrl_stats->MACControlFramesReceived = *cnt;
> +
> + mutex_unlock(&mib->cnt_mutex);
> +}
These should be reported as standard pause stats as well (ethtool -I --show-pause swpN).
Powered by blists - more mailing lists