[RFC PATCH net-next 0/6] Mirroring to DSA CPU port

Vladimir Oltean posted 6 patches 2 months, 2 weeks ago
There is a newer version of this series
drivers/net/ethernet/mscc/ocelot_flower.c | 58 ++++++++++++++----
include/net/flow_offload.h                |  1 +
include/net/pkt_cls.h                     |  1 +
net/dsa/user.c                            | 72 ++++++++++++++++++-----
net/sched/cls_flower.c                    |  1 +
net/sched/cls_matchall.c                  |  1 +
6 files changed, 107 insertions(+), 27 deletions(-)
[RFC PATCH net-next 0/6] Mirroring to DSA CPU port
Posted by Vladimir Oltean 2 months, 2 weeks ago
Greetings,

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". I am unsure if there are other,
perhaps better ways of doing this.

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: add more extack messages in
    dsa_user_add_cls_matchall_mirred()
  net: dsa: refuse cross-chip mirroring operations
  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 | 58 ++++++++++++++----
 include/net/flow_offload.h                |  1 +
 include/net/pkt_cls.h                     |  1 +
 net/dsa/user.c                            | 72 ++++++++++++++++++-----
 net/sched/cls_flower.c                    |  1 +
 net/sched/cls_matchall.c                  |  1 +
 6 files changed, 107 insertions(+), 27 deletions(-)

-- 
2.34.1
Re: [RFC PATCH net-next 0/6] Mirroring to DSA CPU port
Posted by Vladimir Oltean 1 month, 3 weeks ago
On Fri, Sep 13, 2024 at 06:29:09PM +0300, Vladimir Oltean wrote:
> Greetings,
> 
> 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". I am unsure if there are other,
> perhaps better ways of doing this.

Since there aren't any review comments, I will just resubmit this to
net-next.