Message ID | 20220718025447.13287-1-weiyuanx.li@intel.com (mailing list archive) |
---|---|
State | Superseded |
Headers | |
Series | [V1,01/12] tests/kernelpf_iavf: update dts code for dpdk csum change | |
Commit Message
diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py index d7d17ac4..57944770 100644 --- a/tests/TestSuite_kernelpf_iavf.py +++ b/tests/TestSuite_kernelpf_iavf.py @@ -75,6 +75,14 @@ class TestKernelpfIavf(TestCase): self.flag = "vf-vlan-pruning" self.default_stats = self.dut.get_priv_flags_state(self.host_intf, self.flag) + def ip_link_set(self, host_intf=None, cmd=None, port=None, types=None, value=0): + if host_intf is None or cmd is None or port is None or types is None: + return + set_command = f"ip link set {host_intf} {cmd} {port} {types} {value}" + out = self.dut.send_expect(set_command, "# ") + if "RTNETLINK answers: Invalid argument" in out: + self.dut.send_expect(set_command, "# ") + def set_up(self): if self.running_case == "test_vf_mac_filter": @@ -120,6 +128,22 @@ class TestKernelpfIavf(TestCase): "ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# " ) + if self.running_case == "test_vf_tso": + self.host_intf_0 = self.dut.ports_info[self.used_dut_port]["intf"] + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="trust", + value="on", + ) + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="spoofchk", + value="off", + ) try: for port in self.sriov_vfs_port: @@ -656,9 +680,10 @@ class TestKernelpfIavf(TestCase): self.tester.scapy_foreground() time.sleep(5) self.start_tcpdump(self.tester_intf) + vf_mac = "00:01:23:45:67:80" pkt = ( - 'sendp([Ether(dst="%s")/IP(chksum=0x1234)/TCP(flags=0x10,chksum=0x1234)/' - 'Raw(RandString(5214))], iface="%s")' % (self.vf_mac, self.tester_intf) + 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IP(chksum=0x1234)/TCP(flags=0x10,chksum=0x1234)/' + 'Raw(RandString(5214))], iface="%s")' % (vf_mac, self.tester_intf) ) self.tester.scapy_append(pkt) self.tester.scapy_execute() @@ -927,6 +952,23 @@ class TestKernelpfIavf(TestCase): self.destroy_vm_env() self.dut.send_expect("ip link set dev %s vf 0 trust off" % self.host_intf, "# ") + if self.running_case == "test_vf_tso": + self.host_intf_0 = self.dut.ports_info[self.used_dut_port]["intf"] + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="trust", + value="off", + ) + self.ip_link_set( + host_intf=self.host_intf_0, + cmd="vf", + port=0, + types="spoofchk", + value="on", + ) + def tear_down_all(self): """ When the case of this test suite finished, the environment should