提交 43b45245 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

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: NJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: NSimon Horman <simon.horman@netronome.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2c4197a0
...@@ -27,8 +27,6 @@ nfp-objs := \ ...@@ -27,8 +27,6 @@ nfp-objs := \
nfp_net_sriov.o \ nfp_net_sriov.o \
nfp_netvf_main.o \ nfp_netvf_main.o \
nfp_port.o \ nfp_port.o \
bpf/main.o \
bpf/offload.o \
nic/main.o nic/main.o
ifeq ($(CONFIG_NFP_APP_FLOWER),y) ifeq ($(CONFIG_NFP_APP_FLOWER),y)
...@@ -44,6 +42,8 @@ endif ...@@ -44,6 +42,8 @@ endif
ifeq ($(CONFIG_BPF_SYSCALL),y) ifeq ($(CONFIG_BPF_SYSCALL),y)
nfp-objs += \ nfp-objs += \
bpf/main.o \
bpf/offload.o \
bpf/verifier.o \ bpf/verifier.o \
bpf/jit.o bpf/jit.o
endif endif
......
...@@ -150,9 +150,6 @@ nfp_net_bpf_offload_prepare(struct nfp_net *nn, ...@@ -150,9 +150,6 @@ nfp_net_bpf_offload_prepare(struct nfp_net *nn,
unsigned int max_mtu; unsigned int max_mtu;
int ret; int ret;
if (!IS_ENABLED(CONFIG_BPF_SYSCALL))
return -EOPNOTSUPP;
ret = nfp_net_bpf_get_act(nn, cls_bpf); ret = nfp_net_bpf_get_act(nn, cls_bpf);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -44,7 +44,11 @@ ...@@ -44,7 +44,11 @@
static const struct nfp_app_type *apps[] = { static const struct nfp_app_type *apps[] = {
[NFP_APP_CORE_NIC] = &app_nic, [NFP_APP_CORE_NIC] = &app_nic,
#ifdef CONFIG_BPF_SYSCALL
[NFP_APP_BPF_NIC] = &app_bpf, [NFP_APP_BPF_NIC] = &app_bpf,
#else
[NFP_APP_BPF_NIC] = &app_nic,
#endif
#ifdef CONFIG_NFP_APP_FLOWER #ifdef CONFIG_NFP_APP_FLOWER
[NFP_APP_FLOWER_NIC] = &app_flower, [NFP_APP_FLOWER_NIC] = &app_flower,
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册