84. 82599 ixgbe_get_vf_queue Include Extra Information Tests¶
84.1. Description¶
VF can get following information in ixgbe driver:
- Get the TC’s configured by PF for a given VF.
- Get the User priority to TC mapping information for a given VF.
84.2. Prerequisites¶
Hardware: Ixgbe connect tester to pf with cable.
software: dpdk: http://dpdk.org/git/dpdk scapy: http://www.secdev.org/projects/scapy/
bind the pf to dpdk driver:
./usertools/dpdk-devbind.py -b igb_uio 05:00.0
the mac address of 05:00.0 is 00:00:00:00:01:00
create 1 vf from pf:
echo 1 >/sys/bus/pci/devices/0000:05:00.0/max_vfs
Detach VF from the host, bind them to pci-stub driver:
modprobe pci-stub
using lspci -nn|grep -i ethernet got VF device id “8086 10ed”, then:
echo "8086 10ed" > /sys/bus/pci/drivers/pci-stub/new_id echo "0000:05:10.0" > /sys/bus/pci/drivers/ixgbevf/unbind echo "0000:05:10.0" > /sys/bus/pci/drivers/pci-stub/bind
Lauch the VM with the VF PCI passthrough:
taskset -c 2-5 qemu-system-x86_64 \ -enable-kvm -m 8192 -smp cores=4,sockets=1 -cpu host -name dpdk1-vm1 \ -drive file=/home/VM/centOS7_1.img \ -device pci-assign,host=05:10.0 \ -netdev tap,id=ipvm1,ifname=tap3,script=/etc/qemu-ifup -device rtl8139,netdev=ipvm1,id=net0,mac=00:00:00:00:00:01 \ -localtime -vnc :2 -daemonize
login VM, get VF’s mac adress is 2e:ae:7f:16:6f:e7
84.3. Test case 1: DPDK PF, kernel VF, enable DCB mode with TC=4¶
start the testpmd on PF:
./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=4 --txq=4 --nb-cores=16 testpmd> port stop 0 testpmd> port config 0 dcb vt on 4 pfc off testpmd> port start 0
check if VF port is linked. if vf port is down, up the port:
ifconfig eth0 up
then you can see VF information in PF side:
PMD: VF 0: enabling multicast promiscuous PMD: VF 0: disabling multicast promiscuous
check VF’s queue number:
ethtool -S eth0
there is 1 tx queue and 4 rx queues which equals TC number.
send packet from tester to VF:
pkt1 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=0, vlan=0)/IP()/Raw('x'*20) pkt2 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=1, vlan=0)/IP()/Raw('x'*20) pkt3 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=2, vlan=0)/IP()/Raw('x'*20) pkt4 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=3, vlan=0)/IP()/Raw('x'*20) pkt5 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=4, vlan=0)/IP()/Raw('x'*20) pkt6 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=5, vlan=0)/IP()/Raw('x'*20) pkt7 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=6, vlan=0)/IP()/Raw('x'*20) pkt8 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=7, vlan=0)/IP()/Raw('x'*20) pkt9 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/Dot1Q(prio=0, vlan=1)/IP()/Raw('x'*20) pkt10 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/IP()/Raw('x'*20)
check the packets with different User Priority mapping to TC:
ethtool -S eth0
check the NIC statistics to check the packets increasing of different rx queue. pkt1 to queue 0, pkt2 to queue 1, pkt3 to queue 2, pkt4 to queue 3, pkt5-pkt8 to queue 0, VF can’t get pkt9, pkt10 to queue 0.
84.4. Test case 2: DPDK PF, kernel VF, disable DCB mode¶
start the testpmd on PF:
./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 1ffff -n 4 -- -i --rxq=2 --txq=2 --nb-cores=16
check if VF port is linked. if vf port is down, up the port:
ifconfig eth0 up
if vf port is still down, reload the ixgbevf driver:
rmmod ixgbevf modprobe ixgbevf
then you can see VF information in PF side:
PMD: VF 0: enabling multicast promiscuous PMD: VF 0: disabling multicast promiscuous
set vlan insert to vf:
set vf vlan insert 0 0 1
check VF’s queue number:
ethtool -S eth0
there is 2 tx queues and 2 rx queues as default number.
send packet from tester to VF:
pkt1 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/IP()/Raw('x'*20) pkt2 = Ether(dst="2e:ae:7f:16:6f:e7", src="00:02:00:00:00:01")/IP(src="192.168.0.1", dst="192.168.0.3")/UDP(sport=23,dport=24)/Raw('x'*20)
check the NIC statistics to verify the different packets mapping to different queues according RSS rule:
ethtool -S eth0
send 100 pkt1 to VF, all the packets received by queue 0, then, send 100 pkt2 to VF, all the packets received by queue 1.