test suite reviews and discussions
 help / color / mirror / Atom feed
From: lihong <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: lihong <lihongx.ma@intel.com>
Subject: [dts] [PATCH V2] framework/pmd_output: fix issue of start_testpmd
Date: Thu, 12 Dec 2019 07:59:41 +0800	[thread overview]
Message-ID: <1576108781-8380-1-git-send-email-lihongx.ma@intel.com> (raw)

1. fix the regular match about file prefix string
2. fix issue about params analysis

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 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


             reply	other threads:[~2019-12-12  7:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 23:59 lihong [this message]
2019-12-12  7:27 ` Ma, LihongX
2019-12-17  7:06 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1576108781-8380-1-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).