Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp123672pxb; Tue, 15 Feb 2022 06:48:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7f+x6mFH0ZZSus9zH6+Tq8jxux87BB3zm+GsuNiBBV4uhkuACb7pFeOvfV3OMnWRaTRon X-Received: by 2002:a17:906:2811:: with SMTP id r17mr3276139ejc.31.1644936537065; Tue, 15 Feb 2022 06:48:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644936537; cv=none; d=google.com; s=arc-20160816; b=Bnxyr1OXAW1Kestk3Xq6s3GaqkbWAfqxCrm2WqqjP9Mjotd+eC/NJj1PyXF0SNcc5D t8HB5xK+VpAh0qPOPprdjOvJidg7S9vEfyH8GQgANq49QDIH0Fh8ObsYzlcY5kn2btv6 n2iPzYqdO/BxZXjHIYbcPHrBR7wtYbLrsRUwzeeCk2qHzV7dh3YWFwGc+N8Rx2FBV0yP DAH8l1RpKNW7YQAVB1ITuO8cys9iq5i7hY5U+2RU8FLgPuFVj3OGDITe9E1Oc/9HPDR6 ze1SlTvBQNrRfcm0Ni13ztBtQWGEisaCV1pVBV9EmlNbrcRd0Xg+wlF9l7iDAAUucndl 67zw== 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:dkim-signature; bh=MqEd8VO3pWd8SQKjxAoofoUTvP3sevVVpQLDzXC7wFE=; b=sB8KtwvxUvWfuEnrdyUkcu7/PN79hF1aTd8djJxPILE0jNI4d5viP7JRcby3Xh3kUt PtUkAMGWCNw4FP9JBqtAyFSQKPnO/65I9ciXDLG5t4pbU09ET1YJjcqVs3L9xzumvbuz 2lPBBuHF+CRC0JuycHIbl5BtJZRQgEqiFortn32z/wx/3Mh0HyfIO0ZMIiBWnq31KoAT aG/Rgg4/Yl2up4+M7UThA/IgGBRiYfvE8GWEbO71VEF9tND92MmmEuKhC3dreHv90tOi +hf+MjPRCgjT4e27QWGGdyy3b0JmNCW4i3rLfV/KdLkqnOrFGYL4kFRVyg1nBMQ8gs6z +RfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Pz+oyQxs; 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 g9si14332014edz.440.2022.02.15.06.48.33; Tue, 15 Feb 2022 06:48:57 -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=fm2 header.b=Pz+oyQxs; 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 S238303AbiBONfR (ORCPT + 99 others); Tue, 15 Feb 2022 08:35:17 -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> 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,T_SCC_BODY_TEXT_LINE 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 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 >