linux-IllusionX/net/dsa
Vladimir Oltean 40be42b3e4 net: dsa: refuse cross-chip mirroring operations
[ Upstream commit 8c924369cb56c3054dca504c2c9c3eb208272865 ]

In case of a tc mirred action from one switch to another, the behavior
is not correct. We simply tell the source switch driver to program a
mirroring entry towards mirror->to_local_port = to_dp->index, but it is
not even guaranteed that the to_dp belongs to the same switch as dp.

For proper cross-chip support, we would need to go through the
cross-chip notifier layer in switch.c, program the entry on cascade
ports, and introduce new, explicit API for cross-chip mirroring, given
that intermediary switches should have introspection into the DSA tags
passed through the cascade port (and not just program a port mirror on
the entire cascade port). None of that exists today.

Reject what is not implemented so that user space is not misled into
thinking it works.

Fixes: f50f212749 ("net: dsa: Add plumbing for port mirroring")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241008094320.3340980-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-17 15:26:51 +02:00
..
conduit.c
conduit.h
devlink.c
devlink.h
dsa.c
dsa.h
Kconfig
Makefile
netlink.c
netlink.h
port.c
port.h
stubs.c
switch.c
switch.h
tag.c
tag.h
tag_8021q.c
tag_8021q.h
tag_ar9331.c
tag_brcm.c
tag_dsa.c
tag_gswip.c
tag_hellcreek.c
tag_ksz.c
tag_lan9303.c
tag_mtk.c
tag_none.c
tag_ocelot.c
tag_ocelot_8021q.c
tag_qca.c
tag_rtl4_a.c
tag_rtl8_4.c
tag_rzn1_a5psw.c
tag_sja1105.c
tag_trailer.c
tag_vsc73xx_8021q.c
tag_xrs700x.c
trace.c
trace.h
user.c
user.h