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=-2.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_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 59122C34056 for ; Wed, 19 Feb 2020 18:20:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C34724670 for ; Wed, 19 Feb 2020 18:20:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Db/UOrwQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbgBSSUh (ORCPT ); Wed, 19 Feb 2020 13:20:37 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42279 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgBSSUg (ORCPT ); Wed, 19 Feb 2020 13:20:36 -0500 Received: by mail-ed1-f67.google.com with SMTP id e10so30276824edv.9 for ; Wed, 19 Feb 2020 10:20:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kC+UqeLnCiuqoufeyk9YZkBLmj3ejOmQ0RPDwEyps6Y=; b=Db/UOrwQIVKvmhjtjAqqjQwo5Ur/QdcJpa9BuYBGXoMseo7sSTggYiDCPruVDO8/rL owEVKK2gHEXyJZsw+eVt8V9zSGJUpKX0iJ0/DIn5/OVzseIoT4FrTqbFA40Gdc2m1tyu gjKwoJlJvDJnQEvnAVjvvrYCMwYu6GX33iPcsd5lTwtzPM28nC8xdqWWDNVjEz+AElYA wm3pT83s/jGhTvzgtU1XiV58zH39QqFETDwvzBIN8Cq+USAnhZ8ycML9Y9pJwPUeLE5t e+2/kAGom5IvyvP07vDPYf9cZ7cNCKRkJfa1tNFRTc/db0ZLqTlXmpyFXyxLI5a3RBql GLKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=kC+UqeLnCiuqoufeyk9YZkBLmj3ejOmQ0RPDwEyps6Y=; b=Qf6UEaWSb1wEOd0Uf5VkHkYelobXerfHFCB9MOxRpLWkkIwHZMTOZLVhGN/AQX4lvI xEQTdPI1J8JOkNqO77RwfXVHa9fmzrhJvANA7/6IaHfydvXLv6AjzQV4LYfHD8slx1/E IBMCyR6dAI4h3VIq7eyRWluLXWegUazuU2Q3YAeMSErdERnCyegMvxURe/1QANuctGdH XZM21GgQ9zUtq+4bx8uUJutsMyvUUNTUDtV78+bUkQPO3yIYt5r8bylVOilBLFzL1U82 XcSVO3OHpoQGxKQD70OF2/cACso8WptzkCzswzh5BEhZB1y1G4q1iDhU70owJ/YA4mBn ca3g== X-Gm-Message-State: APjAAAX47PZPbIKChGBuzs2Kmntf/wqqBsHZYRCUkSHBElHwaK9tePrg Gr/m0nML7cTQwup2PptNeI2Ecvg3 X-Google-Smtp-Source: APXvYqwwQFR5AuDH84sagqaNQzHHpA58Xtbe0O9C3mbGKyUuhj4eqeov3i41p0/qkRQjEhxFllac3w== X-Received: by 2002:a17:906:8593:: with SMTP id v19mr24927109ejx.377.1582136434452; Wed, 19 Feb 2020 10:20:34 -0800 (PST) Received: from [10.67.49.41] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id l1sm10023edf.43.2020.02.19.10.20.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Feb 2020 10:20:33 -0800 (PST) Subject: Re: [PATCH net-next 0/3] VLANs, DSA switches and multiple bridges To: Vivien Didelot , Russell King - ARM Linux admin Cc: Andrew Lunn , Heiner Kallweit , Ido Schimmel , "David S. Miller" , Ivan Vecera , Jakub Kicinski , Jiri Pirko , netdev@vger.kernel.org References: <20200218114515.GL18808@shell.armlinux.org.uk> <20200219001737.GP25745@shell.armlinux.org.uk> <20200219034730.GE10541@lunn.ch> <20200219091900.GQ25745@shell.armlinux.org.uk> <20200219130707.GB245247@t480s.localdomain> From: Florian Fainelli Autocrypt: addr=f.fainelli@gmail.com; prefer-encrypt=mutual; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZWxsaSA8Zi5mYW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@gmail.com> Date: Wed, 19 Feb 2020 10:20:29 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200219130707.GB245247@t480s.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2/19/20 10:07 AM, Vivien Didelot wrote: > Hi Russell, > > On Wed, 19 Feb 2020 09:19:00 +0000, Russell King - ARM Linux admin wrote: >> On Wed, Feb 19, 2020 at 04:47:30AM +0100, Andrew Lunn wrote: >>> On Wed, Feb 19, 2020 at 12:17:37AM +0000, Russell King - ARM Linux admin wrote: >>>> On Tue, Feb 18, 2020 at 04:00:08PM -0800, Florian Fainelli wrote: >>>>> On 2/18/20 3:45 AM, Russell King - ARM Linux admin wrote: >>>>>> Hi, >>>>>> >>>>>> This is a repost of the previously posted RFC back in December, which >>>>>> did not get fully reviewed. I've dropped the RFC tag this time as no >>>>>> one really found anything too problematical in the RFC posting. >>>>>> >>>>>> I've been trying to configure DSA for VLANs and not having much success. >>>>>> The setup is quite simple: >>>>>> >>>>>> - The main network is untagged >>>>>> - The wifi network is a vlan tagged with id $VN running over the main >>>>>> network. >>>>>> >>>>>> I have an Armada 388 Clearfog with a PCIe wifi card which I'm trying to >>>>>> setup to provide wifi access to the vlan $VN network, while the switch >>>>>> is also part of the main network. >>>>> >>>>> Why not just revert 2ea7a679ca2abd251c1ec03f20508619707e1749 ("net: dsa: >>>>> Don't add vlans when vlan filtering is disabled")? If a driver wants to >>>>> veto the programming of VLANs while it has ports enslaved to a bridge >>>>> that does not have VLAN filtering, it should have enough information to >>>>> not do that operation. >>>> >>>> I do not have the knowledge to know whether reverting that commit >>>> would be appropriate; I do not know how the non-Marvell switches will >>>> behave with such a revert - what was the reason for the commit in >>>> the first place? >>>> >>>> The commit says: >>>> >>>> This fixes at least one corner case. There are still issues in other >>>> corners, such as when vlan_filtering is later enabled. >>>> >>>> but it doesn't say what that corner case was. So, presumably reverting >>>> it will cause a regression of whatever that corner case was... >>> >>> Yes, sorry, bad commit message. I'm not too sure, but it could of been >>> that the switch was adding the VLANs to its tables, even though it >>> should not because filtering is disabled. And i also think the default >>> VLAN was not defined at that point, it only gets defined when >>> vlan_filtering is enabled? >> >> It's been too long since I researched all these details, but I seem >> to remember that in the Linux software bridge, vlan 1 is always >> present even when vlan filtering is not enabled. >> >> Looking at br_vlan_init(): >> >> br->default_pvid = 1; >> >> and nbp_vlan_init() propagates that irrespective of the bridge vlan >> enable state to switchdev. nbp_vlan_init() is called whenever any >> interface is added to a bridge (in br_add_if()). >> >> As I believe I mentioned somewhere in the commit messages or covering >> message, for at least some of the Marvell DSA switches, it is safe to >> add VTU entries - they do not even look at the VTU when the port has >> 802.1Q disabled. Whether that is true for all Marvell's DSA switches >> I don't know without trawling every functional spec, and I was hoping >> that you guys would know. I guess I need to trawl the specs. > > Some switches like the Marvell 88E6060 don't have a VTU, so programming the > default PVID would return -EOPNOTSUPP. Switches supporting only global VLAN > filtering cannot have a VLAN filtering aware bridge as well as a non VLAN > filtering aware bridge spanning their ports at the same time. But all this > shouldn't be a problem because drivers inform the stack whether they support > ds->vlan_filtering per-port, globally or not. We should simply reject the > operation when vlan_filtering is being enabled on unsupported hardware. > > Linux bridge is the reference for the implementation of an Ethernet bridge, > if it programs VLAN entries, supported DSA hardware must do so. I'm not a > fan of having our own bridge logic in DSA, so the limitation implemented by > 2ea7a679ca2a ("net: dsa: Don't add vlans when vlan filtering is disabled") > needs to go in my opinion. Agreed. This also helps with switches who only support the creation of broadcast domains via VLANs (not the case with b53 and mv88e6xxx AFAICT they have specific egress vector controls). Because then you could put each standalone port in say, VID (4094 - port number), and once enslaved in a bridge, have them in VID 1 to maintain broadcast domains, whether the bridge has VLAN filtering or not. -- Florian