Replies: 4 comments 4 replies
-
As I mentioned on discord, this is not the root cause. I know it can seem like it's the root cause, because if you remove the array then things work, but the actual problem is something else. The error you get is about a register spill, which means that because your code is complex, LLVM runs out of available registers, tries to spill some on the stack, and in particular it tries to do a 1-byte spill which is not allowed by the verifier (only 8-bytes spills are allowed). |
Beta Was this translation helpful? Give feedback.
-
This structure will have 2 bytes of padding at the end, which is a problem. Try making ifindex u32.
How are you creating |
Beta Was this translation helpful? Give feedback.
-
Hi @alessandrod, thanks for your reply!
I tried making
// get the backends available for the combination vip/port
let backends_list = unsafe { BACKENDS.get(&key) }.ok_or(TC_ACT_OK)?;
let mut new_backends: BackendsList = BackendsList {
backends: backends_list.backends,
index: backends_list.index + 1,
n_elements: backends_list.n_elements
};
if new_backends.index > new_backends.backends.len() - 1 {
new_backends.index = 0;
} |
Beta Was this translation helpful? Give feedback.
-
My thoughts are: yes!
So many things we should add to the book, this is one of them. In general I think it'd be good to document idiomatic ways to do things, and things to avoid.
Only regarding this specific issue, there are so many things that can be improved:
|
Beta Was this translation helpful? Give feedback.
-
In the context of writing a PR for blixt, I encountered the following eBPF verifier error:
Here is the full eBPF verifier error: eBPF_verifier_error.log
After a few trials, I figured out that the root cause of the error is the update of a hashmap shared between the user and kernel space:
Such a map is allocated with:
and the map value is structured as follows:
The following are my attempts to figure out the root cause of the problem, along with the discoveries:
unsafe { BACKENDS.insert(&key, &new_backends, 0) };
does not solve the issue.backends
array length to 1,2,4, whatever, does not solve the issue.Backend
fields but one (so that the struct only contains au16
field) does not solve the issue.backends
field of theBackendList
to an array ofu16
solves the issue.After my attempts, I wondered: is it possible to have an array of structs as a field of hashmap value? If yes, most likely, I'm missing something.
Beta Was this translation helpful? Give feedback.
All reactions