2
0

ebpf_rss.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * eBPF RSS header
  3. *
  4. * Developed by Daynix Computing LTD (http://www.daynix.com)
  5. *
  6. * Authors:
  7. * Andrew Melnychenko <andrew@daynix.com>
  8. * Yuri Benditovich <yuri.benditovich@daynix.com>
  9. *
  10. * This work is licensed under the terms of the GNU GPL, version 2. See
  11. * the COPYING file in the top-level directory.
  12. */
  13. #ifndef QEMU_EBPF_RSS_H
  14. #define QEMU_EBPF_RSS_H
  15. struct EBPFRSSContext {
  16. void *obj;
  17. int program_fd;
  18. int map_configuration;
  19. int map_toeplitz_key;
  20. int map_indirections_table;
  21. };
  22. struct EBPFRSSConfig {
  23. uint8_t redirect;
  24. uint8_t populate_hash;
  25. uint32_t hash_types;
  26. uint16_t indirections_len;
  27. uint16_t default_queue;
  28. } __attribute__((packed));
  29. void ebpf_rss_init(struct EBPFRSSContext *ctx);
  30. bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx);
  31. bool ebpf_rss_load(struct EBPFRSSContext *ctx);
  32. bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
  33. uint16_t *indirections_table, uint8_t *toeplitz_key);
  34. void ebpf_rss_unload(struct EBPFRSSContext *ctx);
  35. #endif /* QEMU_EBPF_RSS_H */