I am currently creating a XDP program where I have a bunch of function calls and, as such, the stack gets fuller as the program is executed.
However, I am confused as to how the stack size is measured. For example, lets say that I call the following function:
function_test(&value_a);
And value_a is the address of an instance of the following structure: (I’m skipping value5 to value99)
struct struct_test {
__u64 value;
__u64 value1;
__u64 value2;
__u64 value3;
__u64 value4;
...
__u64 value100;
};
And, even if I pass the address of an instance of this structure, eBPF verifier announces that the program exceeds the limit of the stack. Why is that?
I’m aware that using per-cpu array might be a good way to store these large values that can be passed between functions, but I’d prefer to have as little lookups as possible.