mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/6] Mirroring to DSA CPU port
@ 2024-10-17 16:52 Vladimir Oltean
  2024-10-17 16:52 ` [PATCH v2 net-next 1/6] net: sched: propagate "skip_sw" flag to offload for flower and matchall Vladimir Oltean
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Vladimir Oltean @ 2024-10-17 16:52 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Petr Machata, Ido Schimmel,
	Claudiu Manoil, Alexandre Belloni, UNGLinuxDriver,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko, Vlad Buslov,
	Simon Horman, Christian Marangi, Arun Ramadoss,
	Arınç ÜNAL, linux-kernel

Users of the NXP LS1028A SoC (drivers/net/dsa/ocelot L2 switch inside)
have requested to mirror packets from the ingress of a switch port to
software. Both port-based and flow-based mirroring is required.

The simplest way I could come up with was to set up tc mirred actions
towards a dummy net_device, and make the offloading of that be accepted
by the driver. Currently, the pattern in drivers is to reject mirred
towards ports they don't know about, but I'm now permitting that,
precisely by mirroring "to the CPU".

For testers, this series depends on the following bug fix:
https://lore.kernel.org/netdev/20241017161049.3570037-1-vladimir.oltean@nxp.com/
otherwise it is possible to create invalid combinations which are not
rejected.

Changes from RFC:
- Sent the bug fix separately, now merged as commit 8c924369cb56 ("net:
  dsa: refuse cross-chip mirroring operations") in the "net" tree
- Allow mirroring to the ingress of another switch port (using software)
  both for matchall in DSA and flower offload in ocelot
- Patch 3/6 is new

Link to previous RFC:
https://lore.kernel.org/netdev/20240913152915.2981126-1-vladimir.oltean@nxp.com/

For historical purposes, link to a much older (and much different) attempt:
https://lore.kernel.org/netdev/20191002233750.13566-1-olteanv@gmail.com/

Vladimir Oltean (6):
  net: sched: propagate "skip_sw" flag to offload for flower and
    matchall
  net: dsa: clean up dsa_user_add_cls_matchall()
  net: dsa: use "extack" as argument to
    flow_action_basic_hw_stats_check()
  net: dsa: add more extack messages in
    dsa_user_add_cls_matchall_mirred()
  net: dsa: allow matchall mirroring rules towards the CPU
  net: mscc: ocelot: allow tc-flower mirred action towards foreign
    interfaces

 drivers/net/ethernet/mscc/ocelot_flower.c | 54 ++++++++++++----
 include/net/flow_offload.h                |  1 +
 include/net/pkt_cls.h                     |  1 +
 net/dsa/user.c                            | 78 +++++++++++++++++------
 net/sched/cls_flower.c                    |  1 +
 net/sched/cls_matchall.c                  |  1 +
 6 files changed, 105 insertions(+), 31 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-10-22 17:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-17 16:52 [PATCH v2 net-next 0/6] Mirroring to DSA CPU port Vladimir Oltean
2024-10-17 16:52 ` [PATCH v2 net-next 1/6] net: sched: propagate "skip_sw" flag to offload for flower and matchall Vladimir Oltean
2024-10-20 15:59   ` Ido Schimmel
2024-10-22 17:36     ` Vladimir Oltean
2024-10-17 16:52 ` [PATCH v2 net-next 2/6] net: dsa: clean up dsa_user_add_cls_matchall() Vladimir Oltean
2024-10-17 16:52 ` [PATCH v2 net-next 3/6] net: dsa: use "extack" as argument to flow_action_basic_hw_stats_check() Vladimir Oltean
2024-10-17 16:52 ` [PATCH v2 net-next 4/6] net: dsa: add more extack messages in dsa_user_add_cls_matchall_mirred() Vladimir Oltean
2024-10-17 16:52 ` [PATCH v2 net-next 5/6] net: dsa: allow matchall mirroring rules towards the CPU Vladimir Oltean
2024-10-17 16:52 ` [PATCH v2 net-next 6/6] net: mscc: ocelot: allow tc-flower mirred action towards foreign interfaces Vladimir Oltean
2024-10-22 17:37 ` [PATCH v2 net-next 0/6] Mirroring to DSA CPU port Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®