aboutsummaryrefslogtreecommitdiff
path: root/ebpf/ebpf_rss.h
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2024-10-23 09:51:00 +0100
committerJason Wang <jasowang@redhat.com>2024-10-28 14:37:25 +0800
commit00b69f1d867ddcf8884c92f5647b424088e754e4 (patch)
tree3f53103f187c3861380a18fba5fa216f6937037d /ebpf/ebpf_rss.h
parent31efce1e311830431718536c6461815b04e08bf9 (diff)
downloadqemu-00b69f1d867ddcf8884c92f5647b424088e754e4.zip
qemu-00b69f1d867ddcf8884c92f5647b424088e754e4.tar.gz
qemu-00b69f1d867ddcf8884c92f5647b424088e754e4.tar.bz2
ebpf: add formal error reporting to all APIs
The eBPF code is currently reporting error messages through trace events. Trace events are fine for debugging, but they are not to be considered the primary error reporting mechanism, as their output is inaccessible to callers. This adds an "Error **errp" parameter to all methods which have important error scenarios to report to the caller. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'ebpf/ebpf_rss.h')
-rw-r--r--ebpf/ebpf_rss.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/ebpf/ebpf_rss.h b/ebpf/ebpf_rss.h
index 239242b..86a5787 100644
--- a/ebpf/ebpf_rss.h
+++ b/ebpf/ebpf_rss.h
@@ -14,6 +14,8 @@
#ifndef QEMU_EBPF_RSS_H
#define QEMU_EBPF_RSS_H
+#include "qapi/error.h"
+
#define EBPF_RSS_MAX_FDS 4
struct EBPFRSSContext {
@@ -41,13 +43,15 @@ void ebpf_rss_init(struct EBPFRSSContext *ctx);
bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx);
-bool ebpf_rss_load(struct EBPFRSSContext *ctx);
+bool ebpf_rss_load(struct EBPFRSSContext *ctx, Error **errp);
bool ebpf_rss_load_fds(struct EBPFRSSContext *ctx, int program_fd,
- int config_fd, int toeplitz_fd, int table_fd);
+ int config_fd, int toeplitz_fd, int table_fd,
+ Error **errp);
bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
- uint16_t *indirections_table, uint8_t *toeplitz_key);
+ uint16_t *indirections_table, uint8_t *toeplitz_key,
+ Error **errp);
void ebpf_rss_unload(struct EBPFRSSContext *ctx);