Skip to content

Commit

Permalink
nfp: bpf: fall back to core NIC app if BPF not selected
Browse files Browse the repository at this point in the history
If kernel config does not include BPF just replace the BPF
app handler with the handler for basic NIC.  The BPF app
will now be built only if BPF infrastructure is selected
in kernel config.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Nov 2, 2017
1 parent 2c4197a commit 43b4524
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/netronome/nfp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ nfp-objs := \
nfp_net_sriov.o \
nfp_netvf_main.o \
nfp_port.o \
bpf/main.o \
bpf/offload.o \
nic/main.o

ifeq ($(CONFIG_NFP_APP_FLOWER),y)
Expand All @@ -44,6 +42,8 @@ endif

ifeq ($(CONFIG_BPF_SYSCALL),y)
nfp-objs += \
bpf/main.o \
bpf/offload.o \
bpf/verifier.o \
bpf/jit.o
endif
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/netronome/nfp/bpf/offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ nfp_net_bpf_offload_prepare(struct nfp_net *nn,
unsigned int max_mtu;
int ret;

if (!IS_ENABLED(CONFIG_BPF_SYSCALL))
return -EOPNOTSUPP;

ret = nfp_net_bpf_get_act(nn, cls_bpf);
if (ret < 0)
return ret;
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/ethernet/netronome/nfp/nfp_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@

static const struct nfp_app_type *apps[] = {
[NFP_APP_CORE_NIC] = &app_nic,
#ifdef CONFIG_BPF_SYSCALL
[NFP_APP_BPF_NIC] = &app_bpf,
#else
[NFP_APP_BPF_NIC] = &app_nic,
#endif
#ifdef CONFIG_NFP_APP_FLOWER
[NFP_APP_FLOWER_NIC] = &app_flower,
#endif
Expand Down

0 comments on commit 43b4524

Please sign in to comment.