4 * Developed by Daynix Computing LTD (http://www.daynix.com)
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
{
22 int map_configuration
;
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
{
34 uint8_t populate_hash
;
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 */