From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6DB09A04F5; Thu, 12 Dec 2019 08:25:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F633374C; Thu, 12 Dec 2019 08:25:18 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 8E9F62BD3 for ; Thu, 12 Dec 2019 08:25:16 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 23:25:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,305,1571727600"; d="scan'208";a="245598681" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.203]) by fmsmga002.fm.intel.com with ESMTP; 11 Dec 2019 23:25:14 -0800 From: lihong To: dts@dpdk.org Cc: lihong Date: Thu, 12 Dec 2019 07:59:41 +0800 Message-Id: <1576108781-8380-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V2] framework/pmd_output: fix issue of start_testpmd 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" 1. fix the regular match about file prefix string 2. fix issue about params analysis Signed-off-by: lihong --- framework/pmd_output.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/framework/pmd_output.py b/framework/pmd_output.py index 762f335..dd1e40d 100644 --- a/framework/pmd_output.py +++ b/framework/pmd_output.py @@ -110,7 +110,7 @@ class PmdOutput(): :return: """ re_w_pci_str = '\s?-w\\s+.+?:.+?:.+?\\..+?[,.*=\d+]?\s|\s?-w\\s+.+?:.+?\\..+?[,.*=\d+]?\s' - re_file_prefix_str = '--file-prefix[=\s+].+\s' + re_file_prefix_str = '--file-prefix[\s*=]\S+\s' re_b_pci_str = '\s?-b\\s+.+?:.+?:.+?\\..+?[,.*=\d+]?\s|\s?-b\\s+.+?:.+?\\..+?[,.*=\d+]?\s' 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 '] @@ -156,21 +156,25 @@ class PmdOutput(): def start_testpmd(self, cores='default', param='', eal_param='', socket=0, fixed_prefix=False, **config): config['cores'] = cores if eal_param == '': - # use configured ports - config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))] + # use configured ports if not set + if 'ports' not in config.keys(): + config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))] all_eal_param = self.dut.create_eal_parameters(fixed_prefix=fixed_prefix, socket=socket, **config) else: w_pci_list, port_options, b_pci_list, file_prefix, no_pci, other_eal_str = self.split_eal_param(eal_param) if no_pci: config['no_pci'] = no_pci - elif not w_pci_list and not b_pci_list: - config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))] - config['prefix'] = file_prefix - else: + if w_pci_list: config['ports'] = w_pci_list + if port_options: config['port_options'] = port_options + if b_pci_list: config['b_ports'] = b_pci_list + if file_prefix: config['prefix'] = file_prefix + + if not w_pci_list and not b_pci_list and 'ports' not in config.keys(): + config['ports'] = [self.dut.ports_info[i]['pci'] for i in range(len(self.dut.ports_info))] part_eal_param = self.dut.create_eal_parameters(fixed_prefix=fixed_prefix, socket=socket, **config) all_eal_param = part_eal_param + ' ' + other_eal_str -- 2.7.4