Hi David,
These patches are all meant to help pave the way for a 802.1Q data path
added to the mockup driver, making it more useful than just testing for
configuration. Sending those out now since there is no real need to
wait.
Thanks
Florian Fainelli (5):
net: dsa: loop: PVID should be per-port
net: dsa: loop: Support 4K VLANs
net: dsa: loop: Move data structures to header
net: dsa: loop: Wire-up MTU callbacks
net: dsa: loop: Set correct number of ports
drivers/net/dsa/dsa_loop.c | 61 ++++++++++++++------------------------
include/linux/dsa/loop.h | 41 +++++++++++++++++++++++++
2 files changed, 64 insertions(+), 38 deletions(-)
create mode 100644 include/linux/dsa/loop.h
--
2.25.1
Allocate a 4K array of VLANs instead of limiting ourselves to just 5
which is arbitrary.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
@@ -191,7 +189,7 @@ dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,/* Just do a sleeping operation to make lockdep checks effective */mdiobus_read(bus,ps->port_base+port,MII_BMSR);-if(vlan->vid_end>DSA_LOOP_VLANS)+if(vlan->vid_end>ARRAY_SIZE(ps->vlans))return-ERANGE;return0;
For now we simply store the port MTU into a per-port member.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 17 +++++++++++++++++
include/linux/dsa/loop.h | 1 +
2 files changed, 18 insertions(+)
We only support DSA_LOOP_NUM_PORTS in the switch, do not tell the DSA
core to allocate up to DSA_MAX_PORTS which is nearly the double (6 vs.
11).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
In preparation for adding support for a mockup data path, move the
driver data structures to include/linux/dsa/loop.h such that we can
share them between net/dsa/ and drivers/net/dsa/ later on.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 32 +-----------------------------
include/linux/dsa/loop.h | 40 ++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 31 deletions(-)
create mode 100644 include/linux/dsa/loop.h
The PVID should be per-port, this is a preliminary change to support a
802.1Q data path in the driver.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -234,7 +234,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,structdsa_loop_priv*ps=ds->priv;structmii_bus*bus=ps->bus;structdsa_loop_vlan*vl;-u16vid,pvid=ps->pvid;+u16vid,pvid=ps->ports[port].pvid;/* Just do a sleeping operation to make lockdep checks effective */mdiobus_read(bus,ps->port_base+port,MII_BMSR);
@@ -252,7 +252,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,dev_dbg(ds->dev,"%s: port: %d vlan: %d, %stagged, pvid: %d\n",__func__,port,vid,untagged?"un":"",pvid);}-ps->pvid=pvid;+ps->ports[port].pvid=pvid;return0;}
From: Andrew Lunn <andrew@lunn.ch> Date: 2020-08-03 20:27:42
On Mon, Aug 03, 2020 at 01:03:51PM -0700, Florian Fainelli wrote:
quoted hunk
Allocate a 4K array of VLANs instead of limiting ourselves to just 5
which is arbitrary.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
That is 4K x (2 x u16) = 16K RAM. I suppose for a test driver which is
never expected to be used in production, that is O.K.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
On Mon, Aug 03, 2020 at 01:03:51PM -0700, Florian Fainelli wrote:
quoted
Allocate a 4K array of VLANs instead of limiting ourselves to just 5
which is arbitrary.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
From: Andrew Lunn <andrew@lunn.ch> Date: 2020-08-03 20:29:24
On Mon, Aug 03, 2020 at 01:03:54PM -0700, Florian Fainelli wrote:
We only support DSA_LOOP_NUM_PORTS in the switch, do not tell the DSA
core to allocate up to DSA_MAX_PORTS which is nearly the double (6 vs.
11).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
From: Andrew Lunn <andrew@lunn.ch> Date: 2020-08-03 20:33:59
On Mon, Aug 03, 2020 at 01:03:49PM -0700, Florian Fainelli wrote:
Hi David,
These patches are all meant to help pave the way for a 802.1Q data path
added to the mockup driver, making it more useful than just testing for
configuration.
Could you give some more details. I assume the tag driver is going be
to more active. At least, that would make sense with the data
structure moves.
Andrew
From: Andrew Lunn <andrew@lunn.ch> Date: 2020-08-03 20:34:35
On Mon, Aug 03, 2020 at 01:03:50PM -0700, Florian Fainelli wrote:
The PVID should be per-port, this is a preliminary change to support a
802.1Q data path in the driver.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
On Mon, Aug 03, 2020 at 01:03:49PM -0700, Florian Fainelli wrote:
quoted
Hi David,
These patches are all meant to help pave the way for a 802.1Q data path
added to the mockup driver, making it more useful than just testing for
configuration.
Could you give some more details. I assume the tag driver is going be
to more active. At least, that would make sense with the data
structure moves.
Still working on a 802.1Q data path that allows to carry VLAN tags from
the DSA CPU interface (guest side) to a tap (host side) and from there
you can ping, bridge etc. devices. I am having some problems with the
responses sent back to the guest which are incorrectly tagged on ingress.
You can see the WIP here:
https://github.com/ffainelli/linux/commits/dsa-loop-8021q
--
Florian
These patches are all meant to help pave the way for a 802.1Q data path
added to the mockup driver, making it more useful than just testing for
configuration. Sending those out now since there is no real need to
wait.
Series applied, I added "a 802.1Q data path" to the subject line I integrated
into the merge commit for the series as it seems your Subject line here was
chopped off.
These patches are all meant to help pave the way for a 802.1Q data path
added to the mockup driver, making it more useful than just testing for
configuration. Sending those out now since there is no real need to
wait.
Series applied, I added "a 802.1Q data path" to the subject line I integrated
into the merge commit for the series as it seems your Subject line here was
chopped off.
Yes it was, the merge commit looks good to me, thank you.
--
Florian