]> git.baikalelectronics.ru Git - kernel.git/commit
ebpf: add sched_act_type and map it to sk_filter's verifier ops
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 20 Mar 2015 14:11:11 +0000 (15:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Mar 2015 23:10:44 +0000 (19:10 -0400)
commit7d3e172290fde20ab88646bb37f6a5e820983236
tree826896381fcc68c6178122c6d098c00729bcbe60
parentf680e9bd88d4f3efb69ce38b64309c58c239e19b
ebpf: add sched_act_type and map it to sk_filter's verifier ops

In order to prepare eBPF support for tc action, we need to add
sched_act_type, so that the eBPF verifier is aware of what helper
function act_bpf may use, that it can load skb data and read out
currently available skb fields.

This is bascially analogous to d90b04d2b8e9 ("ebpf: add sched_cls_type
and map it to sk_filter's verifier ops").

BPF_PROG_TYPE_SCHED_CLS and BPF_PROG_TYPE_SCHED_ACT need to be
separate since both will have a different set of functionality in
future (classifier vs action), thus we won't run into ABI troubles
when the point in time comes to diverge functionality from the
classifier.

The future plan for act_bpf would be that it will be able to write
into skb->data and alter selected fields mirrored in struct __sk_buff.

For an initial support, it's sufficient to map it to sk_filter_ops.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Pirko <jiri@resnulli.us>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/bpf.h
kernel/bpf/verifier.c
net/core/filter.c