From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 680E6C433F5 for ; Tue, 15 Feb 2022 13:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236432AbiBONfQ (ORCPT ); Tue, 15 Feb 2022 08:35:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiBONfP (ORCPT ); Tue, 15 Feb 2022 08:35:15 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E7BF106CAA; Tue, 15 Feb 2022 05:35:05 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DFBE05C02F4; Tue, 15 Feb 2022 08:35:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 15 Feb 2022 08:35:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date: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; bh=MqEd8VO3pWd8SQKjx AoofoUTvP3sevVVpQLDzXC7wFE=; b=Pz+oyQxsNY3rMYGN2rUE8Q/ggVHBOL389 VPPg6q4vxv1/NB5s1IFK6IvK2F+gN0mYWxciGiORo9QCBfL0QKdQYw8zpwcLA/Rm ylmUHvu1g2dUrtWoV+1lgT7RRyTZQ6azCc9MdwAHuZ2wc2cf+kHZUa7mTSBFp+GR QsPA1yuwLoOjlRAtIGlBJ77vnBKyhZjXKLdDhOq4hnyWxikoK+2Gt629AWMdWIpM 0eYF6pV/gVz+TWla6ocFX0uQmny1P6BLnzxpoYsrgC8UPFQglhULmRvQgznaKB8z SFDnWqphhZyOYmCap08dwCoA1V+6OIdYcfiMgqv6g6xVbGJ1V2t3A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrjeeggdehvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudehleet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Feb 2022 08:35:00 -0500 (EST) Date: Tue, 15 Feb 2022 15:34:56 +0200 From: Ido Schimmel To: Oleksandr Mazur Cc: netdev@vger.kernel.org, Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Jakub Kicinski , bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled Message-ID: References: <20220211131426.5433-1-oleksandr.mazur@plvision.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211131426.5433-1-oleksandr.mazur@plvision.eu> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Feb 11, 2022 at 03:14:26PM +0200, Oleksandr Mazur wrote: > Whenever bridge driver hits the max capacity of MDBs, it disables > the MC processing (by setting corresponding bridge option), but never > notifies switchdev about such change (the notifiers are called only upon > explicit setting of this option, through the registered netlink interface). > > This could lead to situation when Software MDB processing gets disabled, > but this event never gets offloaded to the underlying Hardware. > > Fix this by adding a notify message in such case. > > Signed-off-by: Oleksandr Mazur > --- > net/bridge/br_multicast.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c > index de2409889489..d53c08906bc8 100644 > --- a/net/bridge/br_multicast.c > +++ b/net/bridge/br_multicast.c > @@ -82,6 +82,9 @@ static void br_multicast_find_del_pg(struct net_bridge *br, > struct net_bridge_port_group *pg); > static void __br_multicast_stop(struct net_bridge_mcast *brmctx); > > +static int br_mc_disabled_update(struct net_device *dev, bool value, > + struct netlink_ext_ack *extack); > + > static struct net_bridge_port_group * > br_sg_port_find(struct net_bridge *br, > struct net_bridge_port_group_sg_key *sg_p) > @@ -1156,6 +1159,8 @@ struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br, > return mp; > > if (atomic_read(&br->mdb_hash_tbl.nelems) >= br->hash_max) { > + err = br_mc_disabled_update(br->dev, false, NULL); > + WARN_ON(err && err != -EOPNOTSUPP); What is the purpose of the WARN_ON()? There are a lot of operations that can fail in rollback paths, but we never WARN_ON() there I suggest: br_mc_disabled_update(br->dev, false, NULL); > br_opt_toggle(br, BROPT_MULTICAST_ENABLED, false); > return ERR_PTR(-E2BIG); > } > -- > 2.17.1 >