Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbdFGThp (ORCPT ); Wed, 7 Jun 2017 15:37:45 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36543 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbdFGThm (ORCPT ); Wed, 7 Jun 2017 15:37:42 -0400 Subject: Re: [PATCH net-next 5/5] net: dsa: mv88e6xxx: do not purge a VTU entry To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20170606205631.22880-1-vivien.didelot@savoirfairelinux.com> <20170606205631.22880-6-vivien.didelot@savoirfairelinux.com> From: Florian Fainelli Message-ID: Date: Wed, 7 Jun 2017 12:37:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170606205631.22880-6-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2066 Lines: 65 On 06/06/2017 01:56 PM, Vivien Didelot wrote: > The mv88e6xxx driver currently tries to be smart and remove by itself a > VLAN entry from the VTU when the driven switch sees no user ports as > members of the VLAN. > > This is bad in a multi-chip switch fabric, since a chip in between > others may have no bridge port members, but still needs to be aware of > the VID in order to correctly pass frames in the data path. > > Remove the code purging a VTU entry when updating a port membership. In that case the switch sitting between two other chips and passing traffic would still have at least two of its DSA ports be part of a VTU entry, right? So could not we just do .... > > Signed-off-by: Vivien Didelot > --- > drivers/net/dsa/mv88e6xxx/chip.c | 15 +-------------- > 1 file changed, 1 insertion(+), 14 deletions(-) > > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c > index 522f023bb17e..64c0f88f9e79 100644 > --- a/drivers/net/dsa/mv88e6xxx/chip.c > +++ b/drivers/net/dsa/mv88e6xxx/chip.c > @@ -1325,9 +1325,8 @@ static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port, > static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip, > int port, u16 vid) > { > - struct dsa_switch *ds = chip->ds; > struct mv88e6xxx_vtu_entry vlan; > - int i, err; > + int err; > > err = mv88e6xxx_vtu_get(chip, vid, &vlan, false); > if (err) > @@ -1339,18 +1338,6 @@ static int _mv88e6xxx_port_vlan_del(struct mv88e6xxx_chip *chip, > > vlan.member[port] = GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER; > > - /* keep the VLAN unless all ports are excluded */ > - vlan.valid = false; > - for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) { > - if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i)) > - continue; ... break the loop here? > - > - if (vlan.member[i] != GLOBAL_VTU_DATA_MEMBER_TAG_NON_MEMBER) { > - vlan.valid = true; > - break; > - } > - } > - > err = mv88e6xxx_vtu_loadpurge(chip, &vlan); > if (err) > return err; > -- Florian