From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 330E3C433E2 for ; Fri, 19 Mar 2021 22:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22C3A61996 for ; Fri, 19 Mar 2021 22:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231167AbhCSWLn (ORCPT ); Fri, 19 Mar 2021 18:11:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230497AbhCSWLf (ORCPT ); Fri, 19 Mar 2021 18:11:35 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ABB2C061760; Fri, 19 Mar 2021 15:11:24 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id o2so3580749plg.1; Fri, 19 Mar 2021 15:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=t8WayWLX100d3xFTK35dbfG/wOjXzoQhDFEPaisQ7eI=; b=RgYIyxe03R+Jy1z5L+rb6cBGH2Qb1DV9sNFUQGfj69Kfmqk9/iJ8DECNE8GCDp+wCn /PF7C6qtlDAuxpn9q1vBh2yp+wopRHaskbwm8iUBK4oxiosKJKuOwA1QRhSE0P/dDyWZ 7XsB4DtPLoeaw0se3lLaCLEdVwPO/kCEEboiOeeIUHYL4lHE5538KIl1yp02a2eBjVbs NlGryOafI/X9nfwfcJLpU5pRaFIF+A6TcAAXS5vzPQNccYAsP3gyCtbcMNuF0cITcctH 9RTNBg7gfieIRBdDrM21dVFbAVaiZ5b6bwhjvBf6IeD2J6cy3rwUMjjE8QObI1ckiZOd v1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=t8WayWLX100d3xFTK35dbfG/wOjXzoQhDFEPaisQ7eI=; b=oOAm1MbJ+uvyjx1oStEJSESEeiM57bYkJcKTPSnTQAL+yRyGOlH/nuKU6XGOJFslA1 rl/RYBm2Mh7rK5M6vU8gOfJyutfskfEKIM6gH+dEI//k7aQaIwXoOUoLHhUixpnuhnM6 sSEcZqLAfhGnhWImrwE5AejkF9b1U2e+1WtYNAsATznea6txP1+BMnwzsYr7TrkAvuFU KgUj3Q0xlXz1njh9IolgucIP6ePcIuJa/Em3svnOwAKMWLKgVmiS3s0I5H350Raa/1aZ cC9YV830pND5q0wVOTSXnzBkKcHlwOR+pPaxwg3hecsPtdE+NSli10yD24EdtuYNJYDe NS0g== X-Gm-Message-State: AOAM5300nMFQFK7rZGe89/x/txjI/wufVH/jhoIlvlbh7I1sxJNBUoxG RFNQrSc4PdaeFdU3x5GZbf4= X-Google-Smtp-Source: ABdhPJyisagm4D5zoRtKG3oF2VcxketjF4NttZj6PUIP0lph4ypKh2uzUvA8NEXKDH95sos75hrKuA== X-Received: by 2002:a17:902:da92:b029:e5:fa64:e9f3 with SMTP id j18-20020a170902da92b02900e5fa64e9f3mr15916568plx.54.1616191883967; Fri, 19 Mar 2021 15:11:23 -0700 (PDT) Received: from [10.230.29.202] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id fa21sm6475082pjb.41.2021.03.19.15.11.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 15:11:23 -0700 (PDT) Subject: Re: [RFC PATCH v2 net-next 04/16] net: dsa: sync up with bridge port's STP state when joining To: Vladimir Oltean , Jakub Kicinski , "David S. Miller" Cc: Andrew Lunn , Vivien Didelot , Tobias Waldekranz , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Roopa Prabhu , Nikolay Aleksandrov , Jiri Pirko , Ido Schimmel , Alexandre Belloni , UNGLinuxDriver@microchip.com, Vadym Kochan , Taras Chornyi , Grygorii Strashko , Vignesh Raghavendra , Ioana Ciornei , Ivan Vecera , linux-omap@vger.kernel.org, Vladimir Oltean References: <20210318231829.3892920-1-olteanv@gmail.com> <20210318231829.3892920-5-olteanv@gmail.com> From: Florian Fainelli Message-ID: Date: Fri, 19 Mar 2021 15:11:18 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210318231829.3892920-5-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/2021 4:18 PM, Vladimir Oltean wrote: > From: Vladimir Oltean > > It may happen that we have the following topology: > > ip link add br0 type bridge stp_state 1 > ip link add bond0 type bond > ip link set bond0 master br0 > ip link set swp0 master bond0 > ip link set swp1 master bond0 > > STP decides that it should put bond0 into the BLOCKING state, and > that's that. The ports that are actively listening for the switchdev > port attributes emitted for the bond0 bridge port (because they are > offloading it) and have the honor of seeing that switchdev port > attribute can react to it, so we can program swp0 and swp1 into the > BLOCKING state. > > But if then we do: > > ip link set swp2 master bond0 > > then as far as the bridge is concerned, nothing has changed: it still > has one bridge port. But this new bridge port will not see any STP state > change notification and will remain FORWARDING, which is how the > standalone code leaves it in. > > Add a function to the bridge which retrieves the current STP state, such > that drivers can synchronize to it when they may have missed switchdev > events. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian