diff mbox series

[v3,net-next,03/15] net: dsa: tag_sja1105: request promiscuous mode for master

Message ID 20200926193215.1405730-4-vladimir.oltean@nxp.com
State New
Headers show
Series [v3,net-next,01/15] net: mscc: ocelot: move NPI port configuration to DSA | expand

Commit Message

Vladimir Oltean Sept. 26, 2020, 7:32 p.m. UTC
Currently PTP is broken when ports are in standalone mode (the tagger
keeps printing this message):

sja1105 spi0.1: Expected meta frame, is 01-80-c2-00-00-0e in the DSA master multicast filter?

Sure, one might say "simply add 01-80-c2-00-00-0e to the master's RX
filter" but things become more complicated because:

- Actually all frames in the 01-80-c2-xx-xx-xx and 01-1b-19-xx-xx-xx
  range are trapped to the CPU automatically
- The switch mangles bytes 3 and 4 of the MAC address via the incl_srcpt
  ("include source port [in the DMAC]") option, which is how source port
  and switch id identification is done for link-local traffic on RX. But
  this means that an address installed to the RX filter would, at the
  end of the day, not correspond to the final address seen by the DSA
  master.

Assume RX filtering lists on DSA masters are typically too small to
include all necessary addresses for PTP to work properly on sja1105, and
just request promiscuous mode unconditionally.

Just an example:
Assuming the following addresses are trapped to the CPU:
01-80-c2-00-00-00 to 01-80-c2-00-00-ff
01-1b-19-00-00-00 to 01-1b-19-00-00-ff

These are 512 addresses.
Now let's say this is a board with 3 switches, and 4 ports per switch.
The 512 addresses become 6144 addresses that must be managed by the DSA
master's RX filtering lists.

This may be refined in the future, but for now, it is simply not worth
it to add the additional addresses to the master's RX filter, so simply
request it to become promiscuous as soon as the driver probes.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
Changes in v3:
Move this setting from the driver code to the tagger code.

 net/dsa/tag_sja1105.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrew Lunn Sept. 26, 2020, 8:22 p.m. UTC | #1
On Sat, Sep 26, 2020 at 10:32:03PM +0300, Vladimir Oltean wrote:
> Currently PTP is broken when ports are in standalone mode (the tagger

> keeps printing this message):

> 

> sja1105 spi0.1: Expected meta frame, is 01-80-c2-00-00-0e in the DSA master multicast filter?

> 

> Sure, one might say "simply add 01-80-c2-00-00-0e to the master's RX

> filter" but things become more complicated because:

> 

> - Actually all frames in the 01-80-c2-xx-xx-xx and 01-1b-19-xx-xx-xx

>   range are trapped to the CPU automatically

> - The switch mangles bytes 3 and 4 of the MAC address via the incl_srcpt

>   ("include source port [in the DMAC]") option, which is how source port

>   and switch id identification is done for link-local traffic on RX. But

>   this means that an address installed to the RX filter would, at the

>   end of the day, not correspond to the final address seen by the DSA

>   master.

> 

> Assume RX filtering lists on DSA masters are typically too small to

> include all necessary addresses for PTP to work properly on sja1105, and

> just request promiscuous mode unconditionally.

> 

> Just an example:

> Assuming the following addresses are trapped to the CPU:

> 01-80-c2-00-00-00 to 01-80-c2-00-00-ff

> 01-1b-19-00-00-00 to 01-1b-19-00-00-ff

> 

> These are 512 addresses.

> Now let's say this is a board with 3 switches, and 4 ports per switch.

> The 512 addresses become 6144 addresses that must be managed by the DSA

> master's RX filtering lists.

> 

> This may be refined in the future, but for now, it is simply not worth

> it to add the additional addresses to the master's RX filter, so simply

> request it to become promiscuous as soon as the driver probes.

> 

> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>


Reviewed-by: Andrew Lunn <andrew@lunn.ch>


    Andrew
diff mbox series

Patch

diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c
index 3710f9daa46d..36ebd5878061 100644
--- a/net/dsa/tag_sja1105.c
+++ b/net/dsa/tag_sja1105.c
@@ -353,6 +353,7 @@  static const struct dsa_device_ops sja1105_netdev_ops = {
 	.rcv = sja1105_rcv,
 	.filter = sja1105_filter,
 	.overhead = VLAN_HLEN,
+	.promisc_on_master = true,
 };
 
 MODULE_LICENSE("GPL v2");