From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbdEaAw5 (ORCPT ); Tue, 30 May 2017 20:52:57 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:59066 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbdEaAwz (ORCPT ); Tue, 30 May 2017 20:52:55 -0400 Date: Wed, 31 May 2017 02:52:42 +0200 From: Andrew Lunn To: Florian Fainelli Cc: John Crispin , Vivien Didelot , "David S . Miller" , Sean Wang , jiri@resnulli.us, idosch@mellanox.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 2/3] net-next: dsa: add multi cpu port support Message-ID: <20170531005242.GB12615@lunn.ch> References: <20170530104419.6052-1-john@phrozen.org> <20170530104419.6052-2-john@phrozen.org> <8d6996ef-72c0-546f-6bbe-5a6ea6e83c5f@gmail.com> <20170531000636.GA12615@lunn.ch> <881bf3fe-1ffb-b9fd-c844-da265f71370d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <881bf3fe-1ffb-b9fd-c844-da265f71370d@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 30, 2017 at 05:16:27PM -0700, Florian Fainelli wrote: > On 05/30/2017 05:06 PM, Andrew Lunn wrote: > >> - past the initial setup, if we start creating bridge devices and so on, > >> we have no way to tell: group Ports 0-3 together and send traffic to CPU > >> port 0, then let Port 5 alone and send traffic to CPU port 1, that's a > >> DSA-only problem though, because we still have the CPU port(s) as > >> independent network interfaces. > > > > What is the problem here? Frames come out the master interface, get > > untagged and passed to the slave interface and go upto the bridge. It > > should all just work. Same in the reverse direction. > > The problem is really that is you have multiple CPU ports, how do you > define which one gets all the traffic by default? Ascending order of > port number? Descending order? I would probably default to round robin when allocating user ports to CPU ports. That probably gives you the best default. > I actually tend to think that most use cases our there are in the order > of dedicating one CPU port to one corresponding switch port (user > facing, or internal) in order to provided guaranteed bandwidth for that > port. Which is generally a waste of bandwidth. Best case, i get 40Mbps Internet access. Meaning 960Mbps of a dedicated cpu port would be wasted. > But as an user, I want to choose how the grouping is going to > work, and right now, I cannot, unless this is hardcoded in Device Tree, > which sounds both wrong and inadequate. So how about round-robin default, and then devlink to move a user port to a specific cpu port? We also need to watch out for asymmetry. I think newer marvell chips don't support egress to multiple CPU ports. Ingress to the switch i think is unlimited. The older chips are more flexible in this respect. So we need some degree of flexibility here. Andrew