在 2021/3/29 15:51, Li, Xiaoyun 写道:
Hi

-----Original Message-----
From: Min Hu (Connor) <humi...@huawei.com>
Sent: Friday, March 26, 2021 16:53
To: dev@dpdk.org
Cc: Yigit, Ferruh <ferruh.yi...@intel.com>; ajit.khapa...@broadcom.com; Li,
Xiaoyun <xiaoyun...@intel.com>
Subject: [PATCH v7] app/testpmd: support multi-process

From: Lijun Ou <ouli...@huawei.com>

This patch adds multi-process support for testpmd.
The test cmd example as follows:
the primary cmd:
./dpdk-testpmd -a xxx --proc-type=auto -l 0-1 -- -i \
--rxq=4 --txq=4 --num-procs=2 --proc-id=0

the secondary cmd:
./dpdk-testpmd -a xxx --proc-type=auto -l 2-3 -- -i \
--rxq=4 --txq=4 --num-procs=2 --proc-id=1

Signed-off-by: Min Hu (Connor) <humi...@huawei.com>
Signed-off-by: Lijun Ou <ouli...@huawei.com>
---
v7:
* Fixed compiling error for unexpected unindent.

v6:
* Add rte flow description for multiple process.

v5:
* Fixed run_app.rst for multiple process description.
* Fix compiling error.

v4:
* Fixed minimum vlaue of Rxq or Txq in doc.

v3:
* Fixed compiling error using gcc10.0.

v2:
* Added document for this patch.
---
  app/test-pmd/cmdline.c                |  12 +++-
  app/test-pmd/config.c                 |   9 ++-
  app/test-pmd/parameters.c             |  11 +++
  app/test-pmd/testpmd.c                | 127 ++++++++++++++++++++++------------
  app/test-pmd/testpmd.h                |   7 ++
  doc/guides/testpmd_app_ug/run_app.rst |  99 ++++++++++++++++++++++++++
  6 files changed, 219 insertions(+), 46 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
14110eb..287d7a0 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -71,8 +71,6 @@

Why not just restrict queue numbers to be multiple of processes here in 
rss_fwd_config_setup()?
Or at least print a warning to tell users if it's not multiple, packet loss 
will happen.

Hi, fixed in v8, thanks.
        setup_fwd_config_of_each_lcore(&cur_fwd_config);
-       rxp = 0; rxq = 0;
+       start = proc_id * nb_q / num_procs;
+       end = start + nb_q / num_procs;
+       rxp = 0;
+       rxq = start;
        for (sm_id = 0; sm_id < cur_fwd_config.nb_fwd_streams; sm_id++) {
                struct fwd_stream *fs;

@@ -2861,6 +2866,8 @@ rss_fwd_config_setup(void)
                        continue;
                rxp = 0;
                rxq++;
+               if (rxq >= end)
+                       rxq = start;
        }
  }

+*   ``--txq=N``
+
+    Set the number of Tx queues per port to N. N is the sum of queues used by
primary
+    and secondary process. As primary process and secondary process should
have separate
+    queues, and each should occupy at least one queue.where N should be no
less than two.

Where N should be the multiple of number of processes.

Fixed in v8, thanks.
BRs
Xiaoyun
+
2.7.4

Reply via email to