filter: introduce SKF_AD_VLAN_TPID BPF extension
authorMichal Sekletar <msekleta@redhat.com>
Tue, 24 Mar 2015 13:48:41 +0000 (14:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2015 19:25:15 +0000 (15:25 -0400)
commit27cd5452476978283decb19e429e81fc6c71e74b
treea147d4576190e18580589e6faaf08e1b7050ef2d
parentf6bb76cd4d8552bada1e454c291419f893e1af7b
filter: introduce SKF_AD_VLAN_TPID BPF extension

If vlan offloading takes place then vlan header is removed from frame
and its contents, both vlan_tci and vlan_proto, is available to user
space via TPACKET interface. However, only vlan_tci can be used in BPF
filters.

This commit introduces a new BPF extension. It makes possible to load
the value of vlan_proto (vlan TPID) to register A. Support for classic
BPF and eBPF is being added, analogous to skb->protocol.

Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Michal Sekletar <msekleta@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/filter.txt
include/linux/filter.h
include/uapi/linux/bpf.h
include/uapi/linux/filter.h
net/core/filter.c
tools/net/bpf_exp.l
tools/net/bpf_exp.y