tests/qemu-iotests: Fix some tests that use --image-opts for other protocols
[qemu/kevin.git] / ebpf / ebpf_rss.h
blob239242b0d26e6d0ab2805bc7e88387342acf9df0
1 /*
2 * eBPF RSS header
4 * Developed by Daynix Computing LTD (http://www.daynix.com)
6 * Authors:
7 * Andrew Melnychenko <andrew@daynix.com>
8 * Yuri Benditovich <yuri.benditovich@daynix.com>
10 * This work is licensed under the terms of the GNU GPL, version 2. See
11 * the COPYING file in the top-level directory.
14 #ifndef QEMU_EBPF_RSS_H
15 #define QEMU_EBPF_RSS_H
17 #define EBPF_RSS_MAX_FDS 4
19 struct EBPFRSSContext {
20 void *obj;
21 int program_fd;
22 int map_configuration;
23 int map_toeplitz_key;
24 int map_indirections_table;
26 /* mapped eBPF maps for direct access to omit bpf_map_update_elem() */
27 void *mmap_configuration;
28 void *mmap_toeplitz_key;
29 void *mmap_indirections_table;
32 struct EBPFRSSConfig {
33 uint8_t redirect;
34 uint8_t populate_hash;
35 uint32_t hash_types;
36 uint16_t indirections_len;
37 uint16_t default_queue;
38 } __attribute__((packed));
40 void ebpf_rss_init(struct EBPFRSSContext *ctx);
42 bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx);
44 bool ebpf_rss_load(struct EBPFRSSContext *ctx);
46 bool ebpf_rss_load_fds(struct EBPFRSSContext *ctx, int program_fd,
47 int config_fd, int toeplitz_fd, int table_fd);
49 bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
50 uint16_t *indirections_table, uint8_t *toeplitz_key);
52 void ebpf_rss_unload(struct EBPFRSSContext *ctx);
54 #endif /* QEMU_EBPF_RSS_H */