bpf: fix implicit declaration of bpf_prog_add
Subsystems (4)
PATCH 1/1 bpf: fix implicit declaration of bpf_prog_add
For the ifndef case of CONFIG_BPF_SYSCALL, an inline version of bpf_prog_add needs to exist otherwise the build breaks on some configs.
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:2544:10: error: implicit declaration of function 'bpf_prog_add'
prog = bpf_prog_add(prog, priv->rx_ring_num - 1);
The function is introduced in59d3656d5bf50 ("bpf: add bpf_prog_add api for bulk prog refcnt") and first used in47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program").
--- include/linux/bpf.h | 4 ++++ 1 file changed, 4 insertions(+)
include/linux/bpf.h +4 -0
@@ -289,6 +289,10 @@ static inline struct bpf_prog *bpf_prog_get_type(u32 ufd, {return ERR_PTR (-EOPNOTSUPP ); } +static inline struct bpf_prog *bpf_prog_add (struct bpf_prog *prog,int i) +{ +return ERR_PTR (-EOPNOTSUPP ); +}static inline void bpf_prog_put (struct bpf_prog *prog) {
Signature · 1 line
2.8.2
Quoted 11 lines · Brenden Blanco
For the ifndef case of
CONFIG_BPF_SYSCALL, an inline version ofbpf_prog_addneeds to exist otherwise the build breaks on some configs.
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:2544:10: error: implicit declaration of function 'bpf_prog_add'prog = bpf_prog_add(prog, priv->rx_ring_num - 1);The function is introduced in
59d3656d5bf50("bpf: addbpf_prog_addapi for bulk prog refcnt") and first used in47f1afdba2b87("net/mlx4_en: add support for fast rx drop bpf program").
Quoted 4 lines
Fixes 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program")Reported-by kbuild test robot <[email protected]>Reported-by Tariq Toukan <[email protected]>Signed-off-by Brenden Blanco <[email protected]>
From: Brenden Blanco <[email protected]>
Date: Wed, 20 Jul 2016 07:55:52 -0700
Quoted 11 lines
For the ifndef case of
CONFIG_BPF_SYSCALL, an inline version ofbpf_prog_addneeds to exist otherwise the build breaks on some configs.
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:2544:10: error: implicit declaration of function 'bpf_prog_add'prog = bpf_prog_add(prog, priv->rx_ring_num - 1);The function is introduced in
59d3656d5bf50("bpf: addbpf_prog_addapi for bulk prog refcnt") and first used in47f1afdba2b87("net/mlx4_en: add support for fast rx drop bpf program").
Quoted 4 lines
Fixes 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program")Reported-by kbuild test robot <[email protected]>Reported-by Tariq Toukan <[email protected]>Signed-off-by Brenden Blanco <[email protected]>
Applied.