public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Hongbo Wang <hongbo.wang@nxp.com>
Cc: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	Po Liu <po.liu@nxp.com>, Mingkai Hu <mingkai.hu@nxp.com>,
	"allan.nielsen@microchip.com" <allan.nielsen@microchip.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Alexandru Marginean <alexandru.marginean@nxp.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Leo Li <leoyang.li@nxp.com>, "andrew@lunn.ch" <andrew@lunn.ch>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"jiri@resnulli.us" <jiri@resnulli.us>,
	"idosch@idosch.org" <idosch@idosch.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"vinicius.gomes@intel.com" <vinicius.gomes@intel.com>,
	"nikolay@cumulusnetworks.com" <nikolay@cumulusnetworks.com>,
	"roopa@cumulusnetworks.com" <roopa@cumulusnetworks.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"horatiu.vultur@microchip.com" <horatiu.vultur@microchip.com>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"ivecera@redhat.com" <ivecera@redhat.com>
Subject: Re: [EXT] Re: [PATCH v6 3/3] net: dsa: ocelot: Add support for QinQ Operation
Date: Fri, 9 Oct 2020 15:29:47 +0300	[thread overview]
Message-ID: <20201009122947.nvhye4hvcha3tljh@skbuf> (raw)
In-Reply-To: <VI1PR04MB567793A76FE2EBECFC6D8E76E13E0@VI1PR04MB5677.eurprd04.prod.outlook.com>

Hi Hongbo,

On Thu, Sep 17, 2020 at 02:37:59AM +0000, Hongbo Wang wrote:
> > On Wed, Sep 16, 2020 at 10:28:38AM +0000, Hongbo Wang wrote:
> > > Hi Vladimir,
> > >
> > > if swp0 connects with customer, and swp1 connects with ISP, According
> > > to the VSC99599_1_00_TS.pdf, swp0 and swp1 will have different
> > > VLAN_POP_CNT && VLAN_AWARE_ENA,
> > >
> > > swp0 should set VLAN_CFG.VLAN_POP_CNT=0 &&
> > VLAN_CFG.VLAN_AWARE_ENA=0
> > > swp1 should set VLAN_CFG.VLAN_POP_CNT=1 &&
> > VLAN_CFG.VLAN_AWARE_ENA=1
> > >
> > > but when set vlan_filter=1, current code will set same value for both
> > > swp0 and swp1, for compatibility with existing code(802.1Q mode), so
> > > add devlink to set swp0 and swp1 into different modes.
> >
> > But if you make VLAN_CFG.VLAN_AWARE_ENA=0, does that mean the switch
> > will accept any 802.1ad VLAN, not only those configured in the VLAN database
> > of the bridge? Otherwise said, after running the commands above, and I send a
> > packet to swp0 having tpid:88A8 vid:101, then the bridge should not accept it.
> >
> > I might be wrong, but I thought that an 802.1ad bridge with
> > vlan_filtering=1 behaves the same as an 802.1q bridge, except that it should
> > filter VLANs using a different TPID (0x88a8 instead of 0x8100).
> > I don't think the driver, in the way you're configuring it, does that, does it?
>
> hi Vladimir,
> you can refer to "4.3.3.0.1 MAN Access Switch Example" in VSC99599_1_00_TS.pdf,
> By testing the case, if don't set VLAN_AWARE_ENA=0 for customer's port swp0,
> the Q-in-Q feature can't work well.
>
> In order to distinguish the port for customer and for ISP, I add devlink command,
> Actually, I can modify the driver config directly, not using devlink,
> but it will be not compatible with current code and user guide.

I asked this on the Microchip Support portal:

-----------------------------[cut here]-----------------------------

VLAN filtering only on specific TPID
------------------------------------

I would like to configure a port with the following behavior:
- The VLAN table should contain 802.1ad VLANs 1 and 10. VLAN ingress filtering
  should be enabled.
- An untagged frame on ingress should be classified to 802.1ad (TAG_TYPE=1)
  VLAN ID 1 (the port-based VLAN). The frame should be accepted because 802.1ad
  VLAN 1 is in the VLAN table.
- An ingress frame with 802.1Q (0x8100) header VLAN ID 100 should be classified
  to 802.1ad (TAG_TYPE=1) VLAN ID 1 (the port-based VLAN). The frame should be
  accepted because 802.1ad VLAN 1 is in the VLAN table.
- An ingress frame with 802.1ad (0x88a8) header VLAN ID 10 should be classified
  to 802.1ad (TAG_TYPE=1) VLAN ID 10. The frame should be accepted because
  802.1ad VLAN 10 is in the VLAN table.
- An ingress frame with 802.1ad (0x88a8) header VLAN ID 100 should be
  classified to 802.1ad (TAG_TYPE=1) VLAN ID 100. The frame should be dropped
  because 802.1ad VLAN 100 is not in the VLAN table.
How do I configure the switch to obtain this behavior? This is not what the
"Provider Bridges and Q-in-Q Operation" chapter in the reference manual is
explaining how to do. Instead, that chapter suggests to make
VLAN_CFG.VLAN_AWARE_ENA = 0. But I don't want to do this, because I need to be
able to drop the frames with 802.1ad VLAN ID 100 in the example above.

-----------------------------[cut here]-----------------------------

Judging from the fact that I received no answer whatsoever, I can only
deduce that offloading an 8021ad bridge, at least one that has the
semantics that Toshiaki Makita described here,
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=1a0b20b257326523ec2a6cb51dd6f26ef179eb84
is not possible with this hardware.

So I think there's little left to do here.

If it helps, I am fairly certain that the sja1105 can offer the
requested services, if you play a little bit with the TPID and TPID2
values. Maybe that's a path forward for your patches, if you still want
to add the generic support in switchdev and in DSA.

Thanks,
-Vladimir

  reply	other threads:[~2020-10-09 12:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16  9:48 [PATCH v6 0/3] Add 802.1AD protocol support for dsa switch and ocelot driver hongbo.wang
2020-09-16  9:48 ` [PATCH v6 1/3] net: dsa: Add protocol support for 802.1AD when adding or deleting vlan for dsa switch port hongbo.wang
2020-09-16  9:48 ` [PATCH v6 2/3] net: switchdev: Add VLAN protocol support for switchdev port hongbo.wang
2020-09-16  9:48 ` [PATCH v6 3/3] net: dsa: ocelot: Add support for QinQ Operation hongbo.wang
2020-09-16 10:00   ` Vladimir Oltean
2020-09-16 10:28     ` [EXT] " Hongbo Wang
2020-09-16 10:45       ` Vladimir Oltean
2020-09-17  2:37         ` Hongbo Wang
2020-10-09 12:29           ` Vladimir Oltean [this message]
2020-10-10  3:22             ` Hongbo Wang
2020-09-19  0:20 ` [PATCH v6 0/3] Add 802.1AD protocol support for dsa switch and ocelot driver David Miller
2020-09-19  0:23   ` Florian Fainelli
2020-09-21  3:05   ` [EXT] " Hongbo Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201009122947.nvhye4hvcha3tljh@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandru.marginean@nxp.com \
    --cc=allan.nielsen@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hongbo.wang@nxp.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=idosch@idosch.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingkai.hu@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=po.liu@nxp.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang_1@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox