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: Thu, 9 Nov 2017 16:38:57 +0100 Message-ID: <20171109153857.GA13277@lunn.ch> References: <20171105231909.5599-1-linus.walleij@linaro.org> <20171105231909.5599-5-linus.walleij@linaro.org> <20171109132400.GA10640@lunn.ch> <789e794b57140202137de8656b97d336@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]:49712 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128AbdKIPjB (ORCPT ); Thu, 9 Nov 2017 10:39:01 -0500 Content-Disposition: inline In-Reply-To: <789e794b57140202137de8656b97d336@advem.lv> Sender: netdev-owner@vger.kernel.org List-ID: > >>Unless switchdev could be expanded to support other functions beyond > >>VLAN, > >>like port rate control, ACL, HW NAT (no switchdev L3 offload doesn't fit > >>this), etc. > > > >Switchdev allows offloading of TC. So port rate control would be > >implemented via TC. > > That's interesting. Are there any examples implemented? Mellonex have a few for there TOR switches. The SF2 has TC mirred implemented. I could also implement this for Marvell without too much effort. No DSA switch yet implements port rate control via TC. But TC would be the correct interface to use. > >By ACL do you mean filtering MAC addresses? > > Not only. Usually ACL means defining action with rules matching MAC/IP > address, physical or TCP/IP port, VID, Ethertype or even custom bytes. > And actions could be drop, assign rate, change VID/priority, force L3 > offload or mirroring, redirect/copy to CPU port. So this means mapping iptable rules to the switches TCAM. Pablo has said he is working on this, but there has not been any code posted yet. > But the question how exactly it will be done? The whole idea with switchdev is that your switch interfaces look like a bunch of linux interfaces, and you configure them just as normal Linux interface. You setup NAT as you would normally setup NAT. It then gets pushed down to the hardware. You setup TC rules or ip table rules on the interface, and they get pushed down to the hardware. It is just Linux networking as normal. Think of the switch as an accelerator for what Linux networking can already do. Andrew