Report complete AF_XDP diagnostics and explain generic fallback - #5
Report complete AF_XDP diagnostics and explain generic fallback#5m4r1k wants to merge 5 commits into
Conversation
|
Hey @m4r1k thanks for this. This is nie. One blocker before we go ahead with it. I gave it a quick try with a veth pair, and on an idle receiver with no traffic at all I see a yellow |
|
Hey @atoonk I agree that |
|
@m4r1k I like the VPP approach, with one tweak. Assuming i understand you correctly "Show only nonzero" doesn't quite solve my case: on an idle receiver What I'd prefer:
And yes to the idle-receiver regression test. Maybe have it assert the starvation counters don't appear in the default view at all, not just that there's no warning line. |
292e61c to
acf5937
Compare
|
Makes sense. I've pushed a new draft following your suggestion.
Both PRs rebased onto main. WDYT? |
|
hey @m4r1k just wanted to let you know that i havent forgotten. Bit busy with $dayjob, will look at this soon! |
Linux exposes six AF_XDP counters through
XDP_STATISTICS. Wireblast currentlyshows only part of that information, and empty-ring events are easy to mistake
for packet drops.
This patch reports all six counters with their Linux UAPI names, counts, rates,
and short descriptions. The dashboard separates drop counters from ring
starvation and can expand into per-queue detail. The final noninteractive
summary uses the same taxonomy. When the statistics exporter is enabled, its
queue records carry the same fields.
The fallback path also keeps the reason that native AF_XDP failed. Native mode
still tries zero-copy first and copy mode second. Wireblast tries generic copy
mode only after go-afxdp reports that its native attach or bind attempts were
exhausted. Interface lookup, queue discovery, filter setup, validation, and BPF
build errors return immediately rather than being presented as driver
limitations.
If generic mode succeeds, the noninteractive frontend logs the exact native
error and the interactive dashboard displays it. If generic mode also fails,
the returned error preserves both causes. The fallback contains no NIC or
driver-specific logic, and Wireblast v0.3.0's multi-buffer option remains
active in both attach attempts.
This PR is temporarily stacked on #4 so its per-queue
export can be reviewed with the diagnostics that provide those fields. After
#4 merges, this branch should be rebased onto
mainand the PR retargeted.The diagnostics were exercised between paired Google Cloud C4N instances from
c4n-highcpu-2throughc4n-highcpu-96, using gVNIC, GVE, native XDP, andAF_XDP zero-copy. The inline log excerpt is from the receive side of a C96
IMIX run and includes the native/zero-copy gate plus the six final counters.
The live matrix stayed in native mode, so the generic fallback paths were
covered by automated tests rather than this sample.
C96 gVNIC/GVE native zero-copy log excerpt
Tested with:
go test -count=1 ./...go test -race -count=1 ./...go vet ./...gofmt -l .go build -buildvcs=false ./cmd/wireblast