]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: mscc: ocelot: allow tc-flower mirred action towards foreign interfaces
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 23 Oct 2024 13:52:51 +0000 (16:52 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 31 Oct 2024 00:33:55 +0000 (17:33 -0700)
commit49a09073cb23e02f57aa53cf6b9da3c888ab4713
tree999ab1127043ae5436b1aca1bc829b3f56438df2
parent3535d70df9c80b382a202baa430aa8fbb2433bfa
net: mscc: ocelot: allow tc-flower mirred action towards foreign interfaces

Debugging certain flows in the offloaded switch data path can be done by
installing two tc-mirred filters for mirroring: one in the hardware data
path, which copies the frames to the CPU, and one which takes the frame
from there and mirrors it to a virtual interface like a dummy device,
where it can be seen with tcpdump.

The effect of having 2 filters run on the same packet can be obtained by
default using tc, by not specifying either the 'skip_sw' or 'skip_hw'
keywords.

Instead of refusing to offload mirroring/redirecting packets towards
interfaces that aren't switch ports, just treat every other destination
for what it is: something that is handled in software, behind the CPU
port.

Usage:

$ ip link add dummy0 type dummy; ip link set dummy0 up
$ tc qdisc add dev swp0 clsact
$ tc filter add dev swp0 ingress protocol ip flower action mirred ingress mirror dev dummy0

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241023135251.1752488-7-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot_flower.c