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.9 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 21D2BC43218 for ; Sun, 28 Apr 2019 18:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D93A820652 for ; Sun, 28 Apr 2019 18:47:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SnH2DUWj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbfD1Sr5 (ORCPT ); Sun, 28 Apr 2019 14:47:57 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40489 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726299AbfD1Sr5 (ORCPT ); Sun, 28 Apr 2019 14:47:57 -0400 Received: by mail-wr1-f68.google.com with SMTP id h4so12478878wre.7 for ; Sun, 28 Apr 2019 11:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=56NMSWvfMQ78aF2WTxsuWTs3eegQjA298vSLcQCSmY0=; b=SnH2DUWj8TyqjpA7+m2V1Rl2Wgx1RlXTGYOw8NaWSwE+m6B5Q7xQuOYU6gtKpLUZc/ DZ0YfPQeJhpeuHaJ9TXv0y7BQzlAUZbBm1tATf6W+/UcDCrFkICDurtfI0MhIO7UP1l3 31yi4h/s+xEi9YUAojKyfhheA5hQ7YYGOEFkY4FMDUHazGKn1JKuzB/AADFtWD8YPTm5 05JmoIzVEpMDQeB1WZzBrOyhsSmWqGjm17zPHTO8/hjdSFGCuzBqMiQmEMIUherV+4Cu ipNBElKv8137SJlb8KRliD5lOVc7AWmMJhxj9RasoXHn3jUdGM1GBFHbD0T/1GKEy0Js T/sw== 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=56NMSWvfMQ78aF2WTxsuWTs3eegQjA298vSLcQCSmY0=; b=EVZo+I10d83q7N86WAsjCRtmdeODnnSUz5l0IamxyJFhdlY6/V1GitTAFZ0WpBx/cr frASMci5weQxmiv9vMQYubtbjRpIxY61fbuhqxM4bUSviYekzlPl/xOq/X9eYtUU53gz jhk7AdIO/QYXDwiZa6x7THlt9EcxI56G0h6tenOfLpu0iMcaNDQ1pa637DzqhxMl4cJw CaBftvAqIL29WL7of1LMHw0UY1tgY2mfMps5pKI/R3zteoE2TCgzp/RiDzVljIhSO+0X nrnVzMFNAIqIY0WSxmhvYQg7EM1kGKtYYL/byqPucWwfJSHz6FiWEvbDHU2D6Zjfxywa wKmw== X-Gm-Message-State: APjAAAVA2znAGj0lzOISk2IOEAQZoyr5EQqQh7Y+2bBy9xodFXoZh4JT F9LwmIUTgHNBqp041hCaubY= X-Google-Smtp-Source: APXvYqyooOFdtfkfflnKVvm3FYf5Se05A4tqmWBAsFBWA0yhrKCYD0DpAY2G8V/5Kfx2QZXDgTTbaA== X-Received: by 2002:adf:cd90:: with SMTP id q16mr16097500wrj.75.1556477275422; Sun, 28 Apr 2019 11:47:55 -0700 (PDT) Received: from localhost.localdomain (5-12-225-227.residential.rdsnet.ro. [5.12.225.227]) by smtp.gmail.com with ESMTPSA id h5sm12254910wmf.38.2019.04.28.11.47.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Apr 2019 11:47:54 -0700 (PDT) From: Vladimir Oltean To: f.fainelli@gmail.com, vivien.didelot@gmail.com, andrew@lunn.ch, davem@davemloft.net Cc: netdev@vger.kernel.org, Vladimir Oltean Subject: [PATCH net-next 00/13] Improvements to DSA core VLAN manipulation Date: Sun, 28 Apr 2019 21:45:41 +0300 Message-Id: <20190428184554.9968-1-olteanv@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 In preparation of submitting the NXP SJA1105 driver, the Broadcom b53 and Mediatek mt7530 drivers have been found to apply some VLAN workarounds that are needed in the new driver as well. Therefore this patchset is mostly simply promoting the DSA driver workarounds for VLAN to the generic code. The b53 driver was applying a few workarounds in order to convince DSA that its vlan_filtering setting is not really per-port. This is now simply set by the driver via a DSA variable at probe time. The sja1105 driver will be a second user of this. The mt7530 was also keeping track of when the .port_vlan_filtering callback was being called. Remove the kept state from this driver and simplify dealing with vlan_filtering in the generic case. TODO: Find the best way to deal generically with the situation described below (discussion at https://lkml.org/lkml/2019/4/16/1355): > > +Segregating the switch ports in multiple bridges is supported (e.g. 2 + 2), but > > +all bridges should have the same level of VLAN awareness (either both have > > +``vlan_filtering`` 0, or both 1). Also an inevitable limitation of the fact > > +that VLAN awareness is global at the switch level is that once a bridge with > > +``vlan_filtering`` enslaves at least one switch port, the other un-bridged > > +ports are no longer available for standalone traffic termination. > > That is quite a limitation that I don't think I had fully grasped until > reading your different patches. Since enslaving ports into a bridge > comes after the network device was already made available for use, maybe > you should force the carrier down or something along those lines as soon > as a port is enslaved into a bridge with vlan_filtering=1 to make this > more predictable for the user? Vladimir Oltean (13): net: dsa: Fix pharse -> phase typo net: dsa: Store vlan_filtering as a property of dsa_port net: dsa: Be aware of switches where VLAN filtering is a global setting net: dsa: b53: Let DSA handle mismatched VLAN filtering settings net: dsa: Unset vlan_filtering when ports leave the bridge net: dsa: mt7530: Let DSA handle the unsetting of vlan_filtering net: dsa: Keep the vlan_filtering setting in dsa_switch if it's global net: dsa: Add helper function to retrieve VLAN awareness setting net: dsa: mt7530: Use the DSA vlan_filtering helper function net: dsa: Skip calling .port_vlan_filtering on no change net: dsa: b53: Let DSA call .port_vlan_filtering only when necessary net: dsa: b53: Use vlan_filtering property from dsa_switch net: dsa: Add more convenient functions for installing port VLANs drivers/net/dsa/b53/b53_common.c | 34 +++++-------- drivers/net/dsa/b53/b53_priv.h | 1 - drivers/net/dsa/mt7530.c | 20 +++----- drivers/net/dsa/mt7530.h | 1 - include/net/dsa.h | 21 ++++++++ net/dsa/dsa_priv.h | 2 + net/dsa/port.c | 85 ++++++++++++++++++++++++++++++-- net/dsa/slave.c | 24 ++------- net/dsa/switch.c | 31 +++++++++++- 9 files changed, 156 insertions(+), 63 deletions(-) -- 2.17.1