Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1864291pxm; Fri, 4 Mar 2022 05:11:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXn3gG/xtSjS6rNjV3Kn+cUd4z2h4TdIOihT3Zt+MUWLbkt8GiQAwb0ssxj4ucCKJipW0t X-Received: by 2002:a05:6402:510e:b0:413:963:4eac with SMTP id m14-20020a056402510e00b0041309634eacmr39447607edd.93.1646399470881; Fri, 04 Mar 2022 05:11:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646399470; cv=none; d=google.com; s=arc-20160816; b=UsMzX/cT0V50jcycHh5r/JtBYI3L5lSY9QkeD8zda7XbqpLEphysPipfgJHmtCQSxS JDWCdjw/TmcqNrd8hffvZ59x4Vg1SXum0QcMiuZBYPZwkYDXZtE5wRpXw37YdpnCDfC2 /zME3Vzs0F1SHktCsWnztaoCQDyQlJOH5WQsJ5XEe1/kt+MkS/F5eSrlwi3NdRO/D/vC I4x8hnJQ3bwpsgRv7mOaltMHrZ65BIsYWxGEUEQ2PdgXq36OyfhxCdNPzYVv/gYG5JtD DDv39YoNe5rBY0B7Sor1THYjofRhKP8NkjusWdD8oyK16i0OmzinVmTuBeG3KQ+Bvzo6 0H+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q3KMKlNL1UmXA+3fpqyraxkBiFVYfDRSUjKE3l3RuVk=; b=lFMf8Eh1/XVEfx4nawrqEsZlSV0iQfDT6Gz9tb8+x+OOBu4hMgDsLHIh+zUqAoYhGn bdwXLYrRMvhVJYTKnRPHN4VzXVKIzkwCnnaxDuN3/l2emiYhuT6vPY+2H7bR27FUbQTr Ip6p+dZEqNzoY+G/1n7DP11ejZiPR8s1EoILdiEYk5q+GdkYBPCeN5YWMze7IA8Ba0i4 8+BLNsk71RYrOp1Xm3BGtUplIFVEYfjspFeoNOjDZjrsc8sdxnDLC9PJc9HvQzp2x2Lu GFYjxnLW3O90c1lFiH1gv+w6PDDsBmycn6CFlggnCX8mNrnVfg0Y9NJN5RoIwF9vNYcq uFNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MDnX4bgC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz7-20020a1709077d8700b006dab83715b7si1346337ejc.165.2022.03.04.05.10.46; Fri, 04 Mar 2022 05:11:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MDnX4bgC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236904AbiCCW3k (ORCPT + 99 others); Thu, 3 Mar 2022 17:29:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231722AbiCCW3i (ORCPT ); Thu, 3 Mar 2022 17:29:38 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 733F24F9D6; Thu, 3 Mar 2022 14:28:52 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id p15so13686676ejc.7; Thu, 03 Mar 2022 14:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Q3KMKlNL1UmXA+3fpqyraxkBiFVYfDRSUjKE3l3RuVk=; b=MDnX4bgCQ/oEW0UhmojxOqONfN9vQW6YLWXvJiTN9ZgftqcQr1HntMOS2g3/z2DPmE 8m33ZJNdMHy5QvE34NBHTPyrFtQvSqNCX42VcKXLUA28fVVOjSENDm9kkQb1YrThCzCw 4mhs+Ja7G4trf5TymB8l8SBevLF4w8Cx1wjasWV1OlHemYMPolDQEc3m40FjuotYMIpW V6ohRAT19l0vMqSS6sFnNBHePLzvjUzcp24j5GeZvNTFfz0x9TD2VOYGM0sWaQzurbAG VnZd3CbpCGqvfBGxVJoFWuMNGVRlf0X0sqsXMbKEppdV4jwy/kqgzP0I0ikBXbUVso/Z hbtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Q3KMKlNL1UmXA+3fpqyraxkBiFVYfDRSUjKE3l3RuVk=; b=P/2ngA0FyEHXKt4hqIz9HzpYQq1w3xcHsbxEKIMHVG6YNhN89x7Hpws9/yoDEPqv3E EcpHjj6AKh6dACEwgE6iClywy5JXqFKy+hx4X2snwS6Jb1JlZ/EVffY2TdaMd1p0AVQ1 2IFJCOUtwuZ3YIQTwnCcvjqOgvjcm9O2fvQ0wL2PoGAQRbOVnMTs+CflW04LF4j9iz2o +QUKSY7VzYohlZtJAKuzphQ3JHWHep8z1xpD3X4oQYDMnzoRq32WU5kdWz/dw0qGYozU o8327ahW36YYCohhd1ItrwvozSNtcRKweDH+9Sbf1KHX2R/c+q0B6DxUfU4fR13gDX+f 5OHg== X-Gm-Message-State: AOAM530VxHyrYgiJYDEeNg+X4APjS+utm4WFXb8E2n/R7GD6Ni4ceM+U o7d+OGqz9EMDXkMxEsi8vQ8= X-Received: by 2002:a17:906:5d11:b0:6da:68ed:270f with SMTP id g17-20020a1709065d1100b006da68ed270fmr7732259ejt.661.1646346530968; Thu, 03 Mar 2022 14:28:50 -0800 (PST) Received: from skbuf ([188.25.231.156]) by smtp.gmail.com with ESMTPSA id n27-20020a1709062bdb00b006da975173bfsm810028ejg.170.2022.03.03.14.28.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 14:28:50 -0800 (PST) Date: Fri, 4 Mar 2022 00:28:48 +0200 From: Vladimir Oltean To: Tobias Waldekranz Cc: davem@davemloft.net, kuba@kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Russell King , Petr Machata , Cooper Lees , Ido Schimmel , Matt Johnston , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bridge@lists.linux-foundation.org Subject: Re: [PATCH v2 net-next 01/10] net: bridge: mst: Multiple Spanning Tree (MST) mode Message-ID: <20220303222848.4e2s2zrbzfckmiqw@skbuf> References: <20220301100321.951175-1-tobias@waldekranz.com> <20220301100321.951175-2-tobias@waldekranz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301100321.951175-2-tobias@waldekranz.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 01, 2022 at 11:03:12AM +0100, Tobias Waldekranz wrote: > Allow the user to switch from the current per-VLAN STP mode to an MST > mode. > > Up to this point, per-VLAN STP states where always isolated from each > other. This is in contrast to the MSTP standard (802.1Q-2018, Clause > 13.5), where VLANs are grouped into MST instances (MSTIs), and the > state is managed on a per-MSTI level, rather that at the per-VLAN > level. > > Perhaps due to the prevalence of the standard, many switching ASICs > are built after the same model. Therefore, add a corresponding MST > mode to the bridge, which we can later add offloading support for in a > straight-forward way. > > For now, all VLANs are fixed to MSTI 0, also called the Common > Spanning Tree (CST). That is, all VLANs will follow the port-global > state. > > Upcoming changes will make this actually useful by allowing VLANs to > be mapped to arbitrary MSTIs and allow individual MSTI states to be > changed. > > Signed-off-by: Tobias Waldekranz > --- > +void br_mst_vlan_set_state(struct net_bridge_port *p, struct net_bridge_vlan *v, > + u8 state) Function can be static. > +{ > + struct net_bridge_vlan_group *vg = nbp_vlan_group(p); > + > + if (v->state == state) > + return; > + > + br_vlan_set_state(v, state); > + > + if (v->vid == vg->pvid) > + br_vlan_set_pvid_state(vg, state); > +}