linux/drivers/net
Alexei Starovoitov 7ae457c1e5 net: filter: split 'struct sk_filter' into socket and bpf parts
clean up names related to socket filtering and bpf in the following way:
- everything that deals with sockets keeps 'sk_*' prefix
- everything that is pure BPF is changed to 'bpf_*' prefix

split 'struct sk_filter' into
struct sk_filter {
	atomic_t        refcnt;
	struct rcu_head rcu;
	struct bpf_prog *prog;
};
and
struct bpf_prog {
        u32                     jited:1,
                                len:31;
        struct sock_fprog_kern  *orig_prog;
        unsigned int            (*bpf_func)(const struct sk_buff *skb,
                                            const struct bpf_insn *filter);
        union {
                struct sock_filter      insns[0];
                struct bpf_insn         insnsi[0];
                struct work_struct      work;
        };
};
so that 'struct bpf_prog' can be used independent of sockets and cleans up
'unattached' bpf use cases

split SK_RUN_FILTER macro into:
    SK_RUN_FILTER to be used with 'struct sk_filter *' and
    BPF_PROG_RUN to be used with 'struct bpf_prog *'

__sk_filter_release(struct sk_filter *) gains
__bpf_prog_release(struct bpf_prog *) helper function

also perform related renames for the functions that work
with 'struct bpf_prog *', since they're on the same lines:

sk_filter_size -> bpf_prog_size
sk_filter_select_runtime -> bpf_prog_select_runtime
sk_filter_free -> bpf_prog_free
sk_unattached_filter_create -> bpf_prog_create
sk_unattached_filter_destroy -> bpf_prog_destroy
sk_store_orig_filter -> bpf_prog_store_orig_filter
sk_release_orig_filter -> bpf_release_orig_filter
__sk_migrate_filter -> bpf_migrate_filter
__sk_prepare_filter -> bpf_prepare_filter

API for attaching classic BPF to a socket stays the same:
sk_attach_filter(prog, struct sock *)/sk_detach_filter(struct sock *)
and SK_RUN_FILTER(struct sk_filter *, ctx) to execute a program
which is used by sockets, tun, af_packet

API for 'unattached' BPF programs becomes:
bpf_prog_create(struct bpf_prog **)/bpf_prog_destroy(struct bpf_prog *)
and BPF_PROG_RUN(struct bpf_prog *, ctx) to execute a program
which is used by isdn, ppp, team, seccomp, ptp, xt_bpf, cls_bpf, test_bpf

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-08-02 15:03:58 -07:00
..
appletalk
arcnet net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
bonding bonding: fix a memory leak in bond_arp_send_all() 2014-07-28 17:27:47 -07:00
caif net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-30 13:25:49 -07:00
cris eth_v10: remove unnecessary break after return 2014-07-20 21:29:49 -07:00
dsa net: dsa: update DSA drivers to use ds_to_priv 2014-04-30 13:31:25 -04:00
ethernet net: stmmac: Support devicetree configs for mcast and ucast filter entries 2014-07-31 14:13:29 -07:00
fddi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-16 14:09:34 -07:00
hamradio net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-30 13:25:49 -07:00
ieee802154 net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
irda drivers/net/irda/kingsun-sir.c: remove null test before kfree 2014-06-19 21:26:06 -07:00
phy net: libphy: Add stubs to hook IEEE MMD Register reads and writes 2014-07-30 20:00:21 -07:00
plip
ppp net: filter: split 'struct sk_filter' into socket and bpf parts 2014-08-02 15:03:58 -07:00
slip net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
team net: filter: split 'struct sk_filter' into socket and bpf parts 2014-08-02 15:03:58 -07:00
usb AX88179_178A: Add ethtool ops for EEE support 2014-07-31 22:07:38 -07:00
vmxnet3 vmxnet3: adjust ring sizes when interface is down 2014-06-16 21:26:40 -07:00
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-22 00:44:59 -07:00
wimax net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
wireless Merge tag 'master-2014-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next 2014-07-28 17:36:25 -07:00
xen-netback Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-22 00:44:59 -07:00
dummy.c net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
eql.c net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
ifb.c net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
Kconfig vxlan: Call udp_sock_create 2014-07-14 16:12:15 -07:00
LICENSE.SRC
loopback.c net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-11 16:02:55 -07:00
macvtap.c mactap: Fix checksum errors for non-gso packets in bridge mode 2014-04-30 16:12:22 -04:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c net: use ethtool_cmd_speed_set helper to set ethtool speed value 2014-06-06 16:24:07 -07:00
rionet.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sb1000.c
Space.c
sungem_phy.c
tun.c net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
veth.c net: rtnetlink - make create_link take name_assign_type 2014-07-15 16:13:07 -07:00
virtio_net.c virtio-net: rx busy polling support 2014-07-23 15:12:02 -07:00
vxlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-07-30 13:25:49 -07:00
xen-netfront.c xen-netfront: call netif_carrier_off() only once when disconnecting 2014-07-08 11:21:03 -07:00