mbox series

[RFC,net-next,00/12] Allow DSA drivers to set all phylink capabilities

Message ID YZ56WapOaVpUbRuT@shell.armlinux.org.uk (mailing list archive)
Headers show
Series Allow DSA drivers to set all phylink capabilities | expand

Message

Russell King (Oracle) Nov. 24, 2021, 5:46 p.m. UTC
Hi,

During the last cycle, I introduced a phylink_get_interfaces() method
for DSA drivers to be able to fill out the supported_interfaces member
of phylink_config. However, further phylink development allowing the
validation hook to be greatly simplified became possible when a bitmask
of MAC capabilities is used along with the supported_interfaces bitmap.

In order to allow DSA drivers to fill out both fields, we either need
to add another method, or change the existing method. As there are no
users of the phylink_get_interfaces() yet, let's take the latter
approach, and pass the phylink_config structure to the DSA driver, so
that it can set both fields. (patch 3)

We also add the capability for DSA drivers to transition to using the
phylink_generic_validate() functionality by filling out the phylink
mac_capabilities field, and removing their .phylink_validate method.
(patch 2)

This series also contains an initial patch that consolidates the logic
in DSA around the call to phylink_create(), meaning that there becomes
a single site which issues the new call, rather than two. (patch 1)

The overall effect will be that, once this series has been applied, it
becomes possible to start eliminating the phylink validation
implementations scattered throughout the DSA drivers. Patches to do
this will follow once this series is merged.

I am including nine DSA drivers that were relatively simple to convert
in this series. The more complex ones will follow later. Please note
that none of these DSA drivers have been tested beyond a build-test,
so should be checked by the DSA switch driver maintainers.

 include/net/dsa.h  |  4 ++--
 net/dsa/dsa_priv.h |  2 +-
 net/dsa/port.c     | 48 +++++++++++++++++++++++++++++++-----------------
 net/dsa/slave.c    | 19 +++----------------
 4 files changed, 37 insertions(+), 36 deletions(-)

Comments

Russell King (Oracle) Dec. 3, 2021, 4:15 p.m. UTC | #1
On Wed, Nov 24, 2021 at 05:46:01PM +0000, Russell King (Oracle) wrote:
> During the last cycle, I introduced a phylink_get_interfaces() method
> for DSA drivers to be able to fill out the supported_interfaces member
> of phylink_config. However, further phylink development allowing the
> validation hook to be greatly simplified became possible when a bitmask
> of MAC capabilities is used along with the supported_interfaces bitmap.
...

Hi all,

Patches 1 through 3, 6 and 8 have been merged, the rest have not.
Getting patches 4, 5, 7, 10 and 12 tested and reviewed would be great
please. These are ar9331, bcm_sf2, ksz8795, qca8k and xrs700x. Thanks!
Florian Fainelli Dec. 3, 2021, 7:28 p.m. UTC | #2
On 12/3/21 8:15 AM, Russell King (Oracle) wrote:
> On Wed, Nov 24, 2021 at 05:46:01PM +0000, Russell King (Oracle) wrote:
>> During the last cycle, I introduced a phylink_get_interfaces() method
>> for DSA drivers to be able to fill out the supported_interfaces member
>> of phylink_config. However, further phylink development allowing the
>> validation hook to be greatly simplified became possible when a bitmask
>> of MAC capabilities is used along with the supported_interfaces bitmap.
> ...
> 
> Hi all,
> 
> Patches 1 through 3, 6 and 8 have been merged, the rest have not.
> Getting patches 4, 5, 7, 10 and 12 tested and reviewed would be great
> please. These are ar9331, bcm_sf2, ksz8795, qca8k and xrs700x. Thanks!

Do you have a re-based version that does not conflict with what is
currently in net-next?
Florian Fainelli Dec. 3, 2021, 7:44 p.m. UTC | #3
On 12/3/21 11:28 AM, Florian Fainelli wrote:
> On 12/3/21 8:15 AM, Russell King (Oracle) wrote:
>> On Wed, Nov 24, 2021 at 05:46:01PM +0000, Russell King (Oracle) wrote:
>>> During the last cycle, I introduced a phylink_get_interfaces() method
>>> for DSA drivers to be able to fill out the supported_interfaces member
>>> of phylink_config. However, further phylink development allowing the
>>> validation hook to be greatly simplified became possible when a bitmask
>>> of MAC capabilities is used along with the supported_interfaces bitmap.
>> ...
>>
>> Hi all,
>>
>> Patches 1 through 3, 6 and 8 have been merged, the rest have not.
>> Getting patches 4, 5, 7, 10 and 12 tested and reviewed would be great
>> please. These are ar9331, bcm_sf2, ksz8795, qca8k and xrs700x. Thanks!
> 
> Do you have a re-based version that does not conflict with what is
> currently in net-next?

Nevermind, grabbed the patches of interest and will report back on the
testing.