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>
This commit is contained in:
Daniel P. Berrangé 2024-10-23 09:51:00 +01:00 committed by Jason Wang
parent 31efce1e31
commit 00b69f1d86
4 changed files with 64 additions and 20 deletions

View file

@ -23,19 +23,21 @@ bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx)
return false;
}
bool ebpf_rss_load(struct EBPFRSSContext *ctx)
bool ebpf_rss_load(struct EBPFRSSContext *ctx, Error **errp)
{
return false;
}
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)
{
return false;
}
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)
{
return false;
}