Received: by 10.213.65.68 with SMTP id h4csp377851imn; Fri, 30 Mar 2018 07:18:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/YH8b4lNaot3TummtUfrhgQHNr+bCsmOuwDbvsI6aMOUBaB8qOd3yvyhVTcRI4C+am7+tv X-Received: by 2002:a17:902:744b:: with SMTP id e11-v6mr7882966plt.351.1522419487305; Fri, 30 Mar 2018 07:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522419487; cv=none; d=google.com; s=arc-20160816; b=mpmwC+L00pp/1g0lyuKTGLXm5yhK49ddP+QoZ8fS8tMsFlx0I8xLJnJ0CyBLzLsMs3 olhOGndXd+dfdIFY2nqVwIlx4HkEEJZaE6arYRatTk6SorcZNf2KOoHCEs7twS92BTW9 FPBrtZYW/4E6HTQbvY/bI1be/Xjfpfe79N3D2cBzM/oGO2PPPLIvW/zdo74ueLaMGYmZ OiGWAInPaMHB34Muvp7Duh4NO58WfdYrKhld2kYtaGtxJTXI3sAnu6fdICF7B+RYVOwm yibLQFAeSs44KvUYTawog75XsRbNFNwb4kkIt+65QqLazX0b3UtI3h/Nmnr0SI554Mb3 08Gw== 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:arc-authentication-results; bh=V2ipUlZc7rd6rhaQyjelLNdeZbu79KtNNP53Aocao8o=; b=NCe6WTXaOZYoThaRNKSDxgooo19ss6K6KVcV1DpaCyYxJv4MvaGUIH5gEygqbpTMmK ErXKwCeKkEdOG3aQMN5/v6VXLeOwJJgZ06yhFBK7F0oEBVX+kmAW3cbwUBX4sXpYU9uh zOds9+StHPJvYGvFaCLCwIMyQZdts58kS7VTK4cU7qTvw8iPEOrzES4ARK3h3dYhcMnP DrpdbvZHGWJfhjayNvK8cj1JY8GYgCFz8yMZeSfleCvd+nG9QPAKm5Sn9CBb2fu8JK5w VBRjs6ojpsV2UIAgP8+NTqNai+XWJenyQpI/fBvBwdRkMmxAu9H4X56wkwdlKOqzxAuF cNTw== ARC-Authentication-Results: i=1; mx.google.com; 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 y5si5711372pgc.820.2018.03.30.07.17.52; Fri, 30 Mar 2018 07:18:07 -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; 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 S1752006AbeC3OQs (ORCPT + 99 others); Fri, 30 Mar 2018 10:16:48 -0400 Received: from mail.bootlin.com ([62.4.15.54]:39587 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbeC3OQq (ORCPT ); Fri, 30 Mar 2018 10:16:46 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 272A920644; Fri, 30 Mar 2018 16:16:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id F295220384; Fri, 30 Mar 2018 16:16:34 +0200 (CEST) Date: Fri, 30 Mar 2018 16:16:34 +0200 From: Alexandre Belloni To: Andrew Lunn 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: <20180330141634.GD14180@piout.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180330135422.GA28244@lunn.ch> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com