[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59906319-6171-da5b-ca78-4ab423b1cc92@intel.com>
Date: Wed, 23 Aug 2023 11:09:26 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Pawel Chmielewski <pawel.chmielewski@...el.com>, "Greenwalt, Paul"
<paul.greenwalt@...el.com>
CC: Andrew Lunn <andrew@...n.ch>, <intel-wired-lan@...ts.osuosl.org>,
<netdev@...r.kernel.org>, <aelior@...vell.com>, <manishc@...vell.com>
Subject: Re: [PATCH iwl-next v2 2/9] ethtool: Add forced speed to supported
link modes maps
On 8/23/2023 10:56 AM, Pawel Chmielewski wrote:
> On Sun, Aug 20, 2023 at 12:20:43PM -0700, Greenwalt, Paul wrote:
>>
>>
>> On 8/20/2023 11:54 AM, Andrew Lunn wrote:
>>> On Sat, Aug 19, 2023 at 02:39:41AM -0700, Paul Greenwalt wrote:
>>>> The need to map Ethtool forced speeds to Ethtool supported link modes is
>>>> common among drivers. To support this move the supported link modes maps
>>>> implementation from the qede driver. This is an efficient solution
>>>> introduced in commit 1d4e4ecccb11 ("qede: populate supported link modes
>>>> maps on module init") for qede driver.
>>>>
>>>> ethtool_forced_speed_maps_init() should be called during driver init
>>>> with an array of struct ethtool_forced_speed_map to populate the
>>>> mapping. The macro ETHTOOL_FORCED_SPEED_MAP is a helper to initialized
>>>> the struct ethtool_forced_speed_map.
>>>
>>> Is there any way to reuse this table:
>>>
>>> https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/phy-core.c#L161
>>>
>>> Seems silly to have multiple tables if this one can be made to work.
>>> It is also used a lot more than anything you will add, which has just
>>> two users so far, so problems with it a likely to be noticed faster.
>>>
>>> Andrew
>>
>> Yes, we'll can look into that.
>
> I think it would be better to leave the maps in the code of respective drivers, as they are too much hardware related.
> Even for a single speed, the sets of supported link modes may vary between the devices.
>
Isn't that what the per-driver bitwise AND is doing after the fact?
That's how qede worked: it converted the mapping from speed and then
combined it with some device support maps to avoid allowing speeds which
weren't supported..
it would be nice to reuse the same mapping that is common everywhere. I
suspect the PHY code already has some mechanism to support device
specific since not all PHYs support all link modes either....
Powered by blists - more mailing lists