Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6120427rwl; Mon, 9 Jan 2023 04:34:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXtNAQp0J6ZrcKB2Gt7eUcP3wwE18+9ma4EmGdJ7j8BEr5FGlOt1R5ZYGX3x009yk1NumaFu X-Received: by 2002:a17:907:a28c:b0:7c1:6794:1623 with SMTP id rd12-20020a170907a28c00b007c167941623mr67607208ejc.58.1673267654414; Mon, 09 Jan 2023 04:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267654; cv=none; d=google.com; s=arc-20160816; b=cRB3P1seq070aH4iZTcun0oleVP4pbA6wQO48l0aLJSlKcCsy4+cdQMfDIFU2NCMyv 02AJ7gTGorEOLmPffdYnT0HF2FVAA0hld1YyeF3MfiIs+c+I6u92d8D42rRCUYl7qX/N law55j8zYip7AnEDcJZikmRVluwiqApIdVMSlE0QktbI+bXf6Xh6R3Ayc/heDRASfZKc YQJh5Oxu3j3U6e1hVOpUrVzVnhbhSaAYIKM0h6hzZtTAtfVDJSy3qBU3lmRTnh1MrgP4 Jdl3w58hjYc95V9udQE5+snVewthI8LdyOCJ9YIOXCSHV2LbbN77XCRpxkvwHkxAn70U f4gQ== 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=BoRrhg2qoLX8AzR5nlod213O8Dn0cuabW6bstFyKh6g=; b=RIbuBdphldFkdNLyaGwg42em40M23TN4S0cjmpmiOFwAbXNgLPaK6LHtaVkVVdhke1 Hf7ILLdLZ2KTBI85mU3NCqsb3YK4ptyjWfbwRIoAPmUnrdIxkICYI04iZXU5j6KjQb/k ls0NdizX084QC4PRe1IkhN/xklonrDA5w1i7s+CujcRUG9kDurir54yzdLbeFxv0twdZ VFbbEBAKqhA3hC9qENPe72lLuNoxN2S5M3RNLGrbnDha56Aozn8udMkyLL345/OqWi67 LTSfkgUYpYLdGTDcP0lU/a2GviUtaAvqQQewtIC/cQzSyGhc22ZKCVodGDxg+VnTCsQc 9xhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=DFepMdID; 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 qk32-20020a1709077fa000b007ada2ec1a28si9803558ejc.165.2023.01.09.04.34.01; Mon, 09 Jan 2023 04:34:14 -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=DFepMdID; 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 S236994AbjAIMUM (ORCPT + 53 others); Mon, 9 Jan 2023 07:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234538AbjAIMUJ (ORCPT ); Mon, 9 Jan 2023 07:20:09 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37D81A828; Mon, 9 Jan 2023 04:20:07 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3AF0E5C017C; Mon, 9 Jan 2023 07:20:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 09 Jan 2023 07:20:07 -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=1673266807; x=1673353207; bh=BoRrhg2qoLX8AzR5nlod213O8Dn0 cuabW6bstFyKh6g=; b=DFepMdIDoB+mlolDcbW2KqnE5pmmpY+RdAochu7RfvCA 9oc+Bv2B0P8Dg4MCtPhAY3VvbvVNwAVqI62ZqJsY5fE0bZmyJ62KC9TA2OhnxS01 InOGx5C8ZAmsKMmOJBsN4qNUud9CcI0iWUYZ+qD8plQ2AxLmmLtniJggTgFuK8mg YVFYYonVCZ2uRj3qXJ+AkeDxlA5Lr0I/2PX00UNM5cKrK/8+25ehqQ4g76akEOBV cd/l23v3UYN/q+CfUEeyGKnQrrVktiHsgbO1d9iP+5+VrT0WG7TOQuBJBBuBt1nj 6hsAQCXix7tobllTf1RJqzut1NlyA8f8Z/+geLEmUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkeeigdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpedvudefveekheeugeeftddvveefgfduieefudeifefgleekheegleegjeejgeeg hfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehiug hoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Jan 2023 07:20:05 -0500 (EST) Date: Mon, 9 Jan 2023 14:20:02 +0200 From: Ido Schimmel To: Vladimir Oltean Cc: Tobias Waldekranz , davem@davemloft.net, kuba@kernel.org, Nikolay Aleksandrov , Andrew Lunn , Vivien Didelot , Florian Fainelli , 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> <20230109100236.euq7iaaorqxrun7u@skbuf> <20230109115653.6yjijaj63n2v35lw@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230109115653.6yjijaj63n2v35lw@skbuf> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 Mon, Jan 09, 2023 at 01:56:53PM +0200, Vladimir Oltean wrote: > On Mon, Jan 09, 2023 at 01:43:46PM +0200, Ido Schimmel wrote: > > OK, thanks for confirming. Will send a patch later this week if Tobias > > won't take care of it by then. First patch will probably be [1] to make > > sure we dump the correct MST state to user space. It will also make it > > easier to show the problem and validate the fix. > > > > [1] > > diff --git a/net/bridge/br.c b/net/bridge/br.c > > index 4f5098d33a46..f02a1ad589de 100644 > > --- a/net/bridge/br.c > > +++ b/net/bridge/br.c > > @@ -286,7 +286,7 @@ int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt) > > case BR_BOOLOPT_MCAST_VLAN_SNOOPING: > > return br_opt_get(br, BROPT_MCAST_VLAN_SNOOPING_ENABLED); > > case BR_BOOLOPT_MST_ENABLE: > > - return br_opt_get(br, BROPT_MST_ENABLED); > > + return br_mst_is_enabled(br); > > Well, this did report the correct MST state despite the incorrect static > branch state, no? The users of br_mst_is_enabled(br) are broken, not > those of br_opt_get(br, BROPT_MST_ENABLED). I should have said "actual"/"effective" instead of "correct". IMO, it's better to use the same conditional in the both the data and control paths to eliminate discrepancies. Without the patch, a user will see that MST is supposedly enabled when it is actually disabled in the data path. > > Anyway, I see there's a br_mst_is_enabled() and also a br_mst_enabled()?! > One is used in the fast path and the other in the slow path. They should > probably be merged, I guess. They both exist probably because somebody > thought that the "if (!netif_is_bridge_master(dev))" test is redundant > in the fast path. The single user of br_mst_enabled() (DSA) is not affected by the bug (only the SW data path is), so I suggest making this consolidation in net-next after the bug is fixed. OK? > > > default: > > /* shouldn't be called with unsupported options */ > > WARN_ON(1); > > diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h > > index 75aff9bbf17e..7f0475f62d45 100644 > > --- a/net/bridge/br_private.h > > +++ b/net/bridge/br_private.h > > @@ -1827,7 +1827,7 @@ static inline bool br_vlan_state_allowed(u8 state, bool learn_allow) > > /* br_mst.c */ > > #ifdef CONFIG_BRIDGE_VLAN_FILTERING > > DECLARE_STATIC_KEY_FALSE(br_mst_used); > > -static inline bool br_mst_is_enabled(struct net_bridge *br) > > +static inline bool br_mst_is_enabled(const struct net_bridge *br) > > { > > return static_branch_unlikely(&br_mst_used) && > > br_opt_get(br, BROPT_MST_ENABLED); > > @@ -1845,7 +1845,7 @@ int br_mst_fill_info(struct sk_buff *skb, > > int br_mst_process(struct net_bridge_port *p, const struct nlattr *mst_attr, > > struct netlink_ext_ack *extack); > > #else > > -static inline bool br_mst_is_enabled(struct net_bridge *br) > > +static inline bool br_mst_is_enabled(const struct net_bridge *br) > > { > > return false; > > }