Re: drivers/net/dsa/dsa_loop_bdinfo.c build problems

From: Andrew Lunn
Date: Mon May 13 2024 - 12:54:23 EST


> What I am trying to achieve is to use dsa_loop to connect a CPU
> running Linux to an Ethernet switch via a "conduit" Ethernet link
> (e.g. eth0) using the port-based Ethertype DSA (Marvell) frame tagging
> protocol, so that the Linux kernel will present the userspace with
> separate Ethernet links for each of the switch's user ports (e.g.
> lan1, lan2, lan3).
>
> As I understand it this is usually done via a fixed phy-less conduit
> (e.g. xMII) and an MDIO link between the processor and the switch so
> that the processor can configure and control the physical user ports.
>
> I want to do some software development ahead of receiving the
> hardware, so I want to "fake" the MDIO link, or in some other way
> configure the kernel, such that it uses port-based EDSA frame tagging
> over an ordinary (PHY-equipped) Ethernet port and it looks to me like
> dsa_loop should be capable of doing this.

That is an interesting use case. I don't know of anybody doing that
before.

As Florian pointed out, dsa_loop_bdinfo.o should be built into your
kernel. When you insmod dsa_loop.ko, it should match the data in
dsa_loop_bdinfo to the dsa_loop driver an instantiate an instance of
it. Do you see that happening?

You could hack dsa_loop_get_protocol() to return DSA_TAG_PROTO_EDSA,
in order to use the EDSA frame tagger. dsa_loop does not have an
implementation of .change_tag_protocol, so i don't think you can
change it at runtime. However an implementation of it should be
trivial.

Andrew