[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231003065535.34a3a4e0@kernel.org>
Date: Tue, 3 Oct 2023 06:55:35 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Vladimir Oltean <vladimir.oltean@....com>,
Oleksij Rempel <linux@...pel-privat.de>,
Nicolò Veronese <nicveronese@...il.com>,
thomas.petazzoni@...tlin.com,
Christophe Leroy <christophe.leroy@...roup.eu>
Subject: Re: [RFC PATCH net-next 6/7] net: ethtool: add a netlink command to
get PHY information
On Thu, 14 Sep 2023 11:36:13 +0200 Maxime Chevallier wrote:
> I'm currently implementing this, and I was wondering if it could be
> worth it to include a pointer to struct phy_device directly in
> ethnl_req_info.
>
> This would share the logic for all netlink commands that target a
> phy_device :
>
> - plca
> - pse-pd
> - cabletest
> - other future commands
>
> Do you see this as acceptable ? we would grab the phy_device that
> matches the passed phy_index in the request, and if none is specified,
> we default to dev->phydev.
You may need to be careful with that. It could work in practice but
the req_info is parsed without holding any locks, IIRC. And there
may also be some interplay between PHY state and ethnl_ops_begin().
From netlink perspective putting the PHY info in the header nest makes
perfect sense to me. Just not sure if you can actually get the object
when the parsing happens or you'd need to just store the index and
resolve it later? PHYLIB maintainers may be best at advising on the
lifetime expectations for phys..
Sorry for the delayed response, #vacation.
Powered by blists - more mailing lists