Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3145824pxx; Mon, 2 Nov 2020 00:49:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHCcSojiMOYbRJNX36ZhEcVKA8CHQQuefkUNZBbmvyCcL2iy6APkkMDpNCQukkPjZ1dq/A X-Received: by 2002:a17:906:519b:: with SMTP id y27mr13428944ejk.25.1604306968169; Mon, 02 Nov 2020 00:49:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604306968; cv=none; d=google.com; s=arc-20160816; b=P7yLq1dGA2TRKxbJz++bNfXAyJ5yT1xKU/iivs+ufoztgn3pqP6yz02GUieDrgDKkg AfT9PxL7iK7APckhwoYLjTYUPkC5niJCa4WzdHLIcVYmj9elx5k9XhOUttaHYoBCpHIx ya48I2ZEj/LsAIcpgiysGNfKX2sKlkxOseWOGWRDi9MVQCrCHOwIj/BflRiishT1LPcf DZX/XF6+ybWzyOZBiL6EGtuJU8YDfoLzvAIs0RlRIpxbDLKZpyDVMZ8nnWP8pRB5oZuS wmh+ClfcB4WSlgxRzHBKLj2+UZpG77s/5nOWl6/rTJourlCUYHtEj34at3fw4pJ5wj8x 1v3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hk/DSlnA73ybqUogbGKkrI6hVClmoG+Nh+o1/M3MyyA=; b=dmJ0YhhrIeKWCVNQTlNbfx/V9Gs39GDmwug7N3m9J4camS+W6+XDaWgScMg90sqiEw U950pNakTxQO+FzMT/mfhz36s6PykcFbCum5WFVaF1O/ztvGQfe7LgiuqeuWpQwaun+v 2sQ/q2tLwBAr+qoMa6BJIlPHugeAOSCRcRnNeaEiRWHrcCg4lgm+FsvoMEqIy7oCXeT+ +scpnB98UyfBPsQMOJnZ61J+BndVzkLysAb/10/UNDwNt1ABwKiBm5prK7aNDRlSxkt+ Et9W0oZsWbQrMaBtrxS/5kJRZ/23Rx+IwvWjX5R5tAK5KmMXwdeoI9ffMYFhm1xuPy/U Mtsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb38si9883340ejc.555.2020.11.02.00.49.04; Mon, 02 Nov 2020 00:49:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728236AbgKBIrZ (ORCPT + 99 others); Mon, 2 Nov 2020 03:47:25 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:49287 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728230AbgKBIrZ (ORCPT ); Mon, 2 Nov 2020 03:47:25 -0500 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 83E55240016; Mon, 2 Nov 2020 08:47:20 +0000 (UTC) Date: Mon, 2 Nov 2020 09:47:20 +0100 From: Alexandre Belloni To: Vladimir Oltean Cc: Microchip Linux Driver Support , Claudiu Manoil , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/7] net: mscc: ocelot: use the pvid of zero when bridged with vlan_filtering=0 Message-ID: <20201102084720.GA7761@piout.net> References: <20201031102916.667619-1-vladimir.oltean@nxp.com> <20201031102916.667619-2-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031102916.667619-2-vladimir.oltean@nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 31/10/2020 12:29:10+0200, Vladimir Oltean wrote: > Currently, mscc_ocelot ports configure pvid=0 in standalone mode, and > inherit the pvid from the bridge when one is present. > > When the bridge has vlan_filtering=0, the software semantics are that > packets should be received regardless of whether there's a pvid > configured on the ingress port or not. However, ocelot does not observe > those semantics today. > > Moreover, changing the PVID is also a problem with vlan_filtering=0. > We are privately remapping the VID of FDB, MDB entries to the port's > PVID when those are VLAN-unaware (i.e. when the VID of these entries > comes to us as 0). But we have no logic of adjusting that remapping when > the user changes the pvid and vlan_filtering is 0. So stale entries > would be left behind, and untagged traffic will stop matching on them. > > And even if we were to solve that, there's an even bigger problem. If > swp0 has pvid 1, and swp1 has pvid 2, and both are under a vlan_filtering=0 > bridge, they should be able to forward traffic between one another. > However, with ocelot they wouldn't do that. > > The simplest way of fixing this is to never configure the pvid based on > what the bridge is asking for, when vlan_filtering is 0. Only if there > was a VLAN that the bridge couldn't mangle, that we could use as pvid.... > So, turns out, there's 0 just for that. And for a reason: IEEE > 802.1Q-2018, page 247, Table 9-2-Reserved VID values says: > > The null VID. Indicates that the tag header contains only > priority information; no VID is present in the frame. > This VID value shall not be configured as a PVID or a member > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > of a VID Set, or configured in any FDB entry, or used in any > Management operation. > > So, aren't we doing exactly what 802.1Q says not to? Well, in a way, but > what we're doing here is just driver-level bookkeeping, all for the > better. The fact that we're using a pvid of 0 is not observable behavior > from the outside world: the network stack does not see the classified > VLAN that the switch uses, in vlan_filtering=0 mode. And we're also more > consistent with the standalone mode now. > IIRC, we are using pvid 1 because else bridging breaks when CONFIG_VLAN_8021Q is not enabled. Did you test that configuration? -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com