[dpdk-dev] [PATCH v2] app/testpmd: support multi-process

Min Hu (Connor) humin29 at huawei.com
Mon Mar 22 07:35:58 CET 2021



在 2021/3/22 10:27, Ajit Khaparde 写道:
> :::snip::::
> 
>> +*   ``--proc-type``
>> +       Specify a given process instance as the primary or secondary DPDK instance. ``auto`` set here is ok.
>> +
>> +*   ``-l CORELIST``
>> +       List of cores to run on. the corelist should be different in primary process and secondary process.
>> +
>> +*   ``--rxq=N``
>> +
>> +    Set the number of RX queues per port to N, where 1 <= N <= 65535.
>> +    The default value is 1. N is the sum of queues used by primary and secondary process.
> If RxQ is 1, how will it be shared between the primary and secondary processes?
Yes, your are right.the range of RxQ(or TxQ) is wrong.
As primary instance and secondary instance should have separate queues, 
and each should occupy at least one queue. So the range of RxQ(or TxQ) 
shoud be no less than two.

> Should the number of rings be a multiple of the number of process  The number of rings had better be a multiple of the number of processes.
  If not, redundant queues will exist after queues are allocated to 
processes. After RSS is enabled, packet loss occurs when traffic is sent 
to all processes at the same time. Some traffic enters redundant queues 
and cannot be forwarded.
  I will fix it in v4.Thanks.

>> +
>> +*   ``--txq=N``
>> +
>> +    Set the number of TX queues per port to N, where 1 <= N <= 65535.
>> +    The default value is 1. N is the sum of queues used by primary and secondary process.
> Same as above. How will a single ring be used across primary and
> secondary processes?
Just same as above, I will fix it in v4.
Thanks.

> 
>> +
>> +*   ``--num-procs=N``
>> +
>> +       The number of processes which will be used.
>> +
>> +*   ``--proc-id=id``
>> +
>> +       The id of the current process (id < num-procs). id should be different in primary process and secondary process.
>> +
>> +Calculation rule for queue:
>> +All queues are allocated to different processes based on proc_num and proc_id.
>> +Calculation rule for the Testpmd to allocate queues to each process:
>> +start(queue start id) = proc_id * nb_q / num_procs;
>> +end(queue end id) = start + nb_q / num_procs;
>> +
>> +For example, if supports 4 txq and rxq
>> +the 0~1 for primary process
>> +the 2~3 for secondary process
>> +
>> +Most dev ops is supported in primary and secondary process. While secondary process is not permitted
>> +to allocate or release shared memory, so some ops are not supported as follows:
>> +``dev_start``
>> +``dev_stop``
>> +``rx_queue_setup``
>> +``tx_queue_setup``
>> +``rx_queue_release``
>> +``tx_queue_release``
>> +
>> +RTE_FLOW supported, it applies only on its own process on SW side, but all on HW size.
>> +stats supported, stats will not change when one quit and start, As they share the same buffer to store the stats.
>> +RSS supported, Primary process and secondary process has separate queues to use, RSS will work in their own queues whether primary and secondary process.
>> --
>> 2.7.4
>>


More information about the dev mailing list