Skip to content

Commit

Permalink
dpdk: implement DPDK SW tests
Browse files Browse the repository at this point in the history
Implement Github CI tests to run DPDK Suri with the minimal
configuration to verify that Suricata can start in both IDS
and IPS configuration.
  • Loading branch information
Lukas Sismis authored and victorjulien committed Apr 10, 2024
1 parent 28ac3c2 commit e54084f
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,20 @@ jobs:
- run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-dpdk
- run: make -j ${{ env.CPUS }}
- run: make check
# IDS config
- run: rm -f ./eve.json
- run: |
timeout --kill-after=30 --preserve-status 3 \
./src/suricata -c .github/workflows/dpdk/suricata-null-ids.yaml -S /dev/null -l ./ --dpdk -vvvv
- run: |
test $(jq -c 'select(.event_type == "stats")' ./eve.json | tail -n1 | jq '.stats.capture.packets > 0') = true
# IPS config
- run: rm -f ./eve.json
- run: |
timeout --kill-after=30 --preserve-status 3 \
./src/suricata -c .github/workflows/dpdk/suricata-null-ips.yaml -S /dev/null -l ./ --dpdk -vvvv
- run: |
test $(jq -c 'select(.event_type == "stats")' ./eve.json | tail -n1 | jq '.stats.capture.packets > 0') = true
debian-12:
name: Debian 12
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/dpdk/suricata-null-ids.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
append: false
filename: eve.json
level: Info
types:
- stats:
totals: yes
dpdk:
eal-params:
proc-type: primary
vdev: net_null0
no-huge:
m: 256

interfaces:
- interface: net_null0 # PCIe address of the NIC port
threads: auto
mempool-size: 511
mempool-cache-size: auto
rx-descriptors: 16
tx-descriptors: 16
copy-mode: none
copy-iface: none # or PCIe address of the second interface

threading:
set-cpu-affinity: yes
cpu-affinity:
- management-cpu-set:
cpu: [ 0 ]
- worker-cpu-set:
cpu: [ "all" ]
mode: "exclusive"
47 changes: 47 additions & 0 deletions .github/workflows/dpdk/suricata-null-ips.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filetype: regular
append: false
filename: eve.json
level: Info
types:
- stats:
totals: yes

dpdk:
eal-params:
proc-type: primary
vdev: ["net_null0", "net_null1"]
no-huge:
m: 256

interfaces:
- interface: net_null0
threads: 1
mempool-size: 511
mempool-cache-size: auto
rx-descriptors: 16
tx-descriptors: 16
copy-mode: ips
copy-iface: net_null1
- interface: net_null1
threads: 1
mempool-size: 511
mempool-cache-size: auto
rx-descriptors: 16
tx-descriptors: 16
copy-mode: ips
copy-iface: net_null0

threading:
set-cpu-affinity: yes
cpu-affinity:
- management-cpu-set:
cpu: [ 0 ]
- worker-cpu-set:
cpu: [ "1-2" ]
mode: "exclusive"

0 comments on commit e54084f

Please sign in to comment.