Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1866389pxb; Mon, 13 Sep 2021 07:12:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1cbusVIXBm/ucHlNoL2dNct+cvikgvxAIKQFa09MA+dpQ3WhnNZ5lO/aZ2KRMi52xeyRJ X-Received: by 2002:a05:6638:34a6:: with SMTP id t38mr10107966jal.19.1631542333610; Mon, 13 Sep 2021 07:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631542333; cv=none; d=google.com; s=arc-20160816; b=mX6UglGJku+jMgA+HA7xLMg3FXkz9FHohfs0OM97sVgO40PqAHck8KL7zwWw06HN0l gNLitLixZlKTntlJbMNMdWH0hMXOtiPv18ehI9xCJT3tuWv5bJfNLFGm1V/rxBF6M07O jvApKhZipaa+JGyql6j4n4L0rLB0scZk0AZjdWelhTAyOAOenWHlxV7Q4sxSlyFIY3Gz SLERCg50ih1u28X5pAf5xCBbcFvWDqvXWNeMO9OYo1aahor9d2QzrocK8KZBVBtWHpY8 DZo44NRFdZeZJUoNcQgQAny5Y7vXJZhxkgU/1k0CuuDYuardTcm4ZmWfslEvhw7WlD8b vfMg== 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=55F+6FSRbtbhp3tksxQKh2uKWjJNfMbPanK3xDRrv8Q=; b=L2Sdnkj9zWn6vi5+0y1HCeD1EFkcQa1bXSEaJEstHcMcWXrjPz4ovLv0rv9yTt+uU4 xxDxqkMM8rfabslZDXjTuK0kwTHh8HX3W4Wn+M8GOPS/L070m66XDMafY/8aNMkOtpYi pdXFe+/aN95WHVNEnYuyDZ5dz5rtZDx+0I2nyfQ0d6whai7YhuKXt26p8K3Q5DuqQY5L uJiEvJXxvX5O2tFXCRTSMyt3W4eZUxFE+D+lalex5JPfti3VswFTZVCarzt1pJnxvMVS wCkJyWhuaNav4m8s0sb5cIargR/tKL8bBBPV7/TQAIYrgBU3lsfCveNEsQco1jDp+1wI 4ZEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Idrxu0jR; 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 m18si8054135jav.88.2021.09.13.07.11.56; Mon, 13 Sep 2021 07:12:13 -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=Idrxu0jR; 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 S244444AbhIMOL1 (ORCPT + 99 others); Mon, 13 Sep 2021 10:11:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:59950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344133AbhIMOIs (ORCPT ); Mon, 13 Sep 2021 10:08:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 990D261AA2; Mon, 13 Sep 2021 13:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540455; bh=UvVF3j4X+xXETbok8u/4s1MDRHDWjHsC09kHp45zvuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Idrxu0jRin2zNhi6ZT8Q/26wk+TMbxcSvZKbVHm7SNbU7Tj/LPWNlu4f9d4/kVEGx 6aCjeD8UZSdl+x/CGu3xXlrOSd7TxTxiExSRQgfkd6mpWA1uD3SRSND0Y0fJhBiWn1 7KjCRVaWTy1xZ7Gh+86M9R6AW2U5YjMDYHFUyylA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DENG Qingfang , Vladimir Oltean , "David S. Miller" , Sasha Levin Subject: [PATCH 5.13 158/300] net: dsa: stop syncing the bridge mcast_router attribute at join time Date: Mon, 13 Sep 2021 15:13:39 +0200 Message-Id: <20210913131114.745013188@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 7df4e7449489d82cee6813dccbb4ae4f3f26ef7b ] Qingfang points out that when a bridge with the default settings is created and a port joins it: ip link add br0 type bridge ip link set swp0 master br0 DSA calls br_multicast_router() on the bridge to see if the br0 device is a multicast router port, and if it is, it enables multicast flooding to the CPU port, otherwise it disables it. If we look through the multicast_router_show() sysfs or at the IFLA_BR_MCAST_ROUTER netlink attribute, we see that the default mrouter attribute for the bridge device is "1" (MDB_RTR_TYPE_TEMP_QUERY). However, br_multicast_router() will return "0" (MDB_RTR_TYPE_DISABLED), because an mrouter port in the MDB_RTR_TYPE_TEMP_QUERY state may not be actually _active_ until it receives an actual IGMP query. So, the br_multicast_router() function should really have been called br_multicast_router_active() perhaps. When/if an IGMP query is received, the bridge device will transition via br_multicast_mark_router() into the active state until the ip4_mc_router_timer expires after an multicast_querier_interval. Of course, this does not happen if the bridge is created with an mcast_router attribute of "2" (MDB_RTR_TYPE_PERM). The point is that in lack of any IGMP query messages, and in the default bridge configuration, unregistered multicast packets will not be able to reach the CPU port through flooding, and this breaks many use cases (most obviously, IPv6 ND, with its ICMP6 neighbor solicitation multicast messages). Leave the multicast flooding setting towards the CPU port down to a driver level decision. Fixes: 010e269f91be ("net: dsa: sync up switchdev objects and port attributes when joining the bridge") Reported-by: DENG Qingfang Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/dsa/port.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/net/dsa/port.c b/net/dsa/port.c index 6379d66a6bb3..fad55372e461 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -186,10 +186,6 @@ static int dsa_port_switchdev_sync(struct dsa_port *dp, if (err && err != -EOPNOTSUPP) return err; - err = dsa_port_mrouter(dp->cpu_dp, br_multicast_router(br), extack); - if (err && err != -EOPNOTSUPP) - return err; - err = dsa_port_ageing_time(dp, br_get_ageing_time(br)); if (err && err != -EOPNOTSUPP) return err; @@ -235,12 +231,6 @@ static void dsa_port_switchdev_unsync(struct dsa_port *dp) /* VLAN filtering is handled by dsa_switch_bridge_leave */ - /* Some drivers treat the notification for having a local multicast - * router by allowing multicast to be flooded to the CPU, so we should - * allow this in standalone mode too. - */ - dsa_port_mrouter(dp->cpu_dp, true, NULL); - /* Ageing time may be global to the switch chip, so don't change it * here because we have no good reason (or value) to change it to. */ -- 2.30.2