[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <14256ba3-b0d5-44e3-9486-1f35233b594c@solid-run.com>
Date: Mon, 18 Nov 2024 14:57:45 +0000
From: Josua Mayer <josua@...id-run.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: Florian Fainelli <f.fainelli@...il.com>, Andrew Lunn <andrew@...n.ch>,
Vladimir Oltean <olteanv@...il.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, Mor Nagli
<mor.nagli@...id-run.com>
Subject: Re: [PATCH net-next v3] net: dsa: mv88e6xxx: control mdio bus-id
truncation for long paths
Am 13.05.24 um 17:32 schrieb Jakub Kicinski:
> On Tue, 7 May 2024 12:03:31 +0000 Josua Mayer wrote:
>>> The idea and implementation is reasonable but this could affect other drivers than mv88e6xxx, why not move that logic to mdiobus_register() and tracking the truncation index globally within the MDIO bus layer?
>> Conceptually I agree, it would be nice to have a centralized
>> solution to this problem, it probably can occur in multiple places.
>>
>> My reasoning is that solving the problem within a single driver
>> is a much smaller task, especially for sporadic contributors
>> who lack a deep understanding for how all layers interact.
>>
>> Perhaps agreeing on a good solution within this driver
>> can inform a more general solution to be added later.
> I agree with Florian, FWIW. The choice of how to truncate is a bit
> arbitrary, if core does it at least it will be consistent.
Very true.
However the names themselves are so far generated by each driver,
if mdiobus_register should define truncation behaviour,
then the name format must be passed as an argument, too.
How about adding new properties to mii_bus?
But then how to pass the variable arguments ....
Is it acceptable to have variadic function?:
int __mdiobus_register(struct mii_bus *bus, struct module *owner, const char *name_format, ...);
Alternatively the core could have a helper function:
mdiobus_allocate_name()
But if it is stateful that will lead to issues when probe fails afterwards.
Any ideas or opinions?
Powered by blists - more mailing lists