2024-03-12 13:57:57 +03:00
|
|
|
# -*- Mode: Python -*-
|
|
|
|
# vim: filetype=python
|
|
|
|
#
|
|
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
|
|
|
|
##
|
|
|
|
# = eBPF Objects
|
|
|
|
#
|
2024-03-22 17:09:08 +03:00
|
|
|
# eBPF object is an ELF binary that contains the eBPF program and eBPF
|
2024-07-29 09:52:20 +03:00
|
|
|
# map description(BTF). Overall, eBPF object should contain the
|
2024-03-22 17:09:08 +03:00
|
|
|
# program and enough metadata to create/load eBPF with libbpf. As the
|
|
|
|
# eBPF maps/program should correspond to QEMU, the eBPF can't be used
|
|
|
|
# from different QEMU build.
|
2024-03-12 13:57:57 +03:00
|
|
|
#
|
|
|
|
# Currently, there is a possible eBPF for receive-side scaling (RSS).
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# @EbpfObject:
|
|
|
|
#
|
|
|
|
# An eBPF ELF object.
|
|
|
|
#
|
|
|
|
# @object: the eBPF object encoded in base64
|
|
|
|
#
|
|
|
|
# Since: 9.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'EbpfObject',
|
|
|
|
'data': {'object': 'str'},
|
|
|
|
'if': 'CONFIG_EBPF' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @EbpfProgramID:
|
|
|
|
#
|
|
|
|
# The eBPF programs that can be gotten with request-ebpf.
|
|
|
|
#
|
|
|
|
# @rss: Receive side scaling, technology that allows steering traffic
|
|
|
|
# between queues by calculation hash. Users may set up
|
|
|
|
# indirection table and hash/packet types configurations. Used
|
|
|
|
# with virtio-net.
|
|
|
|
#
|
|
|
|
# Since: 9.0
|
|
|
|
##
|
|
|
|
{ 'enum': 'EbpfProgramID',
|
|
|
|
'if': 'CONFIG_EBPF',
|
|
|
|
'data': [ { 'name': 'rss' } ] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @request-ebpf:
|
|
|
|
#
|
|
|
|
# Retrieve an eBPF object that can be loaded with libbpf. Management
|
2024-03-22 17:09:04 +03:00
|
|
|
# applications (e.g. libvirt) may load it and pass file descriptors to
|
2024-03-12 13:57:57 +03:00
|
|
|
# QEMU, so they can run running QEMU without BPF capabilities.
|
|
|
|
#
|
|
|
|
# @id: The ID of the program to return.
|
|
|
|
#
|
|
|
|
# Returns: eBPF object encoded in base64.
|
|
|
|
#
|
|
|
|
# Since: 9.0
|
|
|
|
##
|
|
|
|
{ 'command': 'request-ebpf',
|
|
|
|
'data': { 'id': 'EbpfProgramID' },
|
|
|
|
'returns': 'EbpfObject',
|
|
|
|
'if': 'CONFIG_EBPF' }
|