Skip to content

Commit 43b4524

Browse files
Jakub Kicinskidavem330
authored andcommitted
nfp: bpf: fall back to core NIC app if BPF not selected
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2c4197a commit 43b4524

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

drivers/net/ethernet/netronome/nfp/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ nfp-objs := \
2727
nfp_net_sriov.o \
2828
nfp_netvf_main.o \
2929
nfp_port.o \
30-
bpf/main.o \
31-
bpf/offload.o \
3230
nic/main.o
3331

3432
ifeq ($(CONFIG_NFP_APP_FLOWER),y)
@@ -44,6 +42,8 @@ endif
4442

4543
ifeq ($(CONFIG_BPF_SYSCALL),y)
4644
nfp-objs += \
45+
bpf/main.o \
46+
bpf/offload.o \
4747
bpf/verifier.o \
4848
bpf/jit.o
4949
endif

drivers/net/ethernet/netronome/nfp/bpf/offload.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ nfp_net_bpf_offload_prepare(struct nfp_net *nn,
150150
unsigned int max_mtu;
151151
int ret;
152152

153-
if (!IS_ENABLED(CONFIG_BPF_SYSCALL))
154-
return -EOPNOTSUPP;
155-
156153
ret = nfp_net_bpf_get_act(nn, cls_bpf);
157154
if (ret < 0)
158155
return ret;

drivers/net/ethernet/netronome/nfp/nfp_app.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444

4545
static const struct nfp_app_type *apps[] = {
4646
[NFP_APP_CORE_NIC] = &app_nic,
47+
#ifdef CONFIG_BPF_SYSCALL
4748
[NFP_APP_BPF_NIC] = &app_bpf,
49+
#else
50+
[NFP_APP_BPF_NIC] = &app_nic,
51+
#endif
4852
#ifdef CONFIG_NFP_APP_FLOWER
4953
[NFP_APP_FLOWER_NIC] = &app_flower,
5054
#endif

0 commit comments

Comments
 (0)