Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp647903iog; Thu, 30 Jun 2022 07:38:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1voDzmT31yj57D04kC/rj6JnTJGt+5YyqPblXpQouI+FY9wmeDYVGgYXQeS/GqG9OP5Qr5f X-Received: by 2002:a05:6402:104a:b0:435:c7cd:11dc with SMTP id e10-20020a056402104a00b00435c7cd11dcmr12132137edu.335.1656599886553; Thu, 30 Jun 2022 07:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656599886; cv=none; d=google.com; s=arc-20160816; b=uSB0DK03MBMUqHSkydEFGVzj/SEOgzyPjroitDmVqVbTYvYcAqyU6SgdSbhk3r09gL rQ3vv+EJQ+IzoGPcowybNrWEFeroRiRCCHeF6kDgtA4iSN8zuNBGqaqiqanKaJIO4bI4 ale7Z6lmuCgYNi0lBfl46lZ4QdQVsT8P8wbEAqaguYuuozBUBUSDlg7DBSxIwTwUP0fn i/BU/wP810efBL1lIEqom2UPYSMcJbpLhNTnPUNqdgwbxByTkFQruxDByCMttybz7ceW 6bs1hIz/Dp1b/v3QY2FY2Ayg0gSFss1TfeD2HbC3GfDtcTCzoj/RqjjIvNERUTBEVdsY NIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wi68CjP+QjdImBeGfaFdKaXt9eBUlaab3rhiBQr2tzY=; b=p2zO/JU9ZqPrxpvCHXsoOPW2XS1vA1eWeIGQ9s78ApNuFphgYUN8U5Pj3MVG9dXeG/ YUFmSSCLPulAu+Zkxo74iA3DwIc1Q9HfGyMNdWqSzs8roNKET4gCpm52TI9ee002iR1+ BbypY+zBxfMXS/rG2dZ0pTAOEBQ/OB8z1iC/Ov/nZTIcli3ttLckm9zdRBk/cO7RNYZG gDppH9na+vtwZqA+cNHSPbVbSXj+LNX6v0I4adYSpAifLBMssjPy9jqprV2ixW2ZbFNx df9veXHSAjSinOWYMHUZkm7PDTFzTmh9YBG2Z/JpXDKqPBCt9PyMlFpMu8qjk/xrRKyF 9low== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I9HT6rEJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg27-20020a170907971b00b0071d7fe5f8bbsi4568044ejc.584.2022.06.30.07.37.41; Thu, 30 Jun 2022 07:38:06 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=I9HT6rEJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236580AbiF3OKg (ORCPT + 99 others); Thu, 30 Jun 2022 10:10:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236538AbiF3OKH (ORCPT ); Thu, 30 Jun 2022 10:10:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7396973933; Thu, 30 Jun 2022 06:55:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8D9EB82AF4; Thu, 30 Jun 2022 13:55:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15524C34115; Thu, 30 Jun 2022 13:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597317; bh=LHDZBHb1Ju9Gni/2nZSD3+bfE3hqybPTDwnADGAhS1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I9HT6rEJIwljjrWI8IVyDKyEfFPomR4fztabl3ohlsqe83j7u18Z7G/zOj+/eJEGL kzKXrQL/Kn+9ib2dbF33M8EADYIPFBz30BNNheNP9vZnXIq5hDjsNhmExli9glJIyU na6VClQX+s9E6ZDxp2t4aSJWSRigTUbWj1Hq1vXs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Vladimir Oltean Subject: [PATCH 5.15 27/28] net: mscc: ocelot: allow unregistered IP multicast flooding to CPU Date: Thu, 30 Jun 2022 15:47:23 +0200 Message-Id: <20220630133233.728720736@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133232.926711493@linuxfoundation.org> References: <20220630133232.926711493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Vladimir Oltean Since commit 4cf35a2b627a ("net: mscc: ocelot: fix broken IP multicast flooding") from v5.12, unregistered IP multicast flooding is configurable in the ocelot driver for bridged ports. However, by writing 0 to the PGID_MCIPV4 and PGID_MCIPV6 port masks at initialization time, the CPU port module, for which ocelot_port_set_mcast_flood() is not called, will have unknown IP multicast flooding disabled. This makes it impossible for an application such as smcroute to work properly, since all IP multicast traffic received on a standalone port is treated as unregistered (and dropped). Starting with commit 7569459a52c9 ("net: dsa: manage flooding on the CPU ports"), the limitation above has been lifted, because when standalone ports become IFF_PROMISC or IFF_ALLMULTI, ocelot_port_set_mcast_flood() would be called on the CPU port module, so unregistered multicast is flooded to the CPU on an as-needed basis. But between v5.12 and v5.18, IP multicast flooding to the CPU has remained broken, promiscuous or not. Delete the inexplicable premature optimization of clearing PGID_MCIPV4 and PGID_MCIPV6 as part of the init sequence, and allow unregistered IP multicast to be flooded freely to the CPU port module. Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support") Cc: stable@kernel.org Signed-off-by: Vladimir Oltean Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mscc/ocelot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -2208,9 +2208,13 @@ int ocelot_init(struct ocelot *ocelot) ANA_PGID_PGID, PGID_MC); ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID, PGID_MCIPV4); + ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID, PGID_MCIPV6); + ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), ANA_PGID_PGID, PGID_BC); - ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV4); - ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV6); /* Allow manual injection via DEVCPU_QS registers, and byte swap these * registers endianness.