xref: /openbmc/qemu/qapi/ebpf.json (revision 4921d0a7)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
4# This work is licensed under the terms of the GNU GPL, version 2 or later.
5# See the COPYING file in the top-level directory.
6
7##
8# = eBPF Objects
9#
10# eBPF object is an ELF binary that contains the eBPF program and eBPF
11# map description(BTF). Overall, eBPF object should contain the
12# program and enough metadata to create/load eBPF with libbpf.  As the
13# eBPF maps/program should correspond to QEMU, the eBPF can't be used
14# from different QEMU build.
15#
16# Currently, there is a possible eBPF for receive-side scaling (RSS).
17##
18
19##
20# @EbpfObject:
21#
22# An eBPF ELF object.
23#
24# @object: the eBPF object encoded in base64
25#
26# Since: 9.0
27##
28{ 'struct': 'EbpfObject',
29  'data': {'object': 'str'},
30  'if': 'CONFIG_EBPF' }
31
32##
33# @EbpfProgramID:
34#
35# The eBPF programs that can be gotten with request-ebpf.
36#
37# @rss: Receive side scaling, technology that allows steering traffic
38#     between queues by calculation hash.  Users may set up
39#     indirection table and hash/packet types configurations.  Used
40#     with virtio-net.
41#
42# Since: 9.0
43##
44{ 'enum': 'EbpfProgramID',
45  'if': 'CONFIG_EBPF',
46  'data': [ { 'name': 'rss' } ] }
47
48##
49# @request-ebpf:
50#
51# Retrieve an eBPF object that can be loaded with libbpf.  Management
52# applications (e.g. libvirt) may load it and pass file descriptors to
53# QEMU, so they can run running QEMU without BPF capabilities.
54#
55# @id: The ID of the program to return.
56#
57# Returns: eBPF object encoded in base64.
58#
59# Since: 9.0
60##
61{ 'command': 'request-ebpf',
62  'data': { 'id': 'EbpfProgramID' },
63  'returns': 'EbpfObject',
64  'if': 'CONFIG_EBPF' }
65