From patchwork Mon Dec 7 09:53:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, HaiyangX" X-Patchwork-Id: 84777 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD4DBA09E5; Mon, 7 Dec 2020 10:59:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 35D3DC8CC; Mon, 7 Dec 2020 10:59:31 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8FE62F72 for ; Mon, 7 Dec 2020 10:59:29 +0100 (CET) IronPort-SDR: tTb6L4jXgn4Q4sRwO2kxtmZ+D1r3/sVJLHhUij8jCcEH78/GXpzDflNe2cLxwcdh8e3w8IwAAf iVRBrgGDApfw== X-IronPort-AV: E=McAfee;i="6000,8403,9827"; a="173783178" X-IronPort-AV: E=Sophos;i="5.78,399,1599548400"; d="scan'208";a="173783178" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 01:59:27 -0800 IronPort-SDR: AtrmEHsVvE6D0lxsG3+8NIv949ChfaeH+WZ8n/Wk8q+7Ep15TR9dw6sj82jg59fCyT+t7a8XFg 9iq3moCFyxVw== X-IronPort-AV: E=Sophos;i="5.78,399,1599548400"; d="scan'208";a="541448206" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 01:59:26 -0800 From: Haiyang Zhao To: lijuan.tu@intel.com, dts@dpdk.org Cc: Haiyang Zhao Date: Mon, 7 Dec 2020 17:53:01 +0800 Message-Id: <20201207095302.2133-2-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201207095302.2133-1-haiyangx.zhao@intel.com> References: <20201207095302.2133-1-haiyangx.zhao@intel.com> Subject: [dts] [PATCH V1 1/2] framework/dut: add -a support in create_eal_parameters X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" eal parameter -w is deprecated since dpdk 20.11.0-rc3 and should use -a instead. For dpdk LTS test and avoid modify the -w option in suites, keep the -w support. Signed-off-by: Haiyang Zhao --- framework/dut.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index f3ef8c6..dcf833b 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -116,7 +116,8 @@ class Dut(Crb): """ generate eal parameters character string :param config: - :return: eal_str eg:'-c 0xf -w 0000:88:00.0 -w 0000:88:00.1 --file-prefix=dpdk_1112_20190809143420' + :return: eal_str eg:'-c 0xf -a 0000:88:00.0 -a 0000:88:00.1 --file-prefix=dpdk_1112_20190809143420', + if dpdk version < 20.11-rc4, eal_str eg: '-c 0xf -w 0000:88:00.0 --file-prefix=dpdk_1112_20190809143420', """ default_cores = '1S/2C/1T' blank = ' ' @@ -137,19 +138,20 @@ class Dut(Crb): # deal with ports w_pci_list = [] if 'ports' in config and len(config['ports']) != 0: + allow_option = '-a' if self.dpdk_version > '20.11.0-rc3' or self.dpdk_version == '20.11.0' else '-w' for port in config['ports']: if type(port) == int: if 'port_options' in config and port in list(config['port_options'].keys()): port_option = config['port_options'][port] - w_pci_list.append('-w %s,%s' % (self.ports_info[port]['pci'], port_option)) + w_pci_list.append('%s %s,%s' % (allow_option, self.ports_info[port]['pci'], port_option)) else: - w_pci_list.append('-w %s' % self.ports_info[port]['pci']) + w_pci_list.append('%s %s' % (allow_option, self.ports_info[port]['pci'])) else: if 'port_options' in config and port in list(config['port_options'].keys()): port_option = config['port_options'][port] - w_pci_list.append('-w %s,%s' % (port, port_option)) + w_pci_list.append('%s %s,%s' % (allow_option, port, port_option)) else: - w_pci_list.append('-w %s' % port) + w_pci_list.append('%s %s' % (allow_option, port)) w_pci_str = ' '.join(w_pci_list) # deal with black ports From patchwork Mon Dec 7 09:53:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, HaiyangX" X-Patchwork-Id: 84778 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6EF4BA0524; Mon, 7 Dec 2020 10:59:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D6A5C8E6; Mon, 7 Dec 2020 10:59:33 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 300B1C8C4 for ; Mon, 7 Dec 2020 10:59:30 +0100 (CET) IronPort-SDR: NuQiStB9A/eGq0osX0A09EjtnpqlP5l0TjBy2MueIE4IEWQCJc0JUG23ebomfLrxLWtaE6KFzu 4F7pVOk65Tyw== X-IronPort-AV: E=McAfee;i="6000,8403,9827"; a="173783182" X-IronPort-AV: E=Sophos;i="5.78,399,1599548400"; d="scan'208";a="173783182" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 01:59:29 -0800 IronPort-SDR: L5w3SMDmDl65zE8n4BJ/6TTZ7beB5Hyrcu7bhAwo4fh1k9pt+dfYxqhe0YeYWwSSRfDQl0H2I4 1nzIvRJdhoTg== X-IronPort-AV: E=Sophos;i="5.78,399,1599548400"; d="scan'208";a="541448215" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2020 01:59:27 -0800 From: Haiyang Zhao To: lijuan.tu@intel.com, dts@dpdk.org Cc: Haiyang Zhao Date: Mon, 7 Dec 2020 17:53:02 +0800 Message-Id: <20201207095302.2133-3-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201207095302.2133-1-haiyangx.zhao@intel.com> References: <20201207095302.2133-1-haiyangx.zhao@intel.com> Subject: [dts] [PATCH V1 2/2] framework/pmd_output: add -a support in split_eal_param X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" add -a support and optmize the regular expression. Signed-off-by: Haiyang Zhao --- framework/pmd_output.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/framework/pmd_output.py b/framework/pmd_output.py index 6557f9c..9dc6d3b 100644 --- a/framework/pmd_output.py +++ b/framework/pmd_output.py @@ -109,11 +109,14 @@ class PmdOutput(): :param eal_param: :return: """ - re_w_pci_str = '\s?-w\\s+.+?:.+?:.+?\\..+?[,.*=\d+]?\s|\s?-w\\s+.+?:.+?\\..+?[,.*=\d+]?\s' + re_w_pci_str = '\s?-[w,a]\s+\w*:?[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}.[A-Fa-f0-9]{1},.*=\d+' \ + '|\s?-[w,a]\s+\w*:?[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}.[A-Fa-f0-9]{1}' re_file_prefix_str = '--file-prefix[\s*=]\S+\s' - re_b_pci_str = '\s?-b\\s+.+?:.+?:.+?\\..+?[,.*=\d+]?\s|\s?-b\\s+.+?:.+?\\..+?[,.*=\d+]?\s' + re_b_pci_str = '\s?-b\s+\w*:?[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}.[A-Fa-f0-9]{1},.*=\d+' \ + '|\s?-b\s+\w*:?[A-Fa-f0-9]{2}:[A-Fa-f0-9]{2}.[A-Fa-f0-9]{1}' eal_param = eal_param + ' ' - # pci_str_list eg: ['-w 0000:1a:00.0 ', '-w 0000:1a:00.1,queue-num-per-vf=4 ', '-w 0000:aa:bb.1,queue-num-per-vf=4 '] + # pci_str_list eg: ['-w 0000:1a:00.0 ', '-w 0000:1a:00.1,queue-num-per-vf=4 ', '-w 0000:aa:bb.1,queue-num-per-vf=4 ', + # '-a 0000:1a:00.0 ', '-a 0000:1a:00.1,queue-num-per-vf=4 ', '-a 0000:aa:bb.1,queue-num-per-vf=4 '] w_pci_str_list = re.findall(re_w_pci_str, eal_param) # file_prefix_str eg: ['--file-prefix=dpdk '] file_prefix_str = re.findall(re_file_prefix_str, eal_param) @@ -123,13 +126,13 @@ class PmdOutput(): if w_pci_str_list: for pci_str in w_pci_str_list: # has pci options - if ',' in pci_str: - pci_option = pci_str.split(',') - pci = pci_option[0].split(' ')[-1] - has_pci_option[pci] = pci_option[1].strip() - pci_list.append(pci) + pci_str_options = pci_str.split('-w ') if '-w ' in pci_str else pci_str.split('-a ') + if ',' in pci_str_options[-1]: + pci_option = pci_str_options[-1].split(',') + has_pci_option[pci_option[0]] = pci_option[1].strip() + pci_list.append(pci_option[0]) else: - pci_list.append(pci_str.split('-w')[-1].strip()) + pci_list.append(pci_str_options[-1]) b_pci_list = [] if b_pci_str_list: