Skip to content

Af xdp fixes 8780 v3 - #16208

Open
Aboussejra wants to merge 5 commits into
OISF:mainfrom
Aboussejra:af-xdp-fixes-8780-v3
Open

Aboussejra wants to merge 5 commits into
OISF:mainfrom
Aboussejra:af-xdp-fixes-8780-v3

Conversation

@Aboussejra

Copy link
Copy Markdown

Link to ticket: https://redmine.openinfosecfoundation.org/issues/8780

Describe changes:

Series of fixes for AF_XDP capture mode, tested on suricata 8.0.6 base:

  • WriteLinuxTunables fails when interface altname is used. Tunables were written using the name from suricata.yaml verbatim; when an altname is configured, the sysfs path does not exist. Added a commit to resolve the real netdev name before writing tunables.
  • XSK creation broken with 2 capture interfaces. Socket setup logic failed when two interfaces were configured for capture; fixed XSK creation path so multi-interface capture works.
  • Added XSK visibility about drops in stats.log. For diagnosing capture issues.
  • UMEM size not configurable. UMEM was hardcoded; added sizing option to the af-xdp section of suricata.yaml.

Provide values to any of the below to override the defaults.

  • To use a Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=

amir.boussejra added 5 commits September 10, 2026 16:48
…ltname used in suricata config

WriteLinuxTunables built the sysfs path from the configured interface
name. When an altname is used in the config, sysfs only exposes the
real netdev name and writing gro_flush_timeout/napi_defer_hard_irqs
failed. Resolve the real name via if_indextoname before building the
path.

Ticket: OISF#8780
The XSK queue id counter was global, so with two capture interfaces
the second interface's threads got queue ids continuing after the
first interface's, and xsk_socket__create failed for queues that do
not exist on that device. Make the counter per interface config and
assign ids with a single atomic fetch-and-add at thread init.

Ticket: OISF#8780
UMEM size was hardcoded to XSK ring default descriptors * 2 with
default frame size. Add umem-frames and frame-size options to the
af-xdp section so buffer memory can be tuned per interface.

Ticket: OISF#8780
Expose xsk_socket stats in stats.log: capture.afxdp.rx_dropped,
rx_invalid_descs, rx_ring_full and fill_ring_empty. Helps diagnose
whether kernel drops come from.

Ticket: OISF#8780
AF_XDP capture is receive only

Ticket: OISF#8780
@Aboussejra
Aboussejra requested review from a team and victorjulien as code owners September 11, 2026 09:33
@github-actions

Copy link
Copy Markdown

NOTE: This PR may contain new authors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant