linux-stable/include/linux/dsa
Vladimir Oltean f5aef42415 net: dsa: sja1105: break dependency between dsa_port_is_sja1105 and switch driver
It's nice to be able to test a tagging protocol with dsa_loop, but not
at the cost of losing the ability of building the tagging protocol and
switch driver as modules, because as things stand, there is a circular
dependency between the two. Tagging protocol drivers cannot depend on
switch drivers, that is a hard fact.

The reasoning behind the blamed patch was that accessing dp->priv should
first make sure that the structure behind that pointer is what we really
think it is.

Currently the "sja1105" and "sja1110" tagging protocols only operate
with the sja1105 switch driver, just like any other tagging protocol and
switch combination. The only way to mix and match them is by modifying
the code, and this applies to dsa_loop as well (by default that uses
DSA_TAG_PROTO_NONE). So while in principle there is an issue, in
practice there isn't one.

Until we extend dsa_loop to allow user space configuration, treat the
problem as a non-issue and just say that DSA ports found by tag_sja1105
are always sja1105 ports, which is in fact true. But keep the
dsa_port_is_sja1105 function so that it's easy to patch it during
testing, and rely on dead code elimination.

Fixes: 994d2cbb08 ("net: dsa: tag_sja1105: be dsa_loop-safe")
Link: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-23 12:45:07 +01:00
..
8021q.h net: dsa: sja1105: add bridge TX data plane offload based on tag_8021q 2021-07-26 22:35:22 +01:00
brcm.h net: dsa: move the Broadcom tag information in a separate header file 2021-01-07 15:42:07 -08:00
lan9303.h
loop.h net: dsa: loop: Wire-up MTU callbacks 2020-08-03 18:19:23 -07:00
ocelot.h net: ocelot: Remove ocelot_xfh_get_cpuq 2021-03-16 15:49:52 -07:00
sja1105.h net: dsa: sja1105: break dependency between dsa_port_is_sja1105 and switch driver 2021-09-23 12:45:07 +01:00