Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp216587pxb; Mon, 13 Sep 2021 17:24:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHdmfncjDiUdgFNvl4JETAvLtSAVAE+ddqCMxm+bXR2vHacAFYzIckbEs8bcKK+7eOmHwZ X-Received: by 2002:a50:f1d9:: with SMTP id y25mr16326963edl.116.1631579049672; Mon, 13 Sep 2021 17:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579049; cv=none; d=google.com; s=arc-20160816; b=BP5InE/J8KX70nlcYuk30/V1KdcK0IjWZZtpV/8A9GeQpSn8N8+A3zzk4LpGs/Mdn2 Wd3MzRJAIFdUO2qer6zVpY9eT5NJynRN8cyL0O2XMKt43LNbwF/tDmpllay3FuIvqiW/ 62LnAW3wKJL9iRyxzVp5JAlcgbrNyQ+aEQOdLPIGMMVfD6ytv4jIXnOwTrhrEerTDuXs NtWwZ/bzASwVMurpqBZHKzPyXFomKDfTOpV/KSIkp/5Hzjy+WKwcrw4vFsGnWr560gkZ SRezRFwNBpEZi1fYeMBH/rgYj8dRKdhB4XJKAqtSxOsbu3tRd0782c+WzY2/TvayOXjg 7MAg== 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=TTXgxvLuSSHguXz+qs0CLlsc8BSwM+cgfB1XF7Rz4pQ=; b=0RTmG7opVsBJSQrSqHRTjKH9z8uREdd/e8FFrMqqG1UomPjwP8khMWMBAyP5Y5j6KA n4g8+rNQcI6frNmB7vOvZXjzdng+GSAjwZ8fam6hdXLE6yHKoPfniUYe5/eyNdmSXvho vfQxoc1deozfuurbj+aT3xUhIdHVmICM4p++7eSzYZkb/XTq0bCnqOglf0C7EtPnQY8l 1F+M5M2Ms3h28x1CCovpXbqUZKI/VBrYrMiIjNU8GtZgUd4WKVxGU2L5w8/Ew7iC4cie h9MNVudpHKu0IkvpjQFKUAc0pzWGTLvbiel2Xx6wD5yAG0tOJdVQvtXHuOpebIrd2mM7 VXgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YjR6aRVq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hg10si5666281ejc.344.2021.09.13.17.23.46; Mon, 13 Sep 2021 17:24:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YjR6aRVq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1344877AbhIMOJ2 (ORCPT + 99 others); Mon, 13 Sep 2021 10:09:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:54576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343528AbhIMOGX (ORCPT ); Mon, 13 Sep 2021 10:06:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0EC156108B; Mon, 13 Sep 2021 13:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540400; bh=q3rCfB7IrXTS6ulzY3Nh8iMhXm8CPN7pceV1pi1BASY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YjR6aRVq0lFvZyBs8VQ6PJWJQhuAFqoddztfuL2W6AktUkns5GPHDegTM1LDMY8fZ psTJFcTcH4paUhL1QK7UYb+5vVqFIjLCHrH+E2SJAzYanJkPEx4BArARQeLz0PLdFE GDLjblA+7ZlrUd12jgFP75+JSo/sMzSXqo6LDVzo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , "David S. Miller" , Sasha Levin Subject: [PATCH 5.13 160/300] net: dsa: dont disable multicast flooding to the CPU even without an IGMP querier Date: Mon, 13 Sep 2021 15:13:41 +0200 Message-Id: <20210913131114.815116126@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean [ Upstream commit c73c57081b3d59aa99093fbedced32ea02620cd3 ] Commit 08cc83cc7fd8 ("net: dsa: add support for BRIDGE_MROUTER attribute") added an option for users to turn off multicast flooding towards the CPU if they turn off the IGMP querier on a bridge which already has enslaved ports (echo 0 > /sys/class/net/br0/bridge/multicast_router). And commit a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") simply papered over that issue, because it moved the decision to flood the CPU with multicast (or not) from the DSA core down to individual drivers, instead of taking a more radical position then. The truth is that disabling multicast flooding to the CPU is simply something we are not prepared to do now, if at all. Some reasons: - ICMP6 neighbor solicitation messages are unregistered multicast packets as far as the bridge is concerned. So if we stop flooding multicast, the outside world cannot ping the bridge device's IPv6 link-local address. - There might be foreign interfaces bridged with our DSA switch ports (sending a packet towards the host does not necessarily equal termination, but maybe software forwarding). So if there is no one interested in that multicast traffic in the local network stack, that doesn't mean nobody is. - PTP over L4 (IPv4, IPv6) is multicast, but is unregistered as far as the bridge is concerned. This should reach the CPU port. - The switch driver might not do FDB partitioning. And since we don't even bother to do more fine-grained flood disabling (such as "disable flooding _from_port_N_ towards the CPU port" as opposed to "disable flooding _from_any_port_ towards the CPU port"), this breaks standalone ports, or even multiple bridges where one has an IGMP querier and one doesn't. Reverting the logic makes all of the above work. Fixes: a8b659e7ff75 ("net: dsa: act as passthrough for bridge port flags") Fixes: 08cc83cc7fd8 ("net: dsa: add support for BRIDGE_MROUTER attribute") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/b53/b53_common.c | 10 ---------- drivers/net/dsa/b53/b53_priv.h | 2 -- drivers/net/dsa/bcm_sf2.c | 1 - drivers/net/dsa/mv88e6xxx/chip.c | 18 ------------------ include/net/dsa.h | 2 -- net/dsa/dsa_priv.h | 2 -- net/dsa/port.c | 11 ----------- net/dsa/slave.c | 6 ------ 8 files changed, 52 deletions(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 3ca6b394dd5f..54b273d85861 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1993,15 +1993,6 @@ int b53_br_flags(struct dsa_switch *ds, int port, } EXPORT_SYMBOL(b53_br_flags); -int b53_set_mrouter(struct dsa_switch *ds, int port, bool mrouter, - struct netlink_ext_ack *extack) -{ - b53_port_set_mcast_flood(ds->priv, port, mrouter); - - return 0; -} -EXPORT_SYMBOL(b53_set_mrouter); - static bool b53_possible_cpu_port(struct dsa_switch *ds, int port) { /* Broadcom switches will accept enabling Broadcom tags on the @@ -2245,7 +2236,6 @@ static const struct dsa_switch_ops b53_switch_ops = { .port_bridge_leave = b53_br_leave, .port_pre_bridge_flags = b53_br_flags_pre, .port_bridge_flags = b53_br_flags, - .port_set_mrouter = b53_set_mrouter, .port_stp_state_set = b53_br_set_stp_state, .port_fast_age = b53_br_fast_age, .port_vlan_filtering = b53_vlan_filtering, diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index 82700a5714c1..9bf8319342b0 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h @@ -328,8 +328,6 @@ int b53_br_flags_pre(struct dsa_switch *ds, int port, int b53_br_flags(struct dsa_switch *ds, int port, struct switchdev_brport_flags flags, struct netlink_ext_ack *extack); -int b53_set_mrouter(struct dsa_switch *ds, int port, bool mrouter, - struct netlink_ext_ack *extack); int b53_setup_devlink_resources(struct dsa_switch *ds); void b53_port_event(struct dsa_switch *ds, int port); void b53_phylink_validate(struct dsa_switch *ds, int port, diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 3b018fcf4412..6ce9ec1283e0 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -1199,7 +1199,6 @@ static const struct dsa_switch_ops bcm_sf2_ops = { .port_pre_bridge_flags = b53_br_flags_pre, .port_bridge_flags = b53_br_flags, .port_stp_state_set = b53_br_set_stp_state, - .port_set_mrouter = b53_set_mrouter, .port_fast_age = b53_br_fast_age, .port_vlan_filtering = b53_vlan_filtering, .port_vlan_add = b53_vlan_add, diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 272b0535d946..111a6d5985da 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -5781,23 +5781,6 @@ out: return err; } -static int mv88e6xxx_port_set_mrouter(struct dsa_switch *ds, int port, - bool mrouter, - struct netlink_ext_ack *extack) -{ - struct mv88e6xxx_chip *chip = ds->priv; - int err; - - if (!chip->info->ops->port_set_mcast_flood) - return -EOPNOTSUPP; - - mv88e6xxx_reg_lock(chip); - err = chip->info->ops->port_set_mcast_flood(chip, port, mrouter); - mv88e6xxx_reg_unlock(chip); - - return err; -} - static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds, struct net_device *lag, struct netdev_lag_upper_info *info) @@ -6099,7 +6082,6 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = { .port_bridge_leave = mv88e6xxx_port_bridge_leave, .port_pre_bridge_flags = mv88e6xxx_port_pre_bridge_flags, .port_bridge_flags = mv88e6xxx_port_bridge_flags, - .port_set_mrouter = mv88e6xxx_port_set_mrouter, .port_stp_state_set = mv88e6xxx_port_stp_state_set, .port_fast_age = mv88e6xxx_port_fast_age, .port_vlan_filtering = mv88e6xxx_port_vlan_filtering, diff --git a/include/net/dsa.h b/include/net/dsa.h index e1a2610a0e06..f91317d2df9d 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -643,8 +643,6 @@ struct dsa_switch_ops { int (*port_bridge_flags)(struct dsa_switch *ds, int port, struct switchdev_brport_flags flags, struct netlink_ext_ack *extack); - int (*port_set_mrouter)(struct dsa_switch *ds, int port, bool mrouter, - struct netlink_ext_ack *extack); /* * VLAN support diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 92282de54230..1bf602f30ce4 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -211,8 +211,6 @@ int dsa_port_pre_bridge_flags(const struct dsa_port *dp, int dsa_port_bridge_flags(const struct dsa_port *dp, struct switchdev_brport_flags flags, struct netlink_ext_ack *extack); -int dsa_port_mrouter(struct dsa_port *dp, bool mrouter, - struct netlink_ext_ack *extack); int dsa_port_vlan_add(struct dsa_port *dp, const struct switchdev_obj_port_vlan *vlan, struct netlink_ext_ack *extack); diff --git a/net/dsa/port.c b/net/dsa/port.c index fad55372e461..c3ffbd41331a 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -545,17 +545,6 @@ int dsa_port_bridge_flags(const struct dsa_port *dp, return ds->ops->port_bridge_flags(ds, dp->index, flags, extack); } -int dsa_port_mrouter(struct dsa_port *dp, bool mrouter, - struct netlink_ext_ack *extack) -{ - struct dsa_switch *ds = dp->ds; - - if (!ds->ops->port_set_mrouter) - return -EOPNOTSUPP; - - return ds->ops->port_set_mrouter(ds, dp->index, mrouter, extack); -} - int dsa_port_mtu_change(struct dsa_port *dp, int new_mtu, bool propagate_upstream) { diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d4756b920108..5882159137ea 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -311,12 +311,6 @@ static int dsa_slave_port_attr_set(struct net_device *dev, ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, extack); break; - case SWITCHDEV_ATTR_ID_BRIDGE_MROUTER: - if (!dsa_port_offloads_bridge(dp, attr->orig_dev)) - return -EOPNOTSUPP; - - ret = dsa_port_mrouter(dp->cpu_dp, attr->u.mrouter, extack); - break; default: ret = -EOPNOTSUPP; break; -- 2.30.2