From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2102CC43387 for ; Wed, 16 Jan 2019 20:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D577820866 for ; Wed, 16 Jan 2019 20:03:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g4hu84Y8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732030AbfAPUDU (ORCPT ); Wed, 16 Jan 2019 15:03:20 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:40091 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731443AbfAPUDU (ORCPT ); Wed, 16 Jan 2019 15:03:20 -0500 Received: by mail-yw1-f65.google.com with SMTP id g194so2910452ywe.7 for ; Wed, 16 Jan 2019 12:03:19 -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=N02sFdMsErg91RZ2aukqkokNZBCZdRmH5NFBmQnoaBY=; b=g4hu84Y8gvEFeZ0zO2LvL42o7lNg77a/6qIeEdAC1FgwNTK9J6RaN/1bCEZRpDqs0S htOhS2AoFY/ashXG0xpLTfknyxDQWWF188p+6TvAEYWOorx46DdgO40mGdhwnJgpqVTT wJFpHCyP1N6n0rKZ3f5rE44YXIWIj8kjU9LTCs6i8oZd97m55v3wdVS472x3dLMaduXi SrcuDKa8wuBv5xTrRZotoqnLGPt8lKRE5zZ/As3zDtfBeeeEiBYKbp0UCYK7vI4NUix1 h7hMXexfYH9maHq7bBxwSzp+prX3xPyeAF4AZHRbbbqYzVnB4W6LFz3F39Q71u4jvJ2L wbOw== 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=N02sFdMsErg91RZ2aukqkokNZBCZdRmH5NFBmQnoaBY=; b=TVtWfMNgxw0ldfkK+mJu1tE8meeoPvpwTtRSEz/vqAo6V3wOsS9k6MUBnY/9qUv8BY KylqQuY9/Nwo0P38qHbjMjjthaAAQsvLi8DvTmorzx+tabvnJTM9pX+DkdQdGlrZD6Mj R5SLDRRzjKNEp/i+OffxAJJGdLR2FJVXW6qbKn7zNEdFb9AuI+/DFAL+ckK9Y5euDkv4 +d9adwetQAzNXqT3X+9q1bHRF2GsGmGr7Abh05P0W+5RHRAzLqVcmOtq7PC9nM9/flEc Bc1k3cf8LW9VX6XJn9qvsY5rKldBXVX9/bKlXvltBrjMtNukzTbwG+Vtu1/Cn5Wu5E1k Cwzw== X-Gm-Message-State: AJcUukfUwM4a/dQGSgQUoQ7MphorH1yslbUOSAAIPN81kzCTmMbY+V/r 3ltoHWIz/Kr9ocDBT2lGpgy4NCE1 X-Google-Smtp-Source: ALg8bN4aBs3Ez+MawubkelBzSHTqnjjI7y1EySGwghqqO3XxaPMWk7gkWjX/HJZE4/4a/07sD2c4Hw== X-Received: by 2002:a0d:ccd6:: with SMTP id o205mr9311075ywd.339.1547668998070; Wed, 16 Jan 2019 12:03:18 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id v128sm2475295ywf.44.2019.01.16.12.03.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 12:03:16 -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 00/14] net: dsa: management mode for bcm_sf2 Date: Wed, 16 Jan 2019 12:00:48 -0800 Message-Id: <20190116200102.2749-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. Here are some of the uses cases that were tested after this patch series (all commands are running on the device being tested) and iperf/ping/etc. should be working for/after all steps: echo "file drivers/net/dsa/b53/b53_common.c +p" > /sys/kernel/debug/dynamic_debug/control echo 8 7 4 1 > /proc/sys/kernel/printk killall udhcpc ip addr flush dev gphy ip link add dev br0 type bridge echo 1 > /sys/class/net/br0/bridge/vlan_filtering ip link set dev gphy master br0 udhcpc -i br0 ip ro add 226.94.1.1/32 dev br0 iperf -s -B 226.94.1.1 -u & vconfig add rgmii_1 100 ifconfig rgmii_1.100 192.168.100.10 ping -c 5 192.168.100.1 ip ro add 226.95.1.2/32 dev rgmii_1.100 iperf -s -B 226.95.1.2 -u & vconfig add br0 42 bridge vlan add vid 42 dev gphy bridge vlan add vid 42 dev br0 self ifconfig br0.42 192.168.42.2 ip ro add 226.96.1.3/32 dev br0.42 Florian Fainelli (14): 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: bridge: Propagate MC addresses with VID through switchdev net: vlan: Propagate MC addresses with VID through switchdev 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 | 219 ++++++++++++++++++--- 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/8021q/vlan_dev.c | 40 ++++ net/bridge/br_device.c | 55 ++++++ net/bridge/br_multicast.c | 19 +- net/dsa/dsa_priv.h | 22 ++- net/dsa/port.c | 42 ++-- net/dsa/slave.c | 107 +++++++++- net/dsa/switch.c | 57 ++++++ 14 files changed, 607 insertions(+), 57 deletions(-) -- 2.17.1