How to decide -c core number to use if I want to use all of my CPUs

1,055 views
Skip to first unread message

Ziyun Zhong

unread,
Dec 15, 2019, 4:51:39 PM12/15/19
to TRex Traffic Generator
Hi, I am running on VM. I am trying to use as much as CPU I got.

I get this from the dpdk setup script, and I have 8 CPU.

- version: 2
  interfaces: ['13:00.0', '1b:00.0']
  port_info:
      - ip: 1.1.1.1
        default_gw: 2.2.2.2
      - ip: 2.2.2.2
        default_gw: 1.1.1.1

  platform:
      master_thread_id: 0
      latency_thread_id: 1
      dual_if:
        - socket: 0
          threads: [2,3,4,5,6,7]

I assume this script would use all 8 threads, thread 0 and thread 1 is for master and latency. I am aware that in the VM environment, it is hard to justify how much resources actually using. 

If I run with `-c 8` Here is the output

ERROR: Maximum threads in platform section of config file is 6, unable to run with -c 8.


If `-c 6`
vmxnet3_dev_configure(): ERROR: Number of rx queues not power of 2
Port0 dev_configure = -22
EAL: Error - exiting with code: 1
  Cause: Cannot configure device: err=-22, port=0



So I change to 10 CPU, 

- version: 2
  interfaces: ['13:00.0', '1b:00.0']
  port_info:
      - ip: 1.1.1.1
        default_gw: 2.2.2.2
      - ip: 2.2.2.2
        default_gw: 1.1.1.1

  platform:
      master_thread_id: 0
      latency_thread_id: 1
      dual_if:
        - socket: 0
          threads: [2,3,4,5,6,7,8,9]



I run -c 8, I would get an error like
[perftester@trex_poc trex]$ sudo ./t-rex-64 -i --astf -c 8 --cfg 2_port_10cpu_cfg.yaml
The ports are bound/configured.
Starting  TRex v2.62 please wait  ...
 set driver name net_vmxnet3
 driver capability  : TSO
 set dpdk queues mode to MULTI_QUE
 Number of ports found: 2
zmq publisher at: tcp://*:4500
Ethdev port_id=0 nb_tx_queues=10 > 8
EAL: Error - exiting with code: 1
  Cause: Cannot configure device: err=-22, port=0


if -c 10, 
Starting  TRex v2.62 please wait  ...
ERROR: Maximum threads in platform section of config file is 8, unable to run with -c 10.
Please increase the pool in config or use lower -c.

My question is, how does TRex decide the core number could be used? For now, 8 CPU I could only set -c 4, for 10 CPU, I also could only set -c 4. 

Thank you in advance. 




Ziyun Zhong

unread,
Dec 15, 2019, 5:12:16 PM12/15/19
to TRex Traffic Generator
I also try with 16 CPUs

-c 8
[perftester@trex_poc trex]$ sudo ./t-rex-64 -i --astf -c 8 --cfg 2_port_16_cpu_cfg.yaml
[sudo] password for perftester:
The ports are bound/configured.
Starting  TRex v2.62 please wait  ...
 set driver name net_vmxnet3
 driver capability  : TSO
 set dpdk queues mode to MULTI_QUE
 Number of ports found: 2
zmq publisher at: tcp://*:4500
Ethdev port_id=0 nb_tx_queues=10 > 8
EAL: Error - exiting with code: 1
  Cause: Cannot configure device: err=-22, port=0


-c 14
[perftester@trex_poc trex]$ sudo ./t-rex-64 -i --astf -c 14 --cfg 2_port_16_cpu_cfg.yaml
The ports are bound/configured.
Starting  TRex v2.62 please wait  ...
 set driver name net_vmxnet3
 driver capability  : TSO
 set dpdk queues mode to MULTI_QUE
 Number of ports found: 2
ERROR: driver maximum tx queues is (8) required (14) reduce number of cores to support it



hanoh haim

unread,
Dec 16, 2019, 3:49:26 AM12/16/19
to Ziyun Zhong, TRex Traffic Generator
You are using net_vmxnet3 driver 
and I don't expect high performance even with one core. Move to pci passthrough  you won't have these limitations  

thanks
Hanoh



--
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/ec45cae3-0b91-431e-9694-2cda0e35fa79%40googlegroups.com.


--
Hanoh
Sent from my iPhone

Ziyun Zhong

unread,
Dec 16, 2019, 9:16:07 AM12/16/19
to hanoh haim, TRex Traffic Generator
Thanks for the tip! 

hanoh haim <hhaim...@gmail.com> 于2019年12月16日周一 上午4:49写道:


--
Best wishes,
Toby
Reply all
Reply to author
Forward
0 new messages