OSDN Git Service

bpf: Clarify data_len param in bpf_snprintf and bpf_seq_printf comments
authorDave Marchevsky <davemarchevsky@fb.com>
Fri, 17 Sep 2021 18:29:11 +0000 (11:29 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Sep 2021 21:02:06 +0000 (14:02 -0700)
commita42effb0b24fcaf49513c2d7d77ef6daa9e32a6f
tree86bb0e923e0af391d62cc3f2d74cb0f44e7c1880
parent7606729fe24e163923430a5df9d50a246b22d287
bpf: Clarify data_len param in bpf_snprintf and bpf_seq_printf comments

Since the data_len in these two functions is a byte len of the preceding
u64 *data array, it must always be a multiple of 8. If this isn't the
case both helpers error out, so let's make the requirement explicit so
users don't need to infer it.

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210917182911.2426606-10-davemarchevsky@fb.com
include/uapi/linux/bpf.h
tools/include/uapi/linux/bpf.h