Message ID | 20230911194731.286342-1-sdf@google.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 7cb779a6867fea00b4209bcf6de2f178a743247d |
Delegated to: | BPF |
Headers | show |
Series | [bpf-next,v2,1/2] bpf: clarify error expectations from bpf_clone_redirect | expand |
Hello: This series was applied to bpf/bpf.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Mon, 11 Sep 2023 12:47:30 -0700 you wrote: > Commit 151e887d8ff9 ("veth: Fixing transmit return status for dropped > packets") exposed the fact that bpf_clone_redirect is capable of > returning raw NET_XMIT_XXX return codes. > > This is in the conflict with its UAPI doc which says the following: > "0 on success, or a negative error in case of failure." > > [...] Here is the summary with links: - [bpf-next,v2,1/2] bpf: clarify error expectations from bpf_clone_redirect https://git.kernel.org/bpf/bpf/c/7cb779a6867f - [bpf-next,v2,2/2] selftests/bpf: update bpf_clone_redirect expected return code https://git.kernel.org/bpf/bpf/c/b772b70b6904 You are awesome, thank you!
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 73b155e52204..5f13db15a3c7 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -1969,7 +1969,9 @@ union bpf_attr { * performed again, if the helper is used in combination with * direct packet access. * Return - * 0 on success, or a negative error in case of failure. + * 0 on success, or a negative error in case of failure. Positive + * error indicates a potential drop or congestion in the target + * device. The particular positive error codes are not defined. * * u64 bpf_get_current_pid_tgid(void) * Description diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 73b155e52204..5f13db15a3c7 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -1969,7 +1969,9 @@ union bpf_attr { * performed again, if the helper is used in combination with * direct packet access. * Return - * 0 on success, or a negative error in case of failure. + * 0 on success, or a negative error in case of failure. Positive + * error indicates a potential drop or congestion in the target + * device. The particular positive error codes are not defined. * * u64 bpf_get_current_pid_tgid(void) * Description
Commit 151e887d8ff9 ("veth: Fixing transmit return status for dropped packets") exposed the fact that bpf_clone_redirect is capable of returning raw NET_XMIT_XXX return codes. This is in the conflict with its UAPI doc which says the following: "0 on success, or a negative error in case of failure." Update the UAPI to reflect the fact that bpf_clone_redirect can return positive error numbers, but don't explicitly define their meaning. Reported-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Stanislav Fomichev <sdf@google.com> --- include/uapi/linux/bpf.h | 4 +++- tools/include/uapi/linux/bpf.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)