Skip to content

Use SKB or HW XDP driver depending on device capabilities #362

@qdeslandes

Description

@qdeslandes

When an XDP program is attached to the kernel, the caller can pick the attachment mode:

  • XDP_FLAGS_HW_MODE: offload the program to the NIC. Only select Netronome devices support offloading.
  • XDP_FLAGS_DRV_MODE: attach the program in driver mode, requires the NIC to support it.
  • XDP_FLAGS_SKB_MODE: generic mode, works regardless of driver support. This negates the speed advantages offered by XDP, as it is called further up the stack, once a socket buffer has been created.

bpfilter will always pick XDP_FLAGS_SKB_MODE as it will always be supported, but that leaves a lot of performance on the table. Instead, bpfilter should probe the NIC to use the most appropriate mode.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions