Hello,
I have recently enabled DPDK in Suricata, and using vhost-virtio interfaces to exchange packets between suricata and my datapath.
When I pass less number of core in worker-cpu-set as compared to the total number of interfaces, I see that Suricata does not start but throws the error, Error: dpdk: Interfaces requested more cores than configured in the threading section (requested 2 configured 1
In the code also it is evident that there is an explicit check to see if the cores allocated are minimum of total thread count from interface configuration. if (total_cpus > UtilAffinityGetAffinedCPUNum(wtaf)).
While this was not the case prior to DPDK. Earlier I was using tap interfaces(capture method AF_PACKET), where I used have 1 core for 2 tap interfaces.
Now I have following questions
- what is the reason behind this design? Is it because of PMD? If yes should it allow lesser cores when
interrupt-modeis enabled for interface config?
The reason why I am asking this is, with this condition Suricata would need minimum of 2cores when the mode isIPS. Will it not be a problem when Suricata is tried to run in machines with limited cores? (which is the case with me ) - Is there any workaround? I am okay for lesser performance but consistent/robust behaviour.
- If I could allocate more cores to Suricata, which is option is better?
- Creating multiple vhost-interface pairs
- Creating just one pair of Vhost interface with more number of threads.
DPDK version: 23.11
Suricata version: 7.0.9
My config:
threading:
set-cpu-affinity: yes
cpu-affinity:
- management-cpu-set:
cpu: [1]- worker-cpu-set:
cpu: [4]
mode: “balanced”
prio:
default: “high”dpdk:
eal-params:
proc-type: primary
file-prefix: idps
single-file-segments:
iova-mode: va
vdev:
-virtio_user_in0,path=/tmp/vhost_in0,in_order=0,queue_size=1024,mrg_rxbuf=1’
- ‘virtio_user_in1,path=/tmp/vhost_in1,in_order=0,queue_size=1024,mrg_rxbuf=1’
interfaces:
- interface: virtio_user_in0
threads: 1
interrupt-mode: true
promisc: false
multicast: false
interrupt-mode: true
checksum-checks: false
checksum-checks-offload: false
mtu: 9000
rss-hash-functions: 0x0
mempool-size: 3072
mempool-cache-size: 257
rx-descriptors: 1024
tx-descriptors: 1024
cluster-type: cluster_flow
defrag: yes
use-mmap: yes
checksum-checks: false
copy-mode: ips
copy-iface: virtio_user_in0- interface: virtio_user_in1
threads: 1
interrupt-mode: true
promisc: false
multicast: false
interrupt-mode: true
checksum-checks: false
checksum-checks-offload: false
mtu: 9000
rss-hash-functions: 0x0
mempool-size: 3072
mempool-cache-size: 257
rx-descriptors: 1024
tx-descriptors: 1024
cluster-type: cluster_flow
defrag: yes
use-mmap: yes
checksum-checks: false
copy-mode: ips
copy-iface: virtio_user_in1
Thanks
Muttanna