163. VLAN Ethertype Config Tests¶
163.1. Description¶
for single vlan default TPID is 0x8100. for QinQ, default S-Tag+C-Tag VLAN TPIDs 0x88A8 + 0x8100. This feature implemented configuration of VLAN ethertype TPID, such as changing single vlan TPID 0x8100 to 0xA100, or changing QinQ “0x88A8 + 0x8100” to “0x9100+0xA100” or “0x8100+0x8100”
163.2. Prerequisites¶
- Hardware: one Intel® Ethernet 700 Series NIC (4x 10G or 2x10G or 2x40G or 1x10G)
- Software:
- Assuming that DUT ports
0
and1
are connected to the tester’s portA
andB
.
163.3. Test Case 1: change VLAN TPID¶
Start testpmd, start in rxonly mode:
./dpdk-testpmd -c 0xff -n 4 -- -i --portmask=0x3 testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start
Change VLAN TPIDs to 0xA100:
testpmd> vlan set outer tpid 0xA100 0
send a packet with VLAN TPIDs = 0xA100, verify it can be recognized as vlan packet.
163.4. Test Case 2: test VLAN filtering on/off¶
Start testpmd, setup vlan filter on, start in mac forwarding mode:
./dpdk-testpmd -c 0xff -n 4 -- -i --portmask=0x3 testpmd> set fwd mac testpmd> vlan set filter on 0 testpmd> start Due to the kernel enables Qinq and cannot be closed, the DPDK only add `extend on` to make the VLAN filter work normally. Therefore, if the i40e firmware version >= 8.4 the DPDK can only add `extend on` to make the VLAN filter work normally: testpmd> vlan set extend on 0
Send 1 packet with VLAN TPID 0xA100 and VLAN Tag 16 on port
A
, Verify that the VLAN packet cannot be received in portB
.Disable vlan filtering on port
0
:testpmd> vlan set filter off 0
Change VLAN TPIDs to 0xA100 on port
0
:testpmd> vlan set outer tpid 0xA100 0
Send 1 packet with VLAN TPID 0xA100 and VLAN Tag 16 on port
A
, Verify that the VLAN packet can be received in portB
and TPID is 0xA100
163.5. Test Case 3: test adding VLAN Tag Identifier with changing VLAN TPID¶
start testpmd, setup vlan filter on, start in mac forwarding mode:
./dpdk-testpmd -c 0xff -n 4 -- -i --portmask=0x3 testpmd> set fwd mac testpmd> vlan set filter on 0 testpmd> vlan set strip off 0 testpmd> start Due to the kernel enables Qinq and cannot be closed, the DPDK only add `extend on` to make the VLAN filter work normally. Therefore, if the i40e firmware version >= 8.4 the DPDK can only add `extend on` to make the VLAN filter work normally: testpmd> vlan set extend on 0
Add a VLAN Tag Identifier
16
on port0
:testpmd> rx_vlan add 16 0
Send 1 packet with the VLAN Tag 16 on port
A
, Verify that the VLAN packet can be received in portB
and TPID is 0x8100Change VLAN TPID to 0xA100 on port
0
:testpmd> vlan set outer tpid 0xA100 0
Send 1 packet with VLAN TPID 0xA100 and VLAN Tag 16 on port
A
, Verify that the VLAN packet can be received in portB
and TPID is 0xA100Remove the VLAN Tag Identifier
16
on port0
:testpmd> rx_vlan rm 16 0
Send 1 packet with VLAN TPID 0xA100 and VLAN Tag 16 on port
A
, Verify that the VLAN packet cannot be received in portB
.
163.6. Test Case 4: test VLAN header stripping with changing VLAN TPID¶
start testpmd, setup vlan filter off, vlan strip on, start in mac forwarding mode:
./dpdk-testpmd -c 0xff -n 4 -- -i --portmask=0x3 testpmd> set fwd mac testpmd> vlan set filter off 0 testpmd> vlan set strip on 0 testpmd> start
Send 1 packet with the VLAN Tag 16 on port
A
. Verify that packet received in portB
without VLAN Tag IdentifierChange VLAN TPID to 0xA100 on port
0
:testpmd> vlan set outer tpid 0xA100 0
Send 1 packet with VLAN TPID 0xA100 and VLAN Tag 16 on port
A
. Verify that packet received in portB
without VLAN Tag IdentifierDisable vlan header stripping on port
0
:testpmd> vlan set strip off 0
Send 1 packet with VLAN TPID 0xA100 and VLAN Tag 16 on port
A
. Verify that packet received in portB
with VLAN Tag Identifier.
163.7. Test Case 5: test VLAN header inserting with changing VLAN TPID¶
start testpmd, enable vlan packet forwarding, start in mac forwarding mode:
./dpdk-testpmd -c 0xff -n 4 -- -i --portmask=0x3 testpmd> set fwd mac testpmd> vlan set filter off 0 testpmd> vlan set strip off 0 testpmd> start
Insert VLAN Tag Identifier
16
on port1
:testpmd> tx_vlan set 1 16
Send 1 packet without VLAN Tag Identifier on port
A
. Verify that packet received in portB
with VLAN Tag Identifier 16 and TPID is 0x8100Change VLAN TPID to 0xA100 on port
1
:testpmd> vlan set outer tpid 0xA100 1
Send 1 packet without VLAN Tag Identifier on port
A
. Verify that packet received in portB
with VLAN Tag Identifier 16 and TPID is 0xA100.Delete the VLAN Tag Identifier
16
on port1
:testpmd> tx_vlan reset 1
Send 1 packet without VLAN Tag Identifier on port
A
. Verify that packet received in portB
without VLAN Tag Identifier 16.
163.8. Test Case 6: Change S-Tag and C-Tag within QinQ¶
Start testpmd, enable QinQ, start in rxonly mode:
./dpdk-testpmd -c 0xff -n 4 -- -i --portmask=0x3 testpmd> vlan set qinq on 0 testpmd> set fwd rxonly testpmd> set verbose 1 testpmd> start
Change S-Tag+C-Tag VLAN TPIDs to 0x88A8 + 0x8100:
testpmd> vlan set outer tpid 0x88A8 0 testpmd> vlan set inner tpid 0x8100 0
Send a packet with set S-Tag+C-Tag VLAN TPIDs to 0x88A8 + 0x8100. verify it can be recognized as qinq packet.
Change S-Tag+C-Tag VLAN TPIDs to 0x9100+0xA100:
testpmd> vlan set outer tpid 0x9100 0 testpmd> vlan set inner tpid 0xA100 0
Send a packet with set S-Tag+C-Tag VLAN TPIDs to 0x9100+0xA100. verify it can be recognized as qinq packet.
Change S-Tag+C-Tag VLAN TPIDs to 0x8100+0x8100:
testpmd> vlan set outer tpid 0x8100 0 testpmd> vlan set inner tpid 0x8100 0
Send a packet with set S-Tag+C-Tag VLAN TPIDs to 0x8100+0x8100. verify it can be recognized as qinq packet.
Note:
Send packet with specific S-Tag+C-Tag VLAN TPID:
wrpcap("qinq.pcap",[Ether(dst="68:05:CA:3A:2E:58")/Dot1Q(type=0x8100,vlan=16)/Dot1Q(type=0x8100,vlan=1006)/IP(src="192.168.0.1", dst="192.168.0.2")])
.- hexedit qinq.pcap; change tpid field, “ctrl+w” to save, “ctrl+x” to exit.
- sendp(rdpcap(“qinq.pcap”), iface=”ens260f0”).
Send packet with specific VLAN TPID:
wrpcap("vlan.pcap",[Ether(dst="68:05:CA:3A:2E:58")/Dot1Q(type=0x8100,vlan=16)/IP(src="192.168.0.1", dst="192.168.0.2")])
.- hexedit vlan.pcap; change tpid field, “ctrl+w” to save, “ctrl+x” to exit.
- sendp(rdpcap(“vlan.pcap”), iface=”ens260f0”).