Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5856872rwl; Mon, 9 Jan 2023 00:17:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvDcgPLiavf2Nnz2zlCNDVdJMJ7oewsZoXLIUOeb01UwqXYYF3EZDZN2zRIsXfYILTvGfDM X-Received: by 2002:a17:906:8a58:b0:7c1:75e9:986 with SMTP id gx24-20020a1709068a5800b007c175e90986mr50730790ejc.37.1673252231871; Mon, 09 Jan 2023 00:17:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673252231; cv=none; d=google.com; s=arc-20160816; b=u2Wm2e+WxbzF3EPRmqaFvccU6NO/NNPwCEiPuOK/5jve2qjAc28yDZZNZ5fvGch2qz hBKk2Im9NetTaJDN2A70Yzr9bNI4Mi/ejxtzyhjuuQRIgB/vNmIWjdSyLwcpkOjqsuIg Rltu92bPd7rAl2dotuJpLQNv8eZbh4agaoJGHVO3lGkd7NsqwNhjM6+5s9fOKNvBTdTs 6CUvvbAbssrvumJc5Slb529nPh3A5s22LvVmnIB2JnSRn9EXRq3MIKOvtOJsrMae70WD j1mmOVU1zZAdT6Trk4a5nOnL22bJSDC+lIdl+C0RUrHtGSJZ+r0gL7LodCF4XQe5v/sm YrSg== 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:feedback-id :dkim-signature; bh=hObozgfzpCa4NJkSvRz0TIjGKTPejFUvHPU4Z0aahqk=; b=Y22PWDlVuQhz9dG96kgOaccE9tjGld12OO7VqWcYeZrCGCQAxcmDVn1ZEUHtPkqUT1 WzVAhp6jN/r7NhjwTyY6NoOjw/FYozqmaOgohttxd861irrikH967CzaTNRF6BK201p1 2A3Gyl4RpM6NiTloKskZb50Pp5nOYjPj9RjZDz+ULjB2UgAyY6csoR6n2JDJqWDalhF4 754Lf4dDYOYH4LuQHdZnAy+2LIci5Gj1HXbcthRAC13flVrtkwoWwxkiS7sPlgpw2fmz +iT1GUrNwe7T7ibGLjrkttEDKuazwQnOdvU41IP+h7BVct7jFheGII6ELrI0oPvQUXQW yZvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=mzxOVgnY; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh9-20020a0564020f8900b00469322471e2si8063123edb.534.2023.01.09.00.16.59; Mon, 09 Jan 2023 00:17:11 -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=@messagingengine.com header.s=fm3 header.b=mzxOVgnY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236303AbjAIIGu (ORCPT + 54 others); Mon, 9 Jan 2023 03:06:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236497AbjAIIGb (ORCPT ); Mon, 9 Jan 2023 03:06:31 -0500 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 943ABBA4; Mon, 9 Jan 2023 00:06:03 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id CD49832006F5; Mon, 9 Jan 2023 03:05:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 09 Jan 2023 03:06:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1673251558; x=1673337958; bh=hObozgfzpCa4NJkSvRz0TIjGKTPe jFUvHPU4Z0aahqk=; b=mzxOVgnYUmn1wqkvAoWZNnNN7BUjMblm39y8OWSvfmWq v3yc/JIaIn8ehELmCz5BW/SbUKx2+l3nl8SWKpCptAqZMqDNQOm3f7oWtNk0fnIf cECuWF/EThU6YipnukTdmxsSz4VKplC3izMcBUceGP/Y+gmYAb0yTWaYYCRDi2eL CBxayCahGbY3xW9Sc9ZabOZ/mg4/DS3OoljyhOOBV6f+mqAvs5BXAtWy8Y2X4Xtc QlKNITAK0OyTqIPwNTH9e8rLr/t+Drpov8608l6NgFpFHyn4X885BThpWUDNMXDU izE8b3OI056CdOZBeSGeMDY5JT72dwD9sWtT/qp7/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkeehgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcu ufgthhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrth htvghrnhepvddufeevkeehueegfedtvdevfefgudeifeduieefgfelkeehgeelgeejjeeg gefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih guohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Jan 2023 03:05:56 -0500 (EST) Date: Mon, 9 Jan 2023 10:05:53 +0200 From: Ido Schimmel To: Tobias Waldekranz Cc: davem@davemloft.net, kuba@kernel.org, Nikolay Aleksandrov , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Russell King , Petr Machata , Ido Schimmel , Matt Johnston , Cooper Lees , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bridge@lists.linux-foundation.org Subject: Re: [PATCH v5 net-next 01/15] net: bridge: mst: Multiple Spanning Tree (MST) mode Message-ID: References: <20220316150857.2442916-1-tobias@waldekranz.com> <20220316150857.2442916-2-tobias@waldekranz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220316150857.2442916-2-tobias@waldekranz.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE 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 Wed, Mar 16, 2022 at 04:08:43PM +0100, Tobias Waldekranz wrote: > +DEFINE_STATIC_KEY_FALSE(br_mst_used); [...] > +int br_mst_set_enabled(struct net_bridge *br, bool on, > + struct netlink_ext_ack *extack) > +{ > + struct net_bridge_vlan_group *vg; > + struct net_bridge_port *p; > + > + list_for_each_entry(p, &br->port_list, list) { > + vg = nbp_vlan_group(p); > + > + if (!vg->num_vlans) > + continue; > + > + NL_SET_ERR_MSG(extack, > + "MST mode can't be changed while VLANs exist"); > + return -EBUSY; > + } > + > + if (br_opt_get(br, BROPT_MST_ENABLED) == on) > + return 0; > + > + if (on) > + static_branch_enable(&br_mst_used); > + else > + static_branch_disable(&br_mst_used); > + > + br_opt_toggle(br, BROPT_MST_ENABLED, on); > + return 0; > +} Hi, I'm not actually using MST, but I ran into this code and was wondering if the static key usage is correct. The static key is global (not per-bridge), so what happens when two bridges have MST enabled and then it is disabled on one? I believe it would be disabled for both. If so, maybe use static_branch_inc() / static_branch_dec() instead? Thanks