linux/drivers/net/dsa/sja1105
Vladimir Oltean 4ac0567e40 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: Jakub Kicinski <kuba@kernel.org>
2021-10-12 17:33:36 -07:00
..
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile net: dsa: sja1105: register the MDIO buses for 100base-T1 and 100base-TX 2021-06-08 14:37:16 -07:00
sja1105_clocking.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_devlink.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_dynamic_config.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-08-05 15:08:47 -07:00
sja1105_dynamic_config.h net: dsa: sja1105: add support for the SJA1110 switch family 2021-06-08 14:37:16 -07:00
sja1105_ethtool.c net: dsa: sja1105: don't use burst SPI reads for port statistics 2021-05-21 14:01:41 -07:00
sja1105_flower.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_main.c net: dsa: sja1105: break dependency between dsa_port_is_sja1105 and switch driver 2021-10-12 17:33:36 -07:00
sja1105_mdio.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_ptp.c net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver 2021-10-12 17:33:36 -07:00
sja1105_ptp.h net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver 2021-10-12 17:33:36 -07:00
sja1105_spi.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_static_config.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_static_config.h net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_tas.c net: dsa: sja1105: parameterize the number of ports 2021-05-24 13:59:03 -07:00
sja1105_tas.h net: dsa: sja1105: dimension the data structures for a larger port count 2021-05-24 13:59:03 -07:00
sja1105_vl.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105_vl.h net: update NXP copyright text 2021-09-17 13:52:17 +01:00
sja1105.h net: dsa: tag_sja1105: stop asking the sja1105 driver in sja1105_xmit_tpid 2021-08-25 11:14:34 +01:00