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 C09FCA0524; Tue, 13 Apr 2021 09:17:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B48BE160BA2; Tue, 13 Apr 2021 09:17:39 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 929FF160BA0 for ; Tue, 13 Apr 2021 09:17:38 +0200 (CEST) IronPort-SDR: HQE/RptnTOK14+4dsAr2KncSZHqTshTcsoNpb/majCKqEZGpKI1e6JCXIxxKBtiwvvUl5rIT5t ddltwJKrcW6A== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="255682398" X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="255682398" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 00:17:36 -0700 IronPort-SDR: /gYKnH97CgzkkBErLz1/6mZIlIUdyEsJYEhECYpYs6jpvQ/eq758wxcFmkNZoacPwMl8DXduJD 8JiH+VveZ4fQ== X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="424134992" Received: from unknown (HELO cvl_tetser_105.icx.intel.com) ([10.240.183.105]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 00:17:35 -0700 From: sunqin To: dts@dpdk.org Cc: sunqin Date: Tue, 13 Apr 2021 15:52:19 +0000 Message-Id: <20210413155219.20110-1-qinx.sun@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V3] tests/cvl_advanced_iavf_rss_gtpu: set vlan id for vf 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" Confirm with developer that the design of dpdk is changed for VF, the VLAN ID needs to be set before VF receives VLAN packets Signed-off-by: sunqin --- v1: add vlan id in a common function,will be called by most of cases v2: add vlan id only for related cases v3: remove the added VLAN to reduce the impact on other cases tests/TestSuite_cvl_advanced_iavf_rss_gtpu.py | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/tests/TestSuite_cvl_advanced_iavf_rss_gtpu.py b/tests/TestSuite_cvl_advanced_iavf_rss_gtpu.py index 1987a522..d19ddbf0 100644 --- a/tests/TestSuite_cvl_advanced_iavf_rss_gtpu.py +++ b/tests/TestSuite_cvl_advanced_iavf_rss_gtpu.py @@ -6988,11 +6988,30 @@ class TestCVLAdvancedIAVFRSSGTPU(TestCase): self.pmd_output.quit() self.launch_testpmd(symmetric=symmetric) self.pmd_output.execute_cmd("start") - self.pmd_output.execute_cmd('vlan set filter on 0') - self.pmd_output.execute_cmd('rx_vlan add 1 0') - self.pmd_output.execute_cmd('rx_vlan add 3 0') - self.pmd_output.execute_cmd('rx_vlan add 5 0') - self.pmd_output.execute_cmd('rx_vlan add 7 0') + + def set_vlan_filter(self,state='on',port_id=0): + """ + :param state: on/off + """ + self.pmd_output.execute_cmd('vlan set filter {} {}'.format(state, port_id)) + + def vlan_action(self,action,vlan_id,port_id=0): + """ + :param action: add/rm + :param vlan_id: support int and list + """ + if not isinstance(vlan_id,list): + vlan_id = [vlan_id] + [self.pmd_output.execute_cmd('rx_vlan {} {} {}'.format(action, id , port_id)) for id in vlan_id] + + def handle_vlan_case(self,cases_info,vlan_id,port_id): + try: + self.set_vlan_filter('on',port_id) + self.vlan_action('add',vlan_id,port_id) + self.rssprocess.handle_rss_distribute_cases(cases_info=cases_info) + finally: + self.vlan_action('rm', vlan_id,port_id) + self.set_vlan_filter('off', port_id) def test_mac_ipv4_gtpu_ipv4(self): self.switch_testpmd(symmetric=False) @@ -7804,35 +7823,35 @@ class TestCVLAdvancedIAVFRSSGTPU(TestCase): # vf rss gtpc gtpu def test_mac_ipv4_gtpu(self): self.switch_testpmd(symmetric=False) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv4_gtpu_toeplitz) + self.handle_vlan_case(mac_ipv4_gtpu_toeplitz, [1,3,5], 0) def test_mac_ipv6_gtpu(self): self.switch_testpmd(symmetric=False) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv6_gtpu_toeplitz) + self.handle_vlan_case(mac_ipv6_gtpu_toeplitz, [1,5,7], 0) def test_mac_ipv4_gtpc(self): self.switch_testpmd(symmetric=False) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv4_gtpc_toeplitz) + self.handle_vlan_case(mac_ipv4_gtpc_toeplitz, [1,3,5], 0) def test_mac_ipv6_gtpc(self): self.switch_testpmd(symmetric=False) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv6_gtpc_toeplitz) + self.handle_vlan_case(mac_ipv6_gtpc_toeplitz, [1,3,5], 0) def test_mac_ipv4_gtpu_symmetric(self): self.switch_testpmd(symmetric=True) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv4_gtpu_symmetric_toeplitz) + self.handle_vlan_case(mac_ipv4_gtpu_symmetric_toeplitz, 1, 0) def test_mac_ipv6_gtpu_symmetric(self): self.switch_testpmd(symmetric=True) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv6_gtpu_symmetric_toeplitz) + self.handle_vlan_case(mac_ipv6_gtpu_symmetric_toeplitz, 1, 0) def test_mac_ipv4_gtpc_symmetric(self): self.switch_testpmd(symmetric=True) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv4_gtpc_symmetric_toeplitz) + self.handle_vlan_case(mac_ipv4_gtpc_symmetric_toeplitz, 1, 0) def test_mac_ipv6_gtpc_symmetric(self): self.switch_testpmd(symmetric=True) - self.rssprocess.handle_rss_distribute_cases(cases_info=mac_ipv6_gtpc_symmetric_toeplitz) + self.handle_vlan_case(mac_ipv6_gtpc_symmetric_toeplitz, 1, 0) def tear_down(self): # destroy all flow rule on port 0 -- 2.17.1