Received: by 10.213.65.68 with SMTP id h4csp409656imn; Fri, 30 Mar 2018 07:51:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx48DWtul23yg194lTgmyVLtuFnao9fFL17HqsCWTghkVrf63ZV/b593HRvvBy/sWkMJ4frO1 X-Received: by 10.98.69.142 with SMTP id n14mr10029491pfi.42.1522421503743; Fri, 30 Mar 2018 07:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522421503; cv=none; d=google.com; s=arc-20160816; b=mX1TFX5etgm5N0IOa/8CXHONEOPVTe83VfHQBQuD3Fh84l8bgBDuZ1sjmmA0AtjS+C 9VBtfWtzJum1+4wxE9Mj86sihvyQ50YFQexLKLvHQ8E5cvabOFIlHk9zV8C4Dz+oD43k XLHgWiRmpvcxNrj0u/nNy1+fm2sQYpk+pdUhAO9BDz7oWZNep5HvSiBGoJVkw1rYlGny NeJF4c1tyhj4Jo26CXGCLZBApX4n/dkeVnWvR2P9LfburCmfQIA1fPzLkbsiSvlUKA4v mQTbJwZHL0FE5dV3GzWwOQPQJvc8g1MDc9/P1R+73+g7tRFS0knRkA/s8rBdqU9mK5xz YYMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=FTpGNAYh/8VA0UjQXcvEPnKVtZDoDGUlB6Wehn210a8=; b=qJQBfriwHCjAo3r3lQ+mBsjOFFDYB7T42uKjzZBSGj4n8ue6rzM8/jLykJ+89oodn8 qYLOUJh/1QmdDPcCPrCQNTn5cCPvRKE5AR9dc15wxXObWoWiMk0HwNBw6uT81Nwo7nN0 MrtNg12qrl24JMtoVcm/6p88vex4QWCQcGx5DYCzxOdSegzXsgX3XXmhMq4Q6IBJeoyX dKVGHEnUwdy2KIUCcsNyiGq1nmgKIr/SXz5b3zUnlXzNQIZx4NAzNgqAztB8WkT2YKqx PtDe5EUdKCL9yx+6m+F4EijG9GtHcD6g2FzRuE3RNu/kMuX2hMNEmIrutf4veg+OSoWA n8UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=A1XMbAWF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15si5629899pgn.17.2018.03.30.07.51.29; Fri, 30 Mar 2018 07:51:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=A1XMbAWF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752307AbeC3OuP (ORCPT + 99 others); Fri, 30 Mar 2018 10:50:15 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:47384 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbeC3OuO (ORCPT ); Fri, 30 Mar 2018 10:50:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=FTpGNAYh/8VA0UjQXcvEPnKVtZDoDGUlB6Wehn210a8=; b=A1XMbAWFADtuAgAHYCbicj26/X35tSYd5YwWhFfcj2nU9jkNO281QO1N327A4vKxrgeUvC/kDiYy1Q7hFLJKs9R/PZ2KNHS1WZ06zDvFD08a+ij88uEBaDP7dwGp/JOG7W7BYucb81hlmI4YkrQ4mk7Ec6oxVy0Hskod7dhEiuM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1f1vM0-0007o1-LI; Fri, 30 Mar 2018 16:50:08 +0200 Date: Fri, 30 Mar 2018 16:50:08 +0200 From: Andrew Lunn To: Alexandre Belloni Cc: Florian Fainelli , "David S . Miller" , Allan Nielsen , razvan.stefanescu@nxp.com, po.liu@nxp.com, Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH net-next 5/8] net: mscc: Add initial Ocelot switch support Message-ID: <20180330145008.GE28244@lunn.ch> References: <20180323201117.8416-1-alexandre.belloni@bootlin.com> <20180323201117.8416-6-alexandre.belloni@bootlin.com> <1df0a932-f7c1-f1b5-9a35-3c16d0c551e5@gmail.com> <20180330124537.GC14180@piout.net> <20180330135422.GA28244@lunn.ch> <20180330141634.GD14180@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180330141634.GD14180@piout.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 30, 2018 at 04:16:34PM +0200, Alexandre Belloni wrote: > On 30/03/2018 at 15:54:22 +0200, Andrew Lunn wrote: > > > > All of this sounds like it should be moved into the br_join/leave, this > > > > does not appear to be the right place to do that. > > > > > > > > > > No, I've triple checked because this is a comment that both Andrew and > > > you had. Once a port is added to the PGID MASK, it will start forwarding > > > frames so we really want that to happen only when the port is in > > > BR_STATE_FORWARDING state. Else, we may forward frames between the > > > addition of the port to the bridge and setting the port to the > > > BR_STATE_BLOCKING state. > > > > Hi Alexandre > > > > Interesting observation. I took a look at some of the other join > > implementations. mv88e6xxx does the join immediately. mt7539 does it > > immediately, if the port is enabled. lan9303 does it immediately. > > qca8k does it immediately. b53 does it immediately. > > > > I had a look at b53, my impression was that b53_br_join() adds the port > to the bridge but b53_br_set_stp_state() actually enables forwarding. So > as long as the default on the port is PORT_CTRL_DIS_STATE, the port will > not be forwarding frames. And this is the case because b53_enable_port() > does put 0 in B53_PORT_CTRL. https://elixir.bootlin.com/linux/latest/source/drivers/net/dsa/b53/b53_regs.h#L71 It seems like, 0 means no STP at all. Which to me would mean, forward all packets. But i could be wrong. Florian? > The fact is that ocelot doesn't have separate controls. The port is > either forwarding or not. If it is not forwarding, then there is nothing > to tell the HW to do. Think about the following sequence: ip link set lan0 up After this command, i expect to see packets on lan0 arrive at the host, tcpdump to work, etc. This probably means the port is in 'forwarding' mode, or for B53, STP is disabled. ip link add name br0 type bridge ip link set dev br0 up ip link set dev lan0 master br0 When the port is added to the bridge, there is a window of time between the join and the STP change to blocking/learning, when the port is in forwarding mode. You avoid this window. But the other drivers don't appear to. So i would like to fix this of every driver. I'm not sure how yet... Andrew