Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp989493pxp; Wed, 16 Mar 2022 23:39:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7Omq4oQmg6PS3CdwwI8ZTErET02ooYQBtUvZDxWlVn8v4s854RMi7iNl28wO/ViUvMdfN X-Received: by 2002:a05:6a00:170c:b0:4f7:658d:77a2 with SMTP id h12-20020a056a00170c00b004f7658d77a2mr3000050pfc.60.1647499148283; Wed, 16 Mar 2022 23:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647499148; cv=none; d=google.com; s=arc-20160816; b=gfExtHFKkhOArUrC+TKlFOv280ELeBmxhE0zLu/ltg/sSsv3fP0Uq5mObGDtwHTOw8 rGun9fyieBxFxoxW68Zd9C+9Z+wnahJuxBoAX6TkRLNOpC+IHELkVBN5CuuIxcUdhBrh 1ABxNmc7FzwCuRYK2YfhI+hdW91izwZKC8TerGfW2x7Gxbw1DqTszhfET7OP2ieEJIy6 9JJVavs3yCsv4NZ3uz5lLCkRYlN/dUyoBy0mncyklKRWYi59hOQWQpvaUSAfc352HkaS l/a8jGgvKcjPaDhQH6sNL8gNWtEAt+A425uB903x8TdhijQMn8LldMZZ0Z9H+xJw2vvY EJFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=6n6ZEPynSftslrkkn67A9oe0ON+g8zOOoRrauuQESMk=; b=I4lhOCPwdiDOVKqe5LdLm8wMqvA/n91SwP8bp9ayoNamdPz2hWBsfq66Hk5dqVH80n HIlbM5FiYh4qgy/Y9mUKBxHADz7SxMw4k/BRTfvE5SMCNQ28p7rl1hMSjcaqOdSO5UKL +3amQEd0ZvD19Es+0E6Jv6A8qO8HrHhy3+mNuG/3mUoIqhXVMiYFb1utkYfwy11jzcA9 nCdsZkvQ6N2qJktdsoeDMge4nakF2TPA6t4uO+vUvDVdForXI1/bD5chKVXINnvg06PE ONsqcyucdn5s3PjaPK+nPNwBTARXuGHLZk9YObEXvHsNfEt2mTgoosY0oFp5ipjHQnFD NB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=mdNIalz8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l21-20020a056a0016d500b004f23eb797a1si4508638pfc.112.2022.03.16.23.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:39:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=mdNIalz8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 865BE2C2F66; Wed, 16 Mar 2022 22:25:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235327AbiCNLKW (ORCPT + 99 others); Mon, 14 Mar 2022 07:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230525AbiCNLKT (ORCPT ); Mon, 14 Mar 2022 07:10:19 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C97113CF9 for ; Mon, 14 Mar 2022 04:09:09 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id c20so19252106edr.8 for ; Mon, 14 Mar 2022 04:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=6n6ZEPynSftslrkkn67A9oe0ON+g8zOOoRrauuQESMk=; b=mdNIalz8h2RDTjPqrlM3K4jz0236U7jn5xSEIBvOEbVYU/XbpiHR159ZScGA4hIDYx yuL9nVsFKdhvSzggc/aCQm7MaYAF0quz3ReRJfl3YNaP13vvZulbDJzlv6X7A9O9OTy7 pI3wSVawVh5TNALp7y/RBVPdu1nsqFXZBbZmkAAA+nyGM/4HGglw7KnHsIj6bsba+0K4 t2R/sBj7TWigNOI6yHniw5MThsD7e9Pdt3uiptfvGhwjZAJAHGyx2NLiO4qVRIYELhUj MH/kDdd+9R31vP59FZ4L2Fwm40x5LTQ+tIjfEjBpmSXbk2Jdz/nfQFpL1+nO3OEyhVzC evAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=6n6ZEPynSftslrkkn67A9oe0ON+g8zOOoRrauuQESMk=; b=jxZvj8L6u5j+h7/Mf5A3J0r2Chi41gJDCrPDrMQG2sZAsAOhziL9zUJKkcBWi7iYAm WT/iGy8tSH/tnRCT6nkVCNeFBhZIb9wVpvCQ92tAYwp1SHNRHI9iSdSKINohMZvjrPJG q0MoVFxMue1r4UcAHijR4PbQQBiBsQJaTobWd/ACjeg93r5U66b0mxNXTvhli66sr/qm eXQDwJnF/6Fe0QML8tu0RmHigWkpCS5YP1K2GVA6tMpw8nWvWRPb+e5dvElw097N9IC5 pMrC23W8BZbWssf04Jbx2dWRqh9MsPaGk5R6EaWQIYfSs3uRU96P24SWVenZIL7DTVsg wEzw== X-Gm-Message-State: AOAM532abfKGlG7Q7hEqy77IkiThcgzZmaBcMO+UVZ64VEjMVGj7inIr HXnjxkQxGLxx2ahm6b9mDb6stA== X-Received: by 2002:aa7:ce1a:0:b0:416:460:9df5 with SMTP id d26-20020aa7ce1a000000b0041604609df5mr19651936edv.277.1647256147967; Mon, 14 Mar 2022 04:09:07 -0700 (PDT) Received: from [192.168.0.111] (87-243-81-1.ip.btc-net.bg. [87.243.81.1]) by smtp.gmail.com with ESMTPSA id er12-20020a056402448c00b00413d03ac4a2sm7419235edb.69.2022.03.14.04.09.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 04:09:07 -0700 (PDT) Message-ID: <037a8f48-29c5-ae45-b562-df15dbe6d163@blackwall.org> Date: Mon, 14 Mar 2022 13:09:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 net-next 01/14] net: bridge: mst: Multiple Spanning Tree (MST) mode Content-Language: en-US From: Nikolay Aleksandrov To: Tobias Waldekranz , davem@davemloft.net, kuba@kernel.org Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Russell King , Ido Schimmel , Petr Machata , Cooper Lees , Matt Johnston , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bridge@lists.linux-foundation.org References: <20220314095231.3486931-1-tobias@waldekranz.com> <20220314095231.3486931-2-tobias@waldekranz.com> <9c103a85-f0e2-77cd-9fc6-dc19d99b19ec@blackwall.org> In-Reply-To: <9c103a85-f0e2-77cd-9fc6-dc19d99b19ec@blackwall.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 14/03/2022 12:37, Nikolay Aleksandrov wrote: > On 14/03/2022 11:52, 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 >> --- > [snip] >> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h >> index 48bc61ebc211..35b47f6b449a 100644 >> --- a/net/bridge/br_private.h >> +++ b/net/bridge/br_private.h >> @@ -178,6 +178,7 @@ enum { >> * @br_mcast_ctx: if MASTER flag set, this is the global vlan multicast context >> * @port_mcast_ctx: if MASTER flag unset, this is the per-port/vlan multicast >> * context >> + * @msti: if MASTER flag set, this holds the VLANs MST instance >> * @vlist: sorted list of VLAN entries >> * @rcu: used for entry destruction >> * >> @@ -210,6 +211,8 @@ struct net_bridge_vlan { >> struct net_bridge_mcast_port port_mcast_ctx; >> }; >> >> + u16 msti; >> + >> struct list_head vlist; >> >> struct rcu_head rcu; >> @@ -445,6 +448,7 @@ enum net_bridge_opts { >> BROPT_NO_LL_LEARN, >> BROPT_VLAN_BRIDGE_BINDING, >> BROPT_MCAST_VLAN_SNOOPING_ENABLED, >> + BROPT_MST_ENABLED, >> }; >> >> struct net_bridge { >> @@ -1765,6 +1769,29 @@ static inline bool br_vlan_state_allowed(u8 state, bool learn_allow) >> } >> #endif >> >> +/* br_mst.c */ >> +#ifdef CONFIG_BRIDGE_VLAN_FILTERING > > There is already such ifdef, you can embed all MST code inside it. > My bad, I somehow confused the function placement. This is good. :) Acked-by: Nikolay Aleksandrov