netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hongbo Wang <hongbo.wang@nxp.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
	"allan.nielsen@microchip.com" <allan.nielsen@microchip.com>,
	Po Liu <po.liu@nxp.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>, Mingkai Hu <mingkai.hu@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 v3 2/2] net: dsa: ocelot: Add support for QinQ Operation
Date: Thu, 23 Jul 2020 04:05:10 +0000	[thread overview]
Message-ID: <VI1PR04MB5103C716DBB73ABA72D8131EE1760@VI1PR04MB5103.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200722125352.qbllow6pm6za5pq4@skbuf>

> Instead of writing a long email, let me just say this.
> I ran your commands on 2 random network cards (not ocelot/felix ports).
> They don't produce the same results as you. In fact, no frame with VLAN
> 111 C-TAG is forwarded (or received) at all by the bridge, not to mention that
> no VLAN 1000 S-TAG is pushed on egress.
> 
> 
> Have you tried playing with these commands?
> 
> ip link add dev br0 type bridge vlan_filtering 1 vlan_protocol 802.1ad ip link
> set eth0 master br0 ip link set eth1 master br0 bridge vlan add dev eth0 vid
> 100 pvid bridge vlan add dev eth1 vid 100
> 
> They produce the same output as yours, but have the benefit of using the
> network stack's abstractions and not glue between the 802.1q and the bridge
> module, hidden in the network driver.
> 
> I am sending the following packet towards eth0:
> 
> 00:04:9f:05:f4:ad > 00:01:02:03:04:05, ethertype 802.1Q (0x8100), length
> 102: \
>         vlan 111, p 0, ethertype IPv4, 10.0.111.1 > 10.0.111.3: \
>         ICMP echo request, id 63493, seq 991, length 64
> 
> and collecting it on the partner of eth1 as follows:
> 
> 00:04:9f:05:f4:ad > 00:01:02:03:04:05, ethertype 802.1Q-QinQ (0x88a8),
> length 106: \
>         vlan 100, p 0, ethertype 802.1Q, vlan 111, p 0, ethertype IPv4, \
>         10.0.111.1 > 10.0.111.3: ICMP echo request, id 63493, seq 991,
> length 64
> 
> Thanks,
> -Vladimir

Hi Vladimir,
  the command " ip link add dev br0 type bridge vlan_filtering 1 vlan_protocol 
802.1ad " will influence all ports within the bridge, it will enable all ports vlan_filtering
flag and 802.1ad mode, if ocelot port enable vlan_filtering, it will set VLAN_AWARE_ENA
and VLAN_POP_CNT(1), the code is in ocelot_port_vlan_filtering in ocelot.c. it will
pop one tag from ingress frame, it's not my need, so I don't set vlan_filtering.

  If enable vlan_filtering, it needs enable VCAP ES0 push double VLAN tag, the code
is in another patch, it's based on VCAP ES0 related code, I will post it after ES0 code
be accepted.

  In this case, I only want the egress port(swp1) in QinQ mode, the mode will change swp1's
REW_TAG value, don't need swp0 enter QinQ mode, another issue is that if use " ip link add dev 
br0 type bridge ...", it can't pass proto to port driver, in dsa_slave_vlan_rx_add_vid, it will walk
into here:
		ret = br_vlan_get_info(dp->bridge_dev, vid, &info);
		if (ret == 0)  // ret is 0
			return -EBUSY;
so I use "ip link add link swp1 name swp1.111 type vlan protocol 802.1ad id 111" to enable only
port swp1's QinQ mode.

Thanks,
hongbo



      reply	other threads:[~2020-07-23  4:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 10:31 [PATCH v3 0/2] Add 802.1AD protocol support for dsa switch and ocelot driver hongbo.wang
2020-07-22 10:31 ` [PATCH v3 1/2] net: dsa: Add protocol support for 802.1AD when adding or deleting vlan for dsa switch and port hongbo.wang
2020-07-22 10:32 ` [PATCH v3 2/2] net: dsa: ocelot: Add support for QinQ Operation hongbo.wang
2020-07-22 12:53   ` Vladimir Oltean
2020-07-23  4:05     ` Hongbo Wang [this message]

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=VI1PR04MB5103C716DBB73ABA72D8131EE1760@VI1PR04MB5103.eurprd04.prod.outlook.com \
    --to=hongbo.wang@nxp.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=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=olteanv@gmail.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;
as well as URLs for NNTP newsgroup(s).