mbox series

[net-next,v6,00/16] net: dsa: vsc73xx: Make vsc73xx usable

Message ID 20240301221641.159542-1-paweldembicki@gmail.com (mailing list archive)
Headers show
Series net: dsa: vsc73xx: Make vsc73xx usable | expand

Message

Pawel Dembicki March 1, 2024, 10:16 p.m. UTC
This patch series focuses on making vsc73xx usable.

The first patch was added in v2; it switches from a poll loop to
read_poll_timeout.

The second patch is a simple conversion to phylink because adjust_link
won't work anymore.

The third patch is preparation for future use. Using the
"phy_interface_mode_is_rgmii" macro allows for the proper recognition
of all RGMII modes.

Patches 4-5 involve some cleanup: The fourth patch introduces
a definition with the maximum number of ports to avoid using
magic numbers. The next one fills in documentation.

The sixth patch implements port state configuration, which is required
for bridge functionality. STP frames are not forwarded at this moment.
BPDU frames are only forwarded from/to the PI/SI interface.
For more information, see chapter 2.7.1 (CPU Forwarding) in the
datasheet.

Patches 7, 12-15 provide a basic implementation of tag8021q
functionality with QinQ support, without VLAN filtering in
the bridge and simple VLAN awareness in VLAN filtering mode.

Patches 8-11 came from Vladimir Oltean. They prepare for making
tag8021q more common. VSC73XX uses very similar tag recognition,
and some code from tag_sja1105 could be moved to tag8021q for
common use.

Patch 16 is required to avoid problem with learning on standalone ports.

Pawel Dembicki (12):
  net: dsa: vsc73xx: use read_poll_timeout instead delay loop
  net: dsa: vsc73xx: convert to PHYLINK
  net: dsa: vsc73xx: use macros for rgmii recognition
  net: dsa: vsc73xx: Add define for max num of ports
  net: dsa: vsc73xx: add structure descriptions
  net: dsa: vsc73xx: add port_stp_state_set function
  net: dsa: vsc73xx: Add vlan filtering
  net: dsa: vsc73xx: introduce tag 8021q for vsc73xx
  net: dsa: vsc73xx: Implement the tag_8021q VLAN operations
  net: dsa: Define max num of bridges in tag8021q implementation
  net: dsa: vsc73xx: Add bridge support
  net: dsa: vsc73xx: start treating the BR_LEARNING flag

Vladimir Oltean (4):
  net: dsa: tag_sja1105: absorb logic for not overwriting precise info
    into dsa_8021q_rcv()
  net: dsa: tag_sja1105: absorb entire sja1105_vlan_rcv() into
    dsa_8021q_rcv()
  net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too
  net: dsa: tag_sja1105: refactor skb->dev assignment to
    dsa_tag_8021q_find_user()

 drivers/net/dsa/Kconfig                |   2 +-
 drivers/net/dsa/sja1105/sja1105_main.c |   3 +-
 drivers/net/dsa/vitesse-vsc73xx-core.c | 990 +++++++++++++++++++++----
 drivers/net/dsa/vitesse-vsc73xx.h      |  56 +-
 include/linux/dsa/8021q.h              |   5 +
 include/net/dsa.h                      |   2 +
 net/dsa/Kconfig                        |   6 +
 net/dsa/Makefile                       |   1 +
 net/dsa/tag_8021q.c                    |  81 +-
 net/dsa/tag_8021q.h                    |   7 +-
 net/dsa/tag_ocelot_8021q.c             |   2 +-
 net/dsa/tag_sja1105.c                  |  72 +-
 net/dsa/tag_vsc73xx_8021q.c            |  67 ++
 13 files changed, 1072 insertions(+), 222 deletions(-)
 create mode 100644 net/dsa/tag_vsc73xx_8021q.c

Comments

Linus Walleij March 5, 2024, 10:45 p.m. UTC | #1
On Fri, Mar 1, 2024 at 11:17 PM Pawel Dembicki <paweldembicki@gmail.com> wrote:

> This patch series focuses on making vsc73xx usable.

Can't help to think it is a bit funny regarding how many units
of this chips are shipped in e.g. home routers.

They all work pretty much like the in-kernel driver, or a bit
less than that, just hammered down spraying packets in all
directions.

Yours,
Linus Walleij
Florian Fainelli March 5, 2024, 11:27 p.m. UTC | #2
On 3/5/24 14:45, Linus Walleij wrote:
> On Fri, Mar 1, 2024 at 11:17 PM Pawel Dembicki <paweldembicki@gmail.com> wrote:
> 
>> This patch series focuses on making vsc73xx usable.
> 
> Can't help to think it is a bit funny regarding how many units
> of this chips are shipped in e.g. home routers.

How many use this particular DSA driver as opposed to an user-space SDK 
driver though?

> 
> They all work pretty much like the in-kernel driver, or a bit
> less than that, just hammered down spraying packets in all
> directions.

Do you have a list of devices, so I make sure I don't buy those :P?
Linus Walleij March 6, 2024, 9:03 a.m. UTC | #3
On Wed, Mar 6, 2024 at 12:28 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 3/5/24 14:45, Linus Walleij wrote:
> > On Fri, Mar 1, 2024 at 11:17 PM Pawel Dembicki <paweldembicki@gmail.com> wrote:
> >
> >> This patch series focuses on making vsc73xx usable.
> >
> > Can't help to think it is a bit funny regarding how many units
> > of this chips are shipped in e.g. home routers.
>
> How many use this particular DSA driver as opposed to an user-space SDK
> driver though?

They don't have a userspace driver either, they all have a kernelspace
hack on kernel 2.6.15 or so :/

https://github.com/linusw/linux-SL3516/blob/SL93512R_v2.6.6/drivers/net/sl_switch.c

> Do you have a list of devices, so I make sure I don't buy those :P?

- StorLink reference design SL93512R (and the rest of them, and later resold
  from Cortina Systems). I got this from Imre Kaloz who got it from StorLink.

- ITian Square One
  https://dflund.se/~triad/krad/itian-squareone/
  https://openwrt.org/toh/itian/square_one_sq201
  (The place where I started this switch support.)
  using the same hack as above.

HEY! You sent that to me :D

I think a bunch of other random router vendors copied this from the StorLink
reference design as well, I just don't have all the Gemini devices.

Yours,
Linus Walleij