[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z35ApuS2S1heAqXe@pengutronix.de>
Date: Wed, 8 Jan 2025 10:08:54 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Jonathan Corbet <corbet@....net>, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Simon Horman <horms@...nel.org>,
Russell King <linux@...linux.org.uk>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
linux-doc@...r.kernel.org
Subject: Re: [PATCH net-next v5 2/8] net: ethtool: plumb PHY stats to PHY
drivers
On Tue, Jan 07, 2025 at 06:02:16PM -0800, Jakub Kicinski wrote:
> On Mon, 6 Jan 2025 09:32:55 +0100 Oleksij Rempel wrote:
> > +/**
> > + * phy_ethtool_get_link_ext_stats - Retrieve extended link statistics for a PHY
> > + * @phydev: Pointer to the PHY device
> > + * @link_stats: Pointer to the structure to store extended link statistics
> > + *
> > + * Populates the ethtool_link_ext_stats structure with link down event counts
> > + * and additional driver-specific link statistics, if available.
> > + */
> > +static inline void phy_ethtool_get_link_ext_stats(struct phy_device *phydev,
> > + struct ethtool_link_ext_stats *link_stats)
> > +{
> > + link_stats->link_down_events = READ_ONCE(phydev->link_down_events);
> > +
> > + if (!phydev->drv || !phydev->drv->get_link_stats)
> > + return;
> > +
> > + mutex_lock(&phydev->lock);
> > + phydev->drv->get_link_stats(phydev, link_stats);
> > + mutex_unlock(&phydev->lock);
> > +}
>
> Do these have to be static inlines?
>
> Seemds like it will just bloat the header, and make alignment more
> painful.
On one side I need to address the request to handle phydev specific
thing withing the PHYlib framework. On other side, I can't do it without
openen a pandora box of build dependencies. It will be a new main-side-quest
to resolve build dependency of net/ethtool/ and PHYlib. The workaround is to
put this functions to the header.
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists