-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: fix error handling for invoke_tailcall_if() #26118
bpf: fix error handling for invoke_tailcall_if() #26118
Conversation
/test |
Bit of a funky fail in the runtime tests (#26150), re-running. |
/test-runtime |
invoke_tailcall_if() either inlines the target function, or calls it via tail-call. In the inline variant, the `return` causes us to skip over any subsequent error handling (eg drop notification) in the caller. Rework the macro so that it properly assigns the `ret` value. Suggested-by: Anton Protopopov <aspsk@isovalent.com> Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
If the invoked function is inlined, it can return error that we need to handle. If the function is tail-called, we still need to handle the DROP_MISSED_TAIL_CALL. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
e2ecc6a
to
2c0f922
Compare
/test |
Picked up @aspsk's suggestion on how to build the macro, rebased. Also fixed up one user of the macro. |
@julianwiedmann Backporting the changes in this PR to v1.13 yields conflicts as they depend on changes made in #23831, which was not backported to v1.13. I'm not competent enough in BPF to fully understand what's going on, can you double-check if it's OK to backport #23831 to v1.13? |
Yep, v1.13 has less occurences of But I see @tklauser has already decided how to progress, I'll queue up a backport PR then 😁 . |
Was just about to write a reply 😄 Also happy to incorporate the patch in a 1.13 backport this week if it's reasonably easy. But I guess @julianwiedmann will have more context doing it. |
invoke_tailcall_if()
either inlines the target function, or calls it viatail-call. In the inline variant, the
return
causes us to skip over anysubsequent error handling (eg drop notification) in the caller.
Rework the macro so that it properly assigns the
ret
value.Also fix up one user that didn't handle returned errors.