diff mbox

bpf: fix implicit declaration of bpf_prog_add

Message ID 1469026552-8975-1-git-send-email-bblanco@plumgrid.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Brenden Blanco July 20, 2016, 2:55 p.m. UTC
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 in
59d3656d5bf50 ("bpf: add bpf_prog_add api for bulk prog refcnt")
and first used in
47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program").

Fixes: 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Tariq Toukan <ttoukan.linux@gmail.com>
Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
---
 include/linux/bpf.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Alexei Starovoitov July 20, 2016, 4:06 p.m. UTC | #1
On Wed, Jul 20, 2016 at 07:55:52AM -0700, Brenden Blanco wrote:
> 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 in
> 59d3656d5bf50 ("bpf: add bpf_prog_add api for bulk prog refcnt")
> and first used in
> 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program").
> 
> Fixes: 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program")
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Reported-by: Tariq Toukan <ttoukan.linux@gmail.com>
> Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>

Acked-by: Alexei Starovoitov <ast@kernel.org>
David Miller July 20, 2016, 6:59 p.m. UTC | #2
From: Brenden Blanco <bblanco@plumgrid.com>
Date: Wed, 20 Jul 2016 07:55:52 -0700

> 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 in
> 59d3656d5bf50 ("bpf: add bpf_prog_add api for bulk prog refcnt")
> and first used in
> 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program").
> 
> Fixes: 47f1afdba2b87 ("net/mlx4_en: add support for fast rx drop bpf program")
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Reported-by: Tariq Toukan <ttoukan.linux@gmail.com>
> Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>

Applied.
diff mbox

Patch

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 75a5ae6..36da074 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -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)
 {