aboutsummaryrefslogtreecommitdiff
path: root/scripts/rust/rustc_args.py
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2025-07-11 11:44:16 +0200
committerJason Wang <jasowang@redhat.com>2025-07-15 10:26:55 +0800
commite53d9ec7ccc2dbb9378353fe2a89ebdca5cd7015 (patch)
treec1d4f919afe118f85e16def690352e38c1e9d2b3 /scripts/rust/rustc_args.py
parentbdebcb49f459237c094a5b9cb084515cfe05e1bc (diff)
downloadqemu-e53d9ec7ccc2dbb9378353fe2a89ebdca5cd7015.zip
qemu-e53d9ec7ccc2dbb9378353fe2a89ebdca5cd7015.tar.gz
qemu-e53d9ec7ccc2dbb9378353fe2a89ebdca5cd7015.tar.bz2
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>
Diffstat (limited to 'scripts/rust/rustc_args.py')
0 files changed, 0 insertions, 0 deletions