====== Driver test: VLAN loopback ====== ===== Rationale ===== iPXE expects network cards to provide transparent transmit and receive datapaths. Some network cards provide no way to disable their VLAN offload features and will always strip the VLAN tag from a received packet, reporting this tag via the receive descriptor. Drivers for such cards must use special handling to deliver the received packet directly to the appropriate VLAN device. The ''[[:cmd:vcreate]]'' command can be used to create VLAN interfaces, and the ''[[:cmd:lotest]]'' command can be used to verify correct operation of the VLAN interfaces. ===== Background ===== Refer to the basic [[:dev:drvtest:loopback|loopback test]] for background information. {{ :clipart:nic.jpeg?237x222|A network card}} ===== Test sequence ===== - Before starting, ensure that your network interface is directly connected to a second network interface on the same machine. - Boot into a version of iPXE with [[:buildcfg:VLAN_CMD]] and [[:buildcfg:LOTEST_CMD]] enabled and with support for both network interfaces. - Use ''[[:cmd:ifstat]]'' to identify the name of your network interface (hereafter assumed to be ''net0'') and the name of the second network interface (hereafter assumed to be ''net1''). - Create a VLAN interface on ''net0'' using ''%%vcreate --tag 123 net0%%'' - Create a VLAN interface on ''net1'' using ''%%vcreate --tag 123 net1%%'' - Initiate testing of the transmit datapath via the VLAN interfaces using ''%%lotest net0-123 net1-123%%''. - Verify that the packet counter displayed by ''lotest'' increases steadily and rapidly. - Abort the test using ''Ctrl-C''. - Initiate testing of the receive datapath via the VLAN interfaces using ''%%lotest net1-123 net0-123%%''. - Verify that the packet counter displayed by ''lotest'' increases steadily and rapidly. - Abort the test using ''Ctrl-C''.