-static bool ebpf_rss_set_indirections_table(struct EBPFRSSContext *ctx,
- uint16_t *indirections_table,
- size_t len)
-{
- uint32_t i = 0;
+ ctx->program_fd = program_fd;
+ ctx->map_configuration = config_fd;
- if (!ebpf_rss_is_loaded(ctx) || indirections_table == NULL ||
- len > VIRTIO_NET_RSS_MAX_TABLE_LEN) {
+ ctx->mmap_configuration = mmap(NULL, qemu_real_host_page_size,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ctx->map_configuration, 0);
+ if (ctx->mmap_configuration == MAP_FAILED) {
+ trace_ebpf_error("eBPF RSS", "can not mmap eBPF configuration array");
return false;
}
- for (; i < len; ++i) {
- if (bpf_map_update_elem(ctx->map_indirections_table, &i,
- indirections_table + i, 0) < 0) {
- return false;
- }
- }
- return true;
-}
-