Skip to main content

register_napi_with_ring

Function register_napi_with_ring 

Source
pub fn register_napi_with_ring(
    ring: &IoUring,
    busy_poll_to_us: u32,
    prefer_busy_poll: bool,
) -> Result<()>
Expand description

Register NAPI busy-poll parameters with an io_uring ring.

Configures the kernel to busy-poll NIC NAPI queues when waiting for completions on this ring, reducing tail latency for network I/O (NFS).

§Arguments

  • ring – The io_uring instance to configure.
  • busy_poll_to_us – Busy-poll timeout in microseconds. Use DEFAULT_NAPI_BUSY_POLL_TO_US (50us) for NFS targets.
  • prefer_busy_poll – If true, the kernel prefers busy-polling over interrupt-driven completion. Set true for dedicated NFS copy rings.

§Errors

  • ENOSYS – Kernel does not support io_uring NAPI (< 6.9 or CONFIG_NET_RX_BUSY_POLL disabled). Callers should treat this as a non-fatal degradation.
  • EINVAL – Invalid parameters (should not occur with valid inputs).