From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8CD1A0C4E; Tue, 2 Nov 2021 09:12:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A492841104; Tue, 2 Nov 2021 09:12:29 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 569E64068F for ; Tue, 2 Nov 2021 09:12:28 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="218402694" X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="218402694" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 01:12:13 -0700 X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="489002955" Received: from unknown (HELO dpdk-zhaohy-t.sh.intel.com) ([10.240.183.68]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 01:12:12 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Date: Tue, 2 Nov 2021 16:11:52 +0800 Message-Id: <1635840720-90878-2-git-send-email-songx.jiale@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1635840720-90878-1-git-send-email-songx.jiale@intel.com> References: <1635840720-90878-1-git-send-email-songx.jiale@intel.com> Subject: [dts] [PATCH V2 02/10] tests/cvl_qinq: update case code for driver change X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: Jiale Song --- test_plans/cvl_qinq_test_plan.rst | 14 +++++++------- tests/TestSuite_cvl_qinq.py | 27 +++++++++++++++++++-------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/test_plans/cvl_qinq_test_plan.rst b/test_plans/cvl_qinq_test_plan.rst index 4f44150b..22efd705 100644 --- a/test_plans/cvl_qinq_test_plan.rst +++ b/test_plans/cvl_qinq_test_plan.rst @@ -71,9 +71,9 @@ Prerequisites 0000:18:00.0 'Device 159b' if=ens785f0 drv=ice unused=vfio-pci 0000:18:00.1 'Device 159b' if=ens785f1 drv=ice unused=vfio-pci -6. Enable vlan prune flag:: +6. Disable vlan prune flag:: - ethtool --set-priv-flags ens785f0 vf-vlan-prune-disable on + ethtool --set-priv-flags ens785f0 vf-vlan-pruning off 7. Generate 4 VFs on PF0(not all the VFs are used):: @@ -130,7 +130,7 @@ Prerequisites 13. For AVF QinQ test cases(10-14), recreate Generate 1 VFs on PF0, reconfig the VF then launch testpmd:: echo 0 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs - ethtool --set-priv-flags ens785f0 vf-vlan-prune-disable off + ethtool --set-priv-flags ens785f0 vf-vlan-pruning on echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs ip link set ens785f0 vf 0 mac 00:11:22:33:44:11 ip link set dev ens785f0 vf 0 spoofchk off @@ -906,9 +906,9 @@ Test case 08: vlan insertion when pvid enable Test case 09: vlan filter when pvid enable ========================================== -1. reset test environment, create vfs and disable vlan prune flag:: +1. reset test environment, create vfs and enable vlan prune flag:: - ethtool --set-priv-flags ens785f0 vf-vlan-prune-disable off + ethtool --set-priv-flags ens785f0 vf-vlan-pruning on 2. repeat Prerequisites steps from 7 to 12 @@ -1113,10 +1113,10 @@ Test case 11: Enable/Disable IAVF VLAN header stripping Test case 12: Enable/Disable IAVF VLAN header insertion ======================================================= -1. enable vf-vlan-prune-disable flag:: +1. disable vf-vlan-pruning flag:: echo 0 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs - ethtool --set-priv-flags ens785f0 vf-vlan-prune-disable on + ethtool --set-priv-flags ens785f0 vf-vlan-pruning off 2. set up test environment again:: diff --git a/tests/TestSuite_cvl_qinq.py b/tests/TestSuite_cvl_qinq.py index 39d590f6..a23aeeb3 100644 --- a/tests/TestSuite_cvl_qinq.py +++ b/tests/TestSuite_cvl_qinq.py @@ -240,6 +240,9 @@ class TestCvlQinq(TestCase): self.pf_interface = self.dut.ports_info[self.dut_ports[0]]['intf'] port = self.dut.ports_info[0]['port'] port.bind_driver() + # get priv-flags default stats + self.flag = 'vf-vlan-pruning' + self.default_stats = self.dut.get_priv_flags_state(self.pf_interface, self.flag) self.vf_flag = False self.vf0_mac = '' @@ -255,7 +258,8 @@ class TestCvlQinq(TestCase): Run before each test case. ''' self.pci_list = [] - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable on' % self.pf_interface, "#") + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s %s' % (self.pf_interface,self.flag, self.default_stats), "# ") def setup_pf_vfs_env(self, vfs_num=4): @@ -646,7 +650,8 @@ class TestCvlQinq(TestCase): 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac] pkt_list2 = ['Ether(dst="%s",type=0x8100)/Dot1Q(vlan=21,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac, 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac] - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable off' % self.pf_interface, '#') + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s on' % (self.pf_interface, self.flag), '# ') self.setup_pf_vfs_env() self.launch_testpmd(dcf_param=True) self.pmd_output.execute_cmd("vlan set filter on 1") @@ -679,7 +684,8 @@ class TestCvlQinq(TestCase): 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac] pkt_list2 = ['Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac, 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac] - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable off' % self.pf_interface, '#') + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s on' % (self.pf_interface, self.flag), '# ') self.setup_pf_vfs_env(vfs_num=1) self.launch_testpmd(vfs_num=1) self.pmd_output.execute_cmd("vlan set filter on 0") @@ -712,7 +718,8 @@ class TestCvlQinq(TestCase): """ pkt_list = ['Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac, 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac] - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable off' % self.pf_interface, '#') + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s on' % (self.pf_interface, self.flag), '# ') self.setup_pf_vfs_env(vfs_num=1) self.launch_testpmd(vfs_num=1) self.pmd_output.execute_cmd("vlan set filter on 0") @@ -746,7 +753,8 @@ class TestCvlQinq(TestCase): out_vlan = 1 pkt_list = ['Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac, 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac] - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable on' % self.pf_interface, '#') + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s off' % (self.pf_interface, self.flag), '# ') self.setup_pf_vfs_env(vfs_num=1) self.launch_testpmd(vfs_num=1) self.pmd_output.execute_cmd("stop") @@ -789,7 +797,8 @@ class TestCvlQinq(TestCase): """ param = '--rxq=16 --txq=16 --disable-crc-strip' pkt = 'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable off' % self.pf_interface, '#') + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s on' % (self.pf_interface, self.flag), '# ') self.setup_pf_vfs_env(vfs_num=1) self.pmd_output.start_testpmd(cores='1S/4C/1T', param=param, ports=self.pci_list, socket=self.ports_socket) self.pmd_output.execute_cmd("set fwd mac") @@ -821,7 +830,8 @@ class TestCvlQinq(TestCase): AVF CRC strip and Vlan strip co-exists """ pkt = 'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)' % self.vf1_mac - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable off' % self.pf_interface, "#") + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s on' % (self.pf_interface, self.flag), '# ') self.setup_pf_vfs_env(vfs_num=1) self.launch_testpmd(vfs_num=1) self.check_vlan_offload(vlan_type="strip", stats="off") @@ -875,4 +885,5 @@ class TestCvlQinq(TestCase): self.destroy_iavf() def tear_down_all(self): - self.dut.send_expect('ethtool --set-priv-flags %s vf-vlan-prune-disable off' % self.pf_interface, '#') \ No newline at end of file + if self.default_stats: + self.dut.send_expect('ethtool --set-priv-flags %s %s %s' % (self.pf_interface, self.flag, self.default_stats), "# ") -- 2.17.1