qemu-cr16/qapi
Daniel Borkmann e53d9ec7cc net/af-xdp: Support pinned map path for AF_XDP sockets
Extend 'inhibit=on' setting with the option to specify a pinned XSK map
path along with a starting index (default 0) to push the created XSK
sockets into. Example usage:

  # ./build/qemu-system-x86_64 [...] \
   -netdev af-xdp,ifname=enp2s0f0np0,id=net0,mode=native,queues=2,start-queue=14,inhibit=on,map-path=/sys/fs/bpf/xsks_map,map-start-index=14 \
   -device virtio-net-pci,netdev=net0 [...]

This is useful for the case where an existing XDP program with XSK map
is present on the AF_XDP supported phys device and the XSK map is not
yet populated. For example, the former could have been pre-loaded onto
the netdevice by a control plane, which later launches QEMU to populate
it with XSK sockets.

Normally, the main idea behind 'inhibit=on' is that the QEMU instance
doesn't need to have a lot of privileges to use the pre-loaded program
and the pre-created sockets, but this mentioned use-case here is different
where QEMU still needs privileges to create the sockets.

The 'map-start-index' parameter is optional and defaults to 0. It allows
flexible placement of the XSK sockets, and is up to the user to specify
when the XDP program with XSK map was already preloaded. In the simplest
case the queue-to-map-slot mapping is just 1:1 based on ctx->rx_queue_index
but the user might as well have a different scheme (or smaller map size,
e.g. ctx->rx_queue_index % max_size) to push the inbound traffic to one
of the XSK sockets.

Note that the bpf_xdp_query_id() is now only tested for 'inhibit=off'
since only in the latter case the libxdp takes care of installing the
XDP program which was installed based on the s->xdp_flags pointing to
either driver or skb mode. For 'inhibit=on' we don't make any assumptions
and neither go down the path of probing all possible options in which
way the user installed the XDP program.

Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ilya Maximets <i.maximets@ovn.org>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Anton Protopopov <aspsk@isovalent.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2025-07-15 10:26:55 +08:00
..
acpi.json qapi: Tidy up run-together sentences in doc comments 2025-06-03 08:34:56 +02:00
audio.json qapi: Correct spelling of QEMU in doc comments 2025-06-03 08:34:56 +02:00
authz.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
block-core.json qapi: Improve documentation around job state @concluded 2025-06-03 08:34:57 +02:00
block-export.json qapi: Correct spelling of QEMU in doc comments 2025-06-03 08:34:56 +02:00
block.json qapi: Fix capitalization in doc comments 2025-06-03 08:34:57 +02:00
char.json qapi: Correct spelling of QEMU in doc comments 2025-06-03 08:34:56 +02:00
common.json hw/qdev-properties-system: Introduce EndianMode QAPI enum 2025-02-16 14:33:39 +01:00
compat.json qapi: Belatedly update CompatPolicy documentation for unstable 2023-10-19 07:02:29 +02:00
control.json qapi: use imperative style in documentation 2025-05-28 18:59:12 +02:00
crypto.json qapi: Tidy up whitespace in doc comments 2025-06-03 08:34:56 +02:00
cryptodev.json qapi: Fix capitalization in doc comments 2025-06-03 08:34:57 +02:00
cxl.json qapi: Fix capitalization in doc comments 2025-06-03 08:34:57 +02:00
dump.json qapi: Use proper markup instead of CAPS for emphasis in doc comments 2025-06-03 08:34:57 +02:00
ebpf.json qapi/ebpf: Drop temporary 'prefix' 2024-09-10 13:22:47 +02:00
error.json qapi: Reformat doc comments to conform to current conventions 2023-05-10 10:01:01 +02:00
introspect.json qapi: Correct spelling of QEMU in doc comments 2025-06-03 08:34:56 +02:00
job.json qapi: Improve documentation around job state @concluded 2025-06-03 08:34:57 +02:00
machine-common.json qapi/qom: Define cache enumeration and properties for machine 2024-11-05 23:32:25 +00:00
machine-s390x.json qapi: make s390x specific CPU commands unconditionally available 2025-05-28 18:56:08 +02:00
machine.json accel/tcg: Remove 'info opcount' and @x-query-opcount 2025-07-04 12:07:59 +02:00
meson.build qapi: make all generated files common 2025-05-28 18:56:08 +02:00
migration.json migration/postcopy: Add latency distribution report for blocktime 2025-07-11 10:37:39 -03:00
misc-arm.json qapi: expose query-gic-capability command unconditionally 2025-05-28 18:54:18 +02:00
misc-i386.json qapi: Fix capitalization in doc comments 2025-06-03 08:34:57 +02:00
misc.json qapi: Use proper markup instead of CAPS for emphasis in doc comments 2025-06-03 08:34:57 +02:00
net.json net/af-xdp: Support pinned map path for AF_XDP sockets 2025-07-15 10:26:55 +08:00
opts-visitor.c qapi: Inline and remove QERR_INVALID_PARAMETER definition 2024-04-24 09:50:58 +02:00
pci.json qapi/pci: Supply missing member documentation 2024-10-02 09:10:01 +02:00
pragma.json qapi: Document QCryptodevBackendServiceType 2024-10-02 09:10:01 +02:00
qapi-clone-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qapi-dealloc-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qapi-forward-visitor.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qapi-schema.json qapi: make s390x specific CPU commands unconditionally available 2025-05-28 18:56:08 +02:00
qapi-type-helpers.c qapi: New strv_from_str_list() 2024-03-04 07:12:40 +01:00
qapi-util.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qapi-visit-core.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qdev.json docs: Fix some typos (found by codespell and typos) 2025-04-13 13:45:04 +03:00
qmp-dispatch.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qmp-event.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qmp-registry.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qobject-input-visitor.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qobject-output-visitor.c qapi: change 'unsigned special_features' to 'uint64_t features' 2025-02-10 15:45:04 +01:00
qom.json i386/tdx: handle TDG.VP.VMCALL<GetQuote> 2025-06-20 13:25:59 +02:00
replay.json qapi: convert "Example" sections without titles 2024-07-17 10:20:53 +02:00
rocker.json qapi/rocker: Tidy up query-rocker-of-dpa-flows example 2025-04-08 09:04:20 +02:00
run-state.json qapi: Fix capitalization in doc comments 2025-06-03 08:34:57 +02:00
sockets.json util/qemu-sockets: Introduce inet socket options controlling TCP keep-alive 2025-05-22 11:24:41 +01:00
stats.json qapi: Refill doc comments to conform to conventions 2024-08-05 09:31:51 +02:00
string-input-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
string-output-visitor.c string-output-visitor: Fix (pseudo) struct handling 2024-01-26 11:16:58 +01:00
tpm.json qapi: convert "Example" sections without titles 2024-07-17 10:20:53 +02:00
trace-events qapi: Generalize struct member policy checking 2021-10-29 18:23:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
trace.json qapi: convert "Example" sections without titles 2024-07-17 10:20:53 +02:00
transaction.json qapi: Fix capitalization in doc comments 2025-06-03 08:34:57 +02:00
uefi.json qapi: Correct spelling of QEMU in doc comments 2025-06-03 08:34:56 +02:00
ui.json qapi: Correct spelling of QEMU in doc comments 2025-06-03 08:34:56 +02:00
vfio.json qapi/vfio: Rename VfioMigrationState to Qapi*, and drop prefix 2024-09-10 14:03:45 +02:00
virtio.json qapi: use imperative style in documentation 2025-05-28 18:59:12 +02:00
yank.json qapi: convert "Example" sections without titles 2024-07-17 10:20:53 +02:00