Skip to content

af_xdp: Fix wakeup channel mismatch causing performance degradation#305

Open
akiyano wants to merge 1 commit intoXilinx-CNS:masterfrom
akiyano:fix_wakeup_channel_mismatch
Open

af_xdp: Fix wakeup channel mismatch causing performance degradation#305
akiyano wants to merge 1 commit intoXilinx-CNS:masterfrom
akiyano:fix_wakeup_channel_mismatch

Conversation

@akiyano
Copy link
Copy Markdown

@akiyano akiyano commented Sep 12, 2025

When trying to use onload with AF_XDP, performance degrades significantly if the flow steering choses queue != 0 (from 9Gbps to 20 Mbps)

This also means that If we want to use more than 1 queue to push more traffic we can't (only queue 0 is usable)

The attached commit fixes these issues.

@akiyano akiyano requested a review from a team as a code owner September 12, 2025 21:10
When AF_XDP sockets are bound to non-zero hardware queues, applications
experience severe throughput degradation (e.g., 9 Gbps drops to 20 Mbps).

Problem:
The efrm_vi_get_channel() function calculates wakeup channels using RSS
modulo arithmetic: `instance % rss_channel_count`. For AF_XDP devices,
rss_channel_count is hardcoded to 1, causing all VI instances to map
to wakeup channel 0, regardless of their actual hardware queue binding.

This creates a mismatch where:
- AF_XDP socket correctly binds to hardware queue N
- Packets arrive at hardware queue N
- But application wakeup notifications are sent to event queue 0
- Application relies on periodic polling (90ms timeout) instead of
  immediate event-driven wakeups

Root Cause:
AF_XDP uses direct queue selection via ntuple rules rather than RSS
distribution, making the RSS-based wakeup channel calculation incorrect.

Solution:
Add AF_XDP-specific logic to use direct 1:1 mapping where the wakeup
channel equals the VI instance number, ensuring proper alignment
between packet arrival queue and application wakeup channel.

Testing:
- Before: Queue 4 traffic = 20 Mbps (450x degradation)
- After: Queue 4 traffic = 9 Gbps (full performance restored)
- Queue 0 performance unaffected (was already working correctly)
@akiyano akiyano force-pushed the fix_wakeup_channel_mismatch branch from 70f985a to 2acaf1d Compare September 12, 2025 21:13
@akiyano akiyano changed the title af_xdp: Fix wakeup channel mismatch causing severe performance degrad… af_xdp: Fix wakeup channel mismatch causing performance degradation Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant