From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH 4/4] RFC: net: dsa: realtek-smi: Add Realtek SMI driver Date: Fri, 10 Nov 2017 14:51:54 +0100 Message-ID: <20171110135154.GA11872@lunn.ch> References: <20171105231909.5599-1-linus.walleij@linaro.org> <20171105231909.5599-5-linus.walleij@linaro.org> <20171109132400.GA10640@lunn.ch> <789e794b57140202137de8656b97d336@advem.lv> <20171109153857.GA13277@lunn.ch> <20171109172424.GD13277@lunn.ch> <32ab0f75420322fea7e2671f3164a133@advem.lv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Walleij , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org, Antti =?iso-8859-1?Q?Sepp=E4l=E4?= , Colin Leitner , Gabor Juhos To: Roman Yeryomin Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:52114 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbdKJNv6 (ORCPT ); Fri, 10 Nov 2017 08:51:58 -0500 Content-Disposition: inline In-Reply-To: <32ab0f75420322fea7e2671f3164a133@advem.lv> Sender: netdev-owner@vger.kernel.org List-ID: > 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 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