diff options
author | Stanislav Fomichev <sdf@google.com> | 2023-09-11 12:47:30 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii.nakryiko@gmail.com> | 2023-09-15 15:57:14 -0700 |
commit | aa44abfdd21c36254f5bb1e758095d0531091637 (patch) | |
tree | 54ae28ab4944c624740ecabd7ff3051c2ae02f6e | |
parent | 6070b1bdcff0a8728b73ebd5738ec0d9db0a4192 (diff) | |
download | libbpf-aa44abfdd21c36254f5bb1e758095d0531091637.tar.gz |
bpf: Clarify error expectations from bpf_clone_redirect
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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230911194731.286342-1-sdf@google.com
-rw-r--r-- | include/uapi/linux/bpf.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 73b155e..5f13db1 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 |