Subject: Re: [PATCH 4/4] RFC: net: dsa: realtek-smi: Add Realtek SMI driver

From: Andrew Lunn <[email-masked]>
Date: Fri, 10 Nov 2017 14:51:54 +0100

> OK, so looks like DSA is actually what I need. I just didn't see a clear
> implementation path for e.g. ACL functions.

> Correct me if I'm wrong, to add support for ar8327 ACL or port rate control
> I should expand struct dsa_switch_ops, add appropriate infrastructure in
> netfilter/tc subsystem and actually implement in drivers/net/dsa/qca8k.c ?

It would probably be a good idea to start by telling us about the
capabilities of the port rate control. Ideally, you don't want to
modify the tc subsystem. You just want to use existing tc options
which matches what the port can do, and offload it. The following
patch might help you plumb it in...

commit f50f212749e8a28803af3628acbeb85ee0458ed5
Author: Florian Fainelli <[email-masked]>
Date:   Mon Jan 30 12:41:40 2017 -0800

    net: dsa: Add plumbing for port mirroring
    
    Add necessary plumbing at the slave network device level to have switch
    drivers implement ndo_setup_tc() and most particularly the cls_matchall
    classifier. We add support for two switch operations:
    
    port_add_mirror and port_del_mirror() which configure, on a per-port
    basis the mirror parameters requested from the cls_matchall classifier.
    
    Code is largely borrowed from the Mellanox Spectrum switch driver.

ACL is more effort. You want to look at what Pablo is doing about
offloading his stuff. And see if Mellanox have anything in there
driver. It is often the case that Mallanox implements something first,
and when we figure out how to borrow the code for DSA.

    Andrew