netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: netdev@vger.kernel.org, andrew@lunn.ch, horms@kernel.org,
	jiri@resnulli.us, pabeni@redhat.com, linux@armlinux.org.uk,
	hfdevel@gmx.net, naveenm@marvell.com, jdamato@fastly.com
Subject: Re: [PATCH net-next v10 4/7] net: tn40xx: add basic Tx handling
Date: Fri, 14 Jun 2024 08:23:51 -0700	[thread overview]
Message-ID: <20240614082351.7fc8d66c@kernel.org> (raw)
In-Reply-To: <20240614.114152.1787364292761357690.fujita.tomonori@gmail.com>

On Fri, 14 Jun 2024 11:41:52 +0900 (JST) FUJITA Tomonori wrote:
> >> +static void tn40_get_stats(struct net_device *ndev,
> >> +			   struct rtnl_link_stats64 *stats)
> >> +{
> >> +	struct tn40_priv *priv = netdev_priv(ndev);
> >> +
> >> +	netdev_stats_to_stats64(stats, &priv->net_stats);  
> > 
> > You should hold the stats in driver priv, probably:
> > 
> > from struct net_device:
> > 
> > 	struct net_device_stats	stats; /* not used by modern drivers */
> >  
> 
> Currently, net_device_stats struct is in tn40_priv struct. You meant
> the driver shouldn't use net_device_stats struct?

Oh, I misread, I just saw netdev_stats_to_stats64( and didn't read
further. Doesn't look like you're using any of the magic properties
of struct net_device_stats, so yes, just replace it with struct
rtnl_link_stats64 in the priv, and with minor adjustments that should be it.

> Note that some TX40xx chips support HW statistics. Seems that my NIC
> supports the feature so I plan to send a patch for that after the
> initial driver is merged.

Sounds like a good plan :)

  reply	other threads:[~2024-06-14 15:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11  4:52 [PATCH net-next v10 0/7] add ethernet driver for Tehuti Networks TN40xx chips FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 1/7] PCI: add Edimax Vendor ID to pci_ids.h FUJITA Tomonori
2024-06-11 15:01   ` Bjorn Helgaas
2024-06-12  3:48     ` FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 2/7] net: tn40xx: add pci driver for Tehuti Networks TN40xx chips FUJITA Tomonori
2024-06-14  0:25   ` Jakub Kicinski
2024-06-14  2:50     ` FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 3/7] net: tn40xx: add register defines FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 4/7] net: tn40xx: add basic Tx handling FUJITA Tomonori
2024-06-14  0:30   ` Jakub Kicinski
2024-06-14  2:43     ` FUJITA Tomonori
2024-06-15  7:44     ` Hans-Frieder Vogt
2024-06-15  9:02       ` FUJITA Tomonori
2024-06-15  9:40         ` Hans-Frieder Vogt
2024-06-15 18:33           ` Andrew Lunn
2024-06-16 12:46             ` FUJITA Tomonori
2024-06-16 14:59               ` Andrew Lunn
2024-06-17  5:44                 ` FUJITA Tomonori
2024-06-17 13:58                   ` Andrew Lunn
2024-06-18  6:27                     ` FUJITA Tomonori
2024-06-14  0:48   ` Jakub Kicinski
2024-06-14  2:41     ` FUJITA Tomonori
2024-06-14 15:23       ` Jakub Kicinski [this message]
2024-06-15  6:41         ` FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 5/7] net: tn40xx: add basic Rx handling FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 6/7] net: tn40xx: add mdio bus support FUJITA Tomonori
2024-06-11  4:52 ` [PATCH net-next v10 7/7] net: tn40xx: add phylink support FUJITA Tomonori
2024-06-13 16:14 ` [PATCH net-next v10 0/7] add ethernet driver for Tehuti Networks TN40xx chips Joe Damato
2024-06-17 22:04   ` FUJITA Tomonori

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=20240614082351.7fc8d66c@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=fujita.tomonori@gmail.com \
    --cc=hfdevel@gmx.net \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=jiri@resnulli.us \
    --cc=linux@armlinux.org.uk \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --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).