All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>,
	Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	David Miller <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2] r8169: use the extended tally counter available from RTL8125
Date: Fri, 11 Oct 2024 10:55:22 +0100	[thread overview]
Message-ID: <20241011095522.GE66815@kernel.org> (raw)
In-Reply-To: <30edd5d2-13aa-409f-9b12-f0c775c81f02@gmail.com>

On Thu, Oct 10, 2024 at 10:08:02PM +0200, Heiner Kallweit wrote:
> On 10.10.2024 12:50, Heiner Kallweit wrote:
> > The new hw stat fields partially duplicate existing fields, but with a
> > larger field size now. Use these new fields to reduce the risk of
> > overflows. In addition add support for relevant new fields which are
> > available from RTL8125 only.
> > 
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

...

> > @@ -1873,13 +1888,33 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
> >  	data[10] = le32_to_cpu(counters->rx_multicast);
> >  	data[11] = le16_to_cpu(counters->tx_aborted);
> >  	data[12] = le16_to_cpu(counters->tx_underrun);
> > +
> > +	if (rtl_is_8125(tp)) {
> > +		data[5] = le32_to_cpu(counters->align_errors32);
> > +		data[10] = le64_to_cpu(counters->rx_multicast64);
> > +		data[11] = le32_to_cpu(counters->tx_aborted32);
> > +		data[12] = le32_to_cpu(counters->tx_underrun32);
> > +
> > +		data[13] = le64_to_cpu(counters->tx_octets);
> > +		data[14] = le64_to_cpu(counters->rx_octets);
> > +		data[15] = le32_to_cpu(counters->tx_pause_on);
> > +		data[16] = le32_to_cpu(counters->tx_pause_off);
> > +		data[17] = le32_to_cpu(counters->rx_pause_on);
> > +		data[18] = le32_to_cpu(counters->rx_pause_off);
> > +	}
> >  }
> >  
> >  static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
> >  {
> >  	switch(stringset) {
> >  	case ETH_SS_STATS:
> > +		struct rtl8169_private *tp = netdev_priv(dev);
> 
> patchwork lists the following warning for a clang build:
> warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
> 
> gcc 14.2.1 however had no problem with this code, and also checkpatch didn't
> complain. Is this code acceptable or should it be changed?

Yes, I see that too.
My feeling is that it would be best to change it as it
seems likely that this will break compilation somewhere.

      reply	other threads:[~2024-10-11  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 10:50 [PATCH net-next v2] r8169: use the extended tally counter available from RTL8125 Heiner Kallweit
2024-10-10 20:08 ` Heiner Kallweit
2024-10-11  9:55   ` Simon Horman [this message]

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=20241011095522.GE66815@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.