Received: by 10.213.65.68 with SMTP id h4csp355370imn; Fri, 30 Mar 2018 06:56:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx48A1GsT+c5dr8GLwywy7Ohh5edKkzR6KRAg8Jbxnq+gidXxQvXkV1asmQo+T+jEddJcdEkj X-Received: by 2002:a17:902:a589:: with SMTP id az9-v6mr12935954plb.283.1522418161956; Fri, 30 Mar 2018 06:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522418161; cv=none; d=google.com; s=arc-20160816; b=h3olJItXcrUIpvp08JTV6KfvsGPgt2wFrwIKBujMq9urajaHv4i3gz4prV9zdiNcrV TfzvZxQMho3BvjCOqphSrz6Bz7eqgK+PpRhNqsFzqfnO3N4TQOfD/v9I1aNxIMUgMZX3 eN+ZX/mL0swtSzbcvBaGSG4OdiJlF0Y1PotnjRgO/C713Iqu5t+Qu2NWOrC0Yh+vSGAL doA8CbonagpQ/ZEh7q022gPsYtFQIMBDn8KrylI3eh52JyfwBm2snIx+PQiOuUuQQKis kT4gnQvMzE5yFAfp89h8kIuWJCDQobLds3W5rY9OJuqFS8AzCPXq4cZCa5Abad7x5Dt+ udlA== 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=C9WlJNag0D/wjLxtNQAKyzZSl+qdKL/owk8s2wktyNw=; b=GIFyO6mDaM4vfyXrJ66Z2EhUuZNBq1k1GH5LatBK8J6o7r8QemgjagZz/qRnxTJaPc q5hAMmcLmFTanleLVr5J4TtTihR/raFo4M6tDR8hQXcHE1k8ehIhZG2O6vKrllRNJWeM lxeL2rotvvN8/aRD+9TKpVoh1qoAQqhKSdcui+rKxZdf2SYeQT1uPQjGvlHwzFTZxAWC 8b3NkBlhcvEK1Gl2f2O9lmxXC9vZR6OWpTuB+QoWZmW75VCzStZk514dtuHUB/HBaKE4 5URORdFGEf3NMgiVez8a44iop5L0GfP5XdEDty2/kGexvupEm3BCJe9NHgUk/RvjXeBG 57Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=2Bs0AE+J; 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 d21-v6si6503446plr.664.2018.03.30.06.55.48; Fri, 30 Mar 2018 06:56:01 -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=2Bs0AE+J; 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 S1751749AbeC3Nyh (ORCPT + 99 others); Fri, 30 Mar 2018 09:54:37 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:47308 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbeC3Nyf (ORCPT ); Fri, 30 Mar 2018 09:54:35 -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=C9WlJNag0D/wjLxtNQAKyzZSl+qdKL/owk8s2wktyNw=; b=2Bs0AE+JF/Tq3r4o5Q+f7hUlhGKbHbfu19iIOjFGkF0RKRCuMQE3hISZx2wV0S+X6swlFoPc9HfvKYbX0eiFFJfdLydQArYCJ9rCEVGYu1fvP5YQsn7jWOC6c7ScmfuJFlMGXLPgYe/eyBwwK2BBrxIJJSFgL1+BCTXXjMz+9k0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1f1uU2-0007Pk-EI; Fri, 30 Mar 2018 15:54:22 +0200 Date: Fri, 30 Mar 2018 15:54:22 +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: <20180330135422.GA28244@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180330124537.GC14180@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 > > 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. Either they all get it wrong, or we make the assumption the bridge sets the STP state first, then has the port join the bridge. Looking at the code, br_add_if() it calls netdev_master_upper_dev_link() and then later if (netif_running(dev) && netif_oper_up(dev) && (br->dev->flags & IFF_UP)) br_stp_enable_port(p); So it does look like there is a window of time between the port joining and the STP state being set. I know in the past, we have run into the opposite problem. A port leaves the bridge, while in blocked state. The port should then becomes an individual port, so the STP state needs setting to forwarding. I don't remember where we fix this. I don't like that this new driver is different, but it also looks like we have a real problem here. More digging needed. Andrew