HI all,
I am testing on Suricata 6.0.2 using the XDP driver but I reach a high number of kernel drops. Platform is a RHEL 8.3 KVM guest with the following build info:
This is Suricata version 6.0.2 RELEASE
Features: PCAP_SET_BUFF AF_PACKET HAVE_PACKET_FANOUT LIBCAP_NG LIBNET1.1 HAVE_HTP_URI_NORMALIZE_HOOK PCRE_JIT HAVE_NSS HAVE_LUA HAVE_LIBJANSSON PROFILING PROFILE_LOCKING TLS TLS_C11 MAGIC RUST
SIMD support: none
Atomic intrinsics: 1 2 4 8 byte(s)
64-bits, Little-endian architecture
GCC version Clang 10.0.1 (Red Hat 10.0.1-1.module+el8.3.0+7459+90c24896), C version 201112
compiled with -fstack-protector
compiled with _FORTIFY_SOURCE=2
L1 cache line size (CLS)=64
thread local storage method: _Thread_local
compiled with LibHTP v0.5.37, linked against LibHTP v0.5.37
Suricata Configuration:
AF_PACKET support: yes
eBPF support: yes
XDP support: yes
PF_RING support: no
NFQueue support: no
NFLOG support: no
IPFW support: no
Netmap support: no
DAG enabled: no
Napatech enabled: no
WinDivert enabled: no
Unix socket enabled: yes
Detection enabled: yes
Libmagic support: yes
libnss support: yes
libnspr support: yes
libjansson support: yes
hiredis support: yes
hiredis async with libevent: yes
Prelude support: no
PCRE jit: yes
LUA support: yes
libluajit: no
GeoIP2 support: yes
Non-bundled htp: no
Hyperscan support: yes
Libnet support: yes
liblz4 support: yes
Rust support: yes
Rust strict mode: no
Rust compiler path: /usr/bin/rustc
Rust compiler version: rustc 1.47.0
Cargo path: /usr/bin/cargo
Cargo version: cargo 1.47.0
Cargo vendor: yes
Python support: yes
Python path: /usr/bin/python3
Python distutils yes
Python yaml yes
Install suricatactl: yes
Install suricatasc: yes
Install suricata-update: not bundled
Profiling enabled: yes
Profiling locks enabled: yes
Plugin support (experimental): yes
My capture config is:
af-packet:
- interface: eth2
#threads: auto
cluster-id: 99
cluster-type: cluster_qm
xdp-mode: driver
bypass: yes
defrag: no
use-mmap: yes
mmap-locked: yes
tpacket-v3: yes
ring-size: 200000
But kernel drops numbers are really high (28%), in only 4 min:
Date: 4/4/2021 – 08:03:42 (uptime: 0d, 00h 04m 40s)
Counter | TM Name | Value
capture.kernel_packets | Total | 2189536
capture.kernel_drops | Total | 519816
decoder.pkts | Total | 1669717
decoder.bytes | Total | 2305053483
decoder.ipv4 | Total | 1669717
decoder.ethernet | Total | 1669717
decoder.tcp | Total | 1669681
decoder.udp | Total | 35
decoder.icmpv4 | Total | 1
decoder.avg_pkt_size | Total | 1380
decoder.max_pkt_size | Total | 1494
flow.tcp | Total | 37
flow.udp | Total | 18
flow.wrk.spare_sync_avg | Total | 100
flow.wrk.spare_sync | Total | 1
flow_bypassed.local_pkts | Total | 1665711
flow_bypassed.local_bytes | Total | 2302099509
flow.wrk.flows_evicted_needs_work | Total | 15
flow.wrk.flows_evicted_pkt_inject | Total | 21
flow.wrk.flows_evicted | Total | 2
flow.wrk.flows_injected | Total | 16
tcp.sessions | Total | 19
tcp.syn | Total | 19
tcp.synack | Total | 19
tcp.rst | Total | 8
tcp.stream_depth_reached | Total | 2
detect.mpm_list | Total | 1
detect.nonmpm_list | Total | 2328
detect.fnonmpm_list | Total | 1974
detect.match_list | Total | 1975
app_layer.flow.tls | Total | 19
app_layer.flow.ntp | Total | 6
app_layer.tx.ntp | Total | 6
app_layer.flow.dns_udp | Total | 11
app_layer.tx.dns_udp | Total | 22
app_layer.flow.failed_udp | Total | 1
flow.mgr.full_hash_pass | Total | 2
flow.spare | Total | 9904
flow.mgr.rows_maxlen | Total | 1
flow.mgr.flows_checked | Total | 38
flow.mgr.flows_notimeout | Total | 29
flow.mgr.flows_timeout | Total | 9
flow.mgr.flows_evicted | Total | 9
flow.mgr.flows_evicted_needs_work | Total | 4
tcp.memuse | Total | 573440
tcp.reassembly_memuse | Total | 98304
flow.memuse | Total | 7474304
Is the configuration correct? On the other hand, the xdp_filter.bpf file has not been created during the compilation process. Libbpf has been installed from the official Redhat repos:
Installed Packages
Name : libbpf-devel
Version : 0.0.8
Release : 4.el8
Architecture : x86_64
Size : 191 k
Source : libbpf-0.0.8-4.el8.src.rpm
Repository : @System
From repo : codeready-builder-for-rhel-8-x86_64-rpms
Summary : Development files for libbpf
License : LGPLv2 or BSD
Description : The libbpf-devel package contains libraries header files for
: developing applications that use libbpf
kernel version is 4.18.0-240.15.1.el8_3.x86_64 (latest available).
Suricata startup command is:
/opt/suricata/bin/suricata -c /etc/suricata/suricata.yaml -F /etc/suricata/bpf.conf -vv --af-packet -k none --pidfile /var/run/suricata/suricata.pid
Some ideas?