bpf: pass translate() as a callback and remove its ndo_bpf subcommand

As part of the transition from ndo_bpf() to callbacks attached to struct
bpf_offload_dev for some of the eBPF offload operations, move the
functions related to code translation to the struct and remove the
subcommand that was used to call them through the NDO.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Quentin Monnet
2018-11-09 13:03:29 +00:00
committed by Alexei Starovoitov
parent 00db12c3d1
commit b07ade27e9
5 changed files with 21 additions and 22 deletions

View File

@@ -863,7 +863,6 @@ enum bpf_netdev_command {
XDP_QUERY_PROG,
XDP_QUERY_PROG_HW,
/* BPF program for offload callbacks, invoked at program load time. */
BPF_OFFLOAD_TRANSLATE,
BPF_OFFLOAD_DESTROY,
BPF_OFFLOAD_MAP_ALLOC,
BPF_OFFLOAD_MAP_FREE,
@@ -890,7 +889,7 @@ struct netdev_bpf {
/* flags with which program was installed */
u32 prog_flags;
};
/* BPF_OFFLOAD_TRANSLATE, BPF_OFFLOAD_DESTROY */
/* BPF_OFFLOAD_DESTROY */
struct {
struct bpf_prog *prog;
} offload;