| 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 | # ************ |
| 9 | # eBPF Objects |
| 10 | # ************ |
| 11 | # |
| 12 | # eBPF object is an ELF binary that contains the eBPF program and eBPF |
| 13 | # map description(BTF). Overall, eBPF object should contain the |
| 14 | # program and enough metadata to create/load eBPF with libbpf. As the |
| 15 | # eBPF maps/program should correspond to QEMU, the eBPF can't be used |
| 16 | # from different QEMU build. |
| 17 | # |
| 18 | # Currently, there is a possible eBPF for receive-side scaling (RSS). |
| 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 (e.g. 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' } |