From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04B56214E0 for ; Wed, 12 Jul 2023 16:15:11 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C4E9199E for ; Wed, 12 Jul 2023 09:14:53 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E9C8D5C00D3; Wed, 12 Jul 2023 12:14:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 12 Jul 2023 12:14:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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=fm2; t=1689178491; x=1689264891; bh=65HYPJVnC3Dun dRznANcrTpdyqqmDNHjpqvmQrnP+nU=; b=cWdEMFNEqC8Au0EfKRNw7JCCLNGo0 IvgSyrZ68knCNfzf5s0OnoYgH1jvBXnbDnjKaxA6sqqMeUu8WmngXq0qXixXAxyV X/NVxydIWUYgLwQpJaIk1ReSJAvfEEnTClrSAz2lBw15tOgk3xe0dEQaPhQj2Pgs C6fICBpUsh5Yjx1bOXiUVcxZKdGKM/I1cGZijtaRvBZGA3vT9XNBVy5FEXnZsKow hM0DkO0xgIL+4fpyed6xXIohcyyRTnGECwA2+VS7NEAPxHvAHUSqnY8+s3WF5E8b nCTjiDyue5KbagHo4iXnpuTTfJWxjU+luGOSZ+mkeEc2s9qpXGxtpBMhA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfedvgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpeehhfdtjedviefffeduuddvffegteeiieeguefgudffvdfftdefheeijedthfej keenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jul 2023 12:14:50 -0400 (EDT) Date: Wed, 12 Jul 2023 19:14:46 +0300 From: Ido Schimmel To: Kuniyuki Iwashima Cc: Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Eric W. Biederman" , Kuniyuki Iwashima , netdev@vger.kernel.org, bridge@lists.linux-foundation.org, Harry Coin Subject: Re: [PATCH v2 net] bridge: Add extack warning when enabling STP in netns. Message-ID: References: <20230712154449.6093-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712154449.6093-1-kuniyu@amazon.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Wed, Jul 12, 2023 at 08:44:49AM -0700, Kuniyuki Iwashima wrote: > When we create an L2 loop on a bridge in netns, we will see packets storm > even if STP is enabled. > > # unshare -n > # ip link add br0 type bridge > # ip link add veth0 type veth peer name veth1 > # ip link set veth0 master br0 up > # ip link set veth1 master br0 up > # ip link set br0 type bridge stp_state 1 > # ip link set br0 up > # sleep 30 > # ip -s link show br0 > 2: br0: mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 > link/ether b6:61:98:1c:1c:b5 brd ff:ff:ff:ff:ff:ff > RX: bytes packets errors dropped missed mcast > 956553768 12861249 0 0 0 12861249 <-. Keep > TX: bytes packets errors dropped carrier collsns | increasing > 1027834 11951 0 0 0 0 <-' rapidly > > This is because llc_rcv() drops all packets in non-root netns and BPDU > is dropped. > > Let's add extack warning when enabling STP in netns. > > # unshare -n > # ip link add br0 type bridge > # ip link set br0 type bridge stp_state 1 > Warning: bridge: STP does not work in non-root netns. > > Note this commit will be reverted later when we namespacify the whole LLC > infra. > > Fixes: e730c15519d0 ("[NET]: Make packet reception network namespace safe") > Suggested-by: Harry Coin > Link: https://lore.kernel.org/netdev/0f531295-e289-022d-5add-5ceffa0df9bc@quietfountain.com/ > Suggested-by: Ido Schimmel > Signed-off-by: Kuniyuki Iwashima Reviewed-by: Ido Schimmel