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