-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into…
… staging # -----BEGIN PGP SIGNATURE----- # Version: GnuPG v1 # # iQEcBAABAgAGBQJk+sEHAAoJEO8Ells5jWIRMjUH/i6Sv+19/kz2CFOsfNT6tK0O # hcOo8Pn7WKvEvFgMM7+mZVYQTHj+78hXyen1XgvzZh7557vDAQNo9wwl0fmSRTR4 # qg/ocWg2K4zeTt/DChv3bTpJgOf31nIxffDfGt4QlMw6AZFJqAcr8JHuG7ezq259 # a5yy3b83HA7vexuz9p1UmFat4ps4yLcd/q7EGr0zqBkmUWPWg3fzJSRCTXG0p6GK # +5TUzjZBzK1FuGBLAea8+ULJahSTM11fjCG11qcptOQ9lbFqEHTZYgwgTcOCDxFv # hObNgRBHuqlK/rjw8d6m6oE+I4LMSXfbllgH4zuRNKm4YWhzAs6SXsLIo1+yJH0= # =EXgN # -----END PGP SIGNATURE----- # gpg: Signature made Fri 08 Sep 2023 02:36:55 EDT # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [full] # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * tag 'net-pull-request' of https://github.com/jasowang/qemu: ebpf: Updated eBPF program and skeleton. qmp: Added new command to retrieve eBPF blob. virtio-net: Added property to load eBPF RSS with fds. ebpf: Added eBPF initialization by fds. ebpf: Added eBPF map update through mmap. net: add initial support for AF_XDP network backend e1000e: rename e1000e_ba_state and e1000e_write_hdr_to_rx_buffers igb: packet-split descriptors support igb: add IPv6 extended headers traffic detection igb: RX payload guest writting refactoring igb: RX descriptors guest writting refactoring igb: rename E1000E_RingInfo_st igb: remove TCP ACK detection virtio-net: Add support for USO features virtio-net: Add USO flags to vhost support. tap: Add check for USO features tap: Add USO support to tap device. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
- Loading branch information
Showing
44 changed files
with
2,518 additions
and
1,025 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* QEMU eBPF binary declaration routine. | ||
* | ||
* Developed by Daynix Computing LTD (http://www.daynix.com) | ||
* | ||
* Authors: | ||
* Andrew Melnychenko <andrew@daynix.com> | ||
* | ||
* This work is licensed under the terms of the GNU GPL, version 2 or | ||
* later. See the COPYING file in the top-level directory. | ||
*/ | ||
|
||
#include "qemu/osdep.h" | ||
#include "qemu/queue.h" | ||
#include "qapi/error.h" | ||
#include "qapi/qapi-commands-ebpf.h" | ||
#include "ebpf/ebpf.h" | ||
|
||
struct ElfBinaryDataEntry { | ||
int id; | ||
const void *data; | ||
size_t datalen; | ||
|
||
QSLIST_ENTRY(ElfBinaryDataEntry) node; | ||
}; | ||
|
||
static QSLIST_HEAD(, ElfBinaryDataEntry) ebpf_elf_obj_list = | ||
QSLIST_HEAD_INITIALIZER(); | ||
|
||
void ebpf_register_binary_data(int id, const void *data, size_t datalen) | ||
{ | ||
struct ElfBinaryDataEntry *dataentry = NULL; | ||
|
||
dataentry = g_new0(struct ElfBinaryDataEntry, 1); | ||
dataentry->data = data; | ||
dataentry->datalen = datalen; | ||
dataentry->id = id; | ||
|
||
QSLIST_INSERT_HEAD(&ebpf_elf_obj_list, dataentry, node); | ||
} | ||
|
||
const void *ebpf_find_binary_by_id(int id, size_t *sz, Error **errp) | ||
{ | ||
struct ElfBinaryDataEntry *it = NULL; | ||
QSLIST_FOREACH(it, &ebpf_elf_obj_list, node) { | ||
if (id == it->id) { | ||
*sz = it->datalen; | ||
return it->data; | ||
} | ||
} | ||
|
||
error_setg(errp, "can't find eBPF object with id: %d", id); | ||
|
||
return NULL; | ||
} | ||
|
||
EbpfObject *qmp_request_ebpf(EbpfProgramID id, Error **errp) | ||
{ | ||
EbpfObject *ret = NULL; | ||
size_t size = 0; | ||
const void *data = ebpf_find_binary_by_id(id, &size, errp); | ||
if (!data) { | ||
return NULL; | ||
} | ||
|
||
ret = g_new0(EbpfObject, 1); | ||
ret->object = g_base64_encode(data, size); | ||
|
||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* QEMU eBPF binary declaration routine. | ||
* | ||
* Developed by Daynix Computing LTD (http://www.daynix.com) | ||
* | ||
* Authors: | ||
* Andrew Melnychenko <andrew@daynix.com> | ||
* | ||
* This work is licensed under the terms of the GNU GPL, version 2 or | ||
* later. See the COPYING file in the top-level directory. | ||
*/ | ||
|
||
#ifndef EBPF_H | ||
#define EBPF_H | ||
|
||
struct Error; | ||
|
||
void ebpf_register_binary_data(int id, const void *data, | ||
size_t datalen); | ||
const void *ebpf_find_binary_by_id(int id, size_t *sz, | ||
struct Error **errp); | ||
|
||
#define ebpf_binary_init(id, fn) \ | ||
static void __attribute__((constructor)) ebpf_binary_init_ ## fn(void) \ | ||
{ \ | ||
size_t datalen = 0; \ | ||
const void *data = fn(&datalen); \ | ||
ebpf_register_binary_data(id, data, datalen); \ | ||
} | ||
|
||
#endif /* EBPF_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
system_ss.add(when: libbpf, if_true: files('ebpf_rss.c'), if_false: files('ebpf_rss-stub.c')) | ||
common_ss.add(when: libbpf, if_true: files('ebpf.c', 'ebpf_rss.c'), if_false: files('ebpf_rss-stub.c')) |
Oops, something went wrong.