[dts] [PATCH V1] tests/vf_daemon: add vf jumbo frame test for ixgbe
Jiaqi Min
jiaqix.min at intel.com
Wed Feb 19 09:03:18 CET 2020
add ixgbe vf jumbo frame test case
Signed-off-by: Jiaqi Min <jiaqix.min at intel.com>
---
conf/vf_daemon.cfg | 44 +++++++++++++++++++++++++++++++
tests/TestSuite_vf_daemon.py | 51 ++++++++++++++++++++++++++++++++++++
2 files changed, 95 insertions(+)
create mode 100644 conf/vf_daemon.cfg
diff --git a/conf/vf_daemon.cfg b/conf/vf_daemon.cfg
new file mode 100644
index 0000000..fe762f8
--- /dev/null
+++ b/conf/vf_daemon.cfg
@@ -0,0 +1,44 @@
+# Configuration sample: sriov_kvm.cfg
+[vm0]
+cpu =
+ model=host,number=4,cpupin=5 6 7 8;
+disk =
+ file=/storage/vm-image/vm0.img,opt_format=qcow2,opt_if=virtio,opt_index=0,opt_media=disk;
+mem =
+ size=10250;
+login =
+ user=root,password=tester;
+# net option is not necessary for libvirt, comment out below 2 lines if using libvirt
+net =
+ type=nic,opt_vlan=0;
+ type=user,opt_vlan=0;
+qga =
+ enable=yes;
+# vnc option is not supported by libvirt yet, comment out below 2 lines if using libvirt
+vnc =
+ displayNum=1;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
+daemon =
+ enable=yes;
+
+[vm1]
+cpu =
+ model=host,number=4,cpupin=14 15 16 17;
+disk =
+ file=/storage/vm-image/vm0.img_copy.img,opt_format=qcow2,opt_if=virtio,opt_index=0,opt_media=disk;
+mem =
+ size=10250;
+login =
+ user=root,password=tester;
+# net option is not necessary for libvirt, comment out below 2 lines if using libvirt
+net =
+ type=nic,opt_vlan=0;
+ type=user,opt_vlan=0;
+qga =
+ enable=yes;
+# vnc option is not supported by libvirt yet, comment out below 2 lines if using libvirt
+vnc =
+ displayNum=2;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
+daemon =
+ enable=yes;
diff --git a/tests/TestSuite_vf_daemon.py b/tests/TestSuite_vf_daemon.py
index b91de9e..f01f1db 100644
--- a/tests/TestSuite_vf_daemon.py
+++ b/tests/TestSuite_vf_daemon.py
@@ -705,6 +705,57 @@ class TestVfDaemon(TestCase):
self.vm0_testpmd.execute_cmd('vlan set strip off 0')
self.vm0_testpmd.execute_cmd('vlan set filter off 0')
+ def test_ixgbe_vf_jumboframe(self):
+ """
+ Enable jumbo frame for VF by configuring DPDK PF.
+ """
+ self.tester.send_expect("ifconfig %s mtu 9000" % self.tester_intf, "#")
+ self.check_vf_link_status()
+ time.sleep(10)
+ self.vf0_mac = self.vm0_testpmd.get_port_mac(0)
+
+ self.vm0_testpmd.execute_cmd('set verbose 1')
+ self.vm0_testpmd.execute_cmd('start')
+ pktsize = random.randint(1500, 9000)
+ out = self.send_and_pmdout(self.vf0_mac, 0, pktsize)
+ self.vm0_testpmd.execute_cmd('stop')
+ self.verify("received" not in out,
+ "Failed to receive this length packet!!!")
+
+ self.vm0_testpmd.execute_cmd('port stop all')
+ self.vm0_testpmd.execute_cmd('port config mtu 0 %s' % (pktsize+100))
+ self.vm0_testpmd.execute_cmd('port start all')
+ self.vm0_testpmd.execute_cmd('start')
+ out = self.send_and_pmdout(self.vf0_mac, 0, pktsize)
+ self.vm0_testpmd.execute_cmd('stop')
+ self.verify("received" in out,
+ "Failed to receive this length packet!!!")
+
+ self.vm0_testpmd.execute_cmd('start')
+ out = self.send_and_pmdout(self.vf0_mac, 0, pktsize+200)
+ self.vm0_testpmd.execute_cmd('stop')
+ self.verify("received" not in out,
+ "Failed to receive this length packet!!!")
+
+ self.vm0_testpmd.quit()
+ self.vm0_testpmd.start_testpmd(VM_CORES_MASK, '--port-topology=chained')
+ self.vm0_testpmd.execute_cmd('set verbose 1')
+ self.vm0_testpmd.execute_cmd('start')
+ out = self.send_and_pmdout(self.vf0_mac, 0, pktsize)
+ self.vm0_testpmd.execute_cmd('stop')
+ self.verify("received" in out,
+ "Failed to receive this length packet!!!")
+
+ self.vm0_testpmd.execute_cmd('start')
+ out = self.send_and_pmdout(self.vf0_mac, 0, pktsize+200)
+ self.vm0_testpmd.execute_cmd('stop')
+ self.verify("received" not in out,
+ "Failed to receive this length packet!!!")
+
+ self.vm0_testpmd.quit()
+ self.dut_testpmd.quit()
+ self.tester.send_expect("ifconfig %s mtu 1500" % self.tester_intf, "#")
+
def test_stats_show_clear(self):
"""
Show and clear statistics for a VF from PF
--
2.17.1
More information about the dts
mailing list