From patchwork Wed Jan 30 00:55:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 1033089 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bozcLa2q"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43q4jC1R9dz9sBZ for ; Wed, 30 Jan 2019 11:57:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbfA3A5q (ORCPT ); Tue, 29 Jan 2019 19:57:46 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40177 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727439AbfA3A5q (ORCPT ); Tue, 29 Jan 2019 19:57:46 -0500 Received: by mail-pg1-f193.google.com with SMTP id z10so9555057pgp.7 for ; Tue, 29 Jan 2019 16:57:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2XfaqNvxmWeTxoRx+TsIdruJWgBwUM7qJmr/YgLEjjo=; b=bozcLa2qCcqHH+vEyBgfv9egXSvHrbcUKDtL4mm2Pjv6HmeDAkYR6cFFoACBU8gEes 5at3jqpiSkBrbt99eb9n9TjWgs4X+j0Ql1M/KNYZqNWdfSSxfocagdcnYCVDfPX/eWIX TPv/hD/6UT8i2hhzdzagvM6ConoFzw7EK+jdbtET6QIOGxp6R5YDuIsDl4Zx+aIAMRyn GOXXbdgM+ylUVpIvQPeyLvBZmzOARf7YoO+tK8oI9UJIgsLKPebQaGmeqieNvMgXQZeF PbO5YnMQKroEjQwYw5j6zdWFxaJ4Qjow1LYij/hHM9qmSlblGV7/obF9enDIUAhMI+9z aDvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2XfaqNvxmWeTxoRx+TsIdruJWgBwUM7qJmr/YgLEjjo=; b=OJ47Rdb2/qGVgxe8+34gsWPZ8sf5RVtQvK2qa/D1HGhCmeDjIFW8Cy5Un4trZz5bpJ 9AfhXolAer0NOAD3//BnCcPT//hiEP3MjN+WJ4zpZ9A1WXDXWbff5rbNQZUJDGg7MoP/ 7pFxryq7UIGz/tBqvAJz78957mjJeuQLLSlEjnEfeGxkJnW6cis/IUbQWa5UZ/LVjZvY smD8OhNsaQkiL7KfGbeCx70MDgsb5VoE09Lrt8RBioIfk0soucKSU94CybuQnreg7Idl SDPn+E8j1BPFmEBSS9vt1U5+65drd2fyC2XtIVkhbvDNEiFrcpvlHBriSvBBfKXsn+f3 hUtQ== X-Gm-Message-State: AJcUuke71tvHRVZB/AIwO+AMWKgyuNfHUaLxuq+mjNvdlPZlLyZw4lVp jd7U1oEbD9ewys3VT/PQ6oKRsGYD X-Google-Smtp-Source: ALg8bN7gDgMiZdBk3T8UCRl1fAg2yiE9ApLYPiaFR9iFUyn8O7MqIKzQPVjEaPDoJ/EwkSb1Ho/WXQ== X-Received: by 2002:a63:ee0e:: with SMTP id e14mr25108078pgi.8.1548809864154; Tue, 29 Jan 2019 16:57:44 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id v191sm67837137pgb.77.2019.01.29.16.57.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 16:57:42 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , andrew@lunn.ch, vivien.didelot@gmail.com, davem@davemloft.net, idosch@mellanox.com, jiri@mellanox.com, ilias.apalodimas@linaro.org, ivan.khoronzhuk@linaro.org, roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com Subject: [PATCH net-next v2 00/12] net: dsa: management mode for bcm_sf2 Date: Tue, 29 Jan 2019 16:55:36 -0800 Message-Id: <20190130005548.2212-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi all, This patch series does a number of things in order to enable management mode for bcm_sf2 (which could be easily extended to b53 with proper testing later on). In order to get there, there were several use cases that did not work correctly and that needed to be fixed: - VLAN devices on top of switch ports not being member of a bridge, with other switch ports being bridged, with the bridge having VLAN filtering enabled. - lack of multicast filtering by default on network ports which should be happening in order for the non-bridged DSA ports to behave strictly as Ethernet NICs with proper filering. This is accomplished by hooking a ndo_set_rx_mode() function to the DSA slave network devices - when VLAN filtering is globally enabled on the switch (because at least a bridge device requires it), then we also need to make sure that when doing multicast over VLAN devices over a switch port (bridged or not) happens with the correct MDB address *and* VID Hopefully the changes to net/8021q and net/bridge are deemed acceptable. The Broadcom switches have a switch-wide VLAN filtering attribute, which is why we must always make sure there is a valid VLAN entry even for switch ports which are not part of a bridge device, yet there is at least one bridge device spanning the switch. Multicast flooding can be done on a per-port basis, including for the CPU/management port, however, once multicast reception is enabled on the CPU port, it bypasses the ARL (Address Resolution Logic), so we receive *all* multicast, even from ports do not have their flooding bit set, which is unfortunate. This is the reason why we must continue adding enough HOST_MDB notifications to let the CPU port continue to filter multicast traffic. Changes in v2: - correctly propagate return from br_mc_disabled_update() called from br_multicast_toggle - dropped changes to VLAN and bridge code that was pushing multicast entries with VID and instead refuse disabling multicast snooping in b53 when there is another standalone port, or that there are other bridged ports with multicast snooping enabled Florian Fainelli (12): net: bridge: multicast: Propagate br_mc_disabled_update() return net: dsa: b53: Fix default VLAN ID net: dsa: b53: Properly account for VLAN filtering net: systemport: Fix reception of BPDUs net: dsa: b53: Define registers for IGMP snooping net: dsa: b53: Add support for MDB net: dsa: Add ability to program multicast filter for CPU port net: dsa: Add ndo_vlan_rx_{add,kill}_vid implementation net: dsa: Make VLAN filtering use DSA notifiers net: dsa: Wire up multicast IGMP snooping attribute notification net: dsa: b53: Add support for toggling IGMP snooping net: dsa: bcm_sf2: Enable management mode drivers/net/dsa/b53/b53_common.c | 257 +++++++++++++++++++-- drivers/net/dsa/b53/b53_priv.h | 14 +- drivers/net/dsa/b53/b53_regs.h | 22 ++ drivers/net/dsa/bcm_sf2.c | 56 +++-- drivers/net/dsa/bcm_sf2_regs.h | 5 + drivers/net/ethernet/broadcom/bcmsysport.c | 4 + include/net/dsa.h | 2 + net/bridge/br_multicast.c | 23 +- net/dsa/dsa_priv.h | 22 +- net/dsa/port.c | 42 +++- net/dsa/slave.c | 107 ++++++++- net/dsa/switch.c | 57 +++++ 12 files changed, 552 insertions(+), 59 deletions(-)