From: <Rakesh.Sankaranarayanan@microchip.com>
To: <olteanv@gmail.com>
Cc: <andrew@lunn.ch>, <davem@davemloft.net>, <pabeni@redhat.com>,
<Woojung.Huh@microchip.com>, <linux-kernel@vger.kernel.org>,
<f.fainelli@gmail.com>, <netdev@vger.kernel.org>,
<edumazet@google.com>, <UNGLinuxDriver@microchip.com>,
<kuba@kernel.org>
Subject: Re: [PATCH v2 net-next 2/5] net: dsa: microchip: add eth ctrl grouping for ethtool statistics
Date: Tue, 21 Feb 2023 07:14:01 +0000 [thread overview]
Message-ID: <e22ad18ecc0e6289b783971fe38f1f7a4df9f012.camel@microchip.com> (raw)
In-Reply-To: <20230217170822.w65c72hsbbnoqcab@skbuf>
Hi Vlad,
On Fri, 2023-02-17 at 19:08 +0200, Vladimir Oltean wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> 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).
Yes, these are reported as standards stats through get_pause_stats call
back.
static void ksz_get_pause_stats(struct dsa_switch *ds, int port,
struct ethtool_pause_stats
*pause_stats)
{
struct ksz_device *dev = ds->priv;
struct ksz_port_mib *mib;
mib = &dev->ports[port].mib;
spin_lock(&mib->stats64_lock);
memcpy(pause_stats, &mib->pause_stats, sizeof(*pause_stats));
spin_unlock(&mib->stats64_lock);
}
next prev parent reply other threads:[~2023-02-21 7:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-17 11:02 [PATCH v2 net-next 0/5] add ethtool categorized statistics Rakesh Sankaranarayanan
2023-02-17 11:02 ` [PATCH v2 net-next 1/5] net: dsa: microchip: add rmon grouping for ethtool statistics Rakesh Sankaranarayanan
2023-02-17 14:59 ` Alexander Lobakin
2023-02-21 4:37 ` Rakesh.Sankaranarayanan
2023-02-17 16:53 ` Vladimir Oltean
2023-02-17 17:40 ` Andrew Lunn
2023-02-21 4:40 ` Rakesh.Sankaranarayanan
2023-02-17 11:02 ` [PATCH v2 net-next 2/5] net: dsa: microchip: add eth ctrl " Rakesh Sankaranarayanan
2023-02-17 17:08 ` Vladimir Oltean
2023-02-21 7:14 ` Rakesh.Sankaranarayanan [this message]
2023-02-17 11:02 ` [PATCH v2 net-next 3/5] net: dsa: microchip: add eth mac " Rakesh Sankaranarayanan
2023-02-17 15:01 ` Alexander Lobakin
2023-02-17 16:42 ` Vladimir Oltean
2023-02-24 16:07 ` Alexander Lobakin
2023-02-24 21:53 ` Vladimir Oltean
2023-02-27 14:31 ` Alexander Lobakin
2023-02-27 14:52 ` Andrew Lunn
2023-02-28 10:53 ` Alexander Lobakin
2023-02-17 11:02 ` [PATCH v2 net-next 4/5] net: dsa: microchip: add eth phy " Rakesh Sankaranarayanan
2023-02-17 11:02 ` [PATCH v2 net-next 5/5] net: dsa: microchip: remove num_alus_variable Rakesh Sankaranarayanan
2023-02-17 17:16 ` Vladimir Oltean
2023-02-21 7:25 ` Rakesh.Sankaranarayanan
2023-02-17 14:54 ` [PATCH v2 net-next 0/5] add ethtool categorized statistics Alexander Lobakin
2023-02-17 16:48 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e22ad18ecc0e6289b783971fe38f1f7a4df9f012.camel@microchip.com \
--to=rakesh.sankaranarayanan@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).