]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: simplify definition of BPF_FIB_LOOKUP related flags
authorMartynas Pumputis <m@lambda.lt>
Wed, 12 Jun 2019 16:05:40 +0000 (18:05 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 13 Jun 2019 20:43:42 +0000 (22:43 +0200)
commitfe3b09483fa4225e66898f6f8b501332e46ac431
treec91b7b613437b4bc0a99679ae7d801f3638d62ab
parentc9430a502adcc9fd0a3a803d38b9d38ccdbad99c
bpf: simplify definition of BPF_FIB_LOOKUP related flags

Previously, the BPF_FIB_LOOKUP_{DIRECT,OUTPUT} flags in the BPF UAPI
were defined with the help of BIT macro. This had the following issues:

- In order to use any of the flags, a user was required to depend
  on <linux/bits.h>.
- No other flag in bpf.h uses the macro, so it seems that an unwritten
  convention is to use (1 << (nr)) to define BPF-related flags.

Fixes: 7778ae3366be ("bpf: Provide helper to do forwarding lookups in kernel FIB table")
Signed-off-by: Martynas Pumputis <m@lambda.lt>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/uapi/linux/bpf.h