[PATCH v5] net/af_xdp: enable AF_XDP program attachment mode
Stephen Hemminger
stephen at networkplumber.org
Sat Aug 2 00:37:48 CEST 2025
On Wed, 30 Jul 2025 11:41:21 +0000
Shivaji Kant <shivajikant at google.com> wrote:
> Currently, the AF_XDP PMD attaches its XDP program using a fixed
> set of flags, defaulting to `XDP_FLAGS_UPDATE_IF_NOEXIST`. This lacks
> flexibility for users who might need to explicitly control the XDP
> mode based on their specific hardware capabilities or performance
> requirements.
>
> This patch introduces a new vdev argument, `mode`, for the `net_af_xdp`
> PMD. This argument allows users to explicitly specify the desired
> XDP program attachment mode:
> `drv` (XDP_FLAGS_DRV_MODE),
> `skb` (XDP_FLAGS_SKB_MODE),
> `hw` (XDP_FLAGS_HW_MODE).
> (If needed more can be added)
>
> This change provides greater control and flexibility for users to
> fine-tune AF_XDP behavior, enabling them to leverage native driver
> or hardware offload capabilities when available, or fall back to
> generic SKB mode for broader compatibility.
>
> Signed-off-by: Shivaji Kant <shivajikant at google.com>
Queued to next-net for 25.11. Thanks
More information about the dev
mailing list