#include #include #include #include #include "bpf_helpers.h" struct bpf_map_def SEC("maps") my_map = { .type = BPF_MAP_TYPE_ARRAY, .key_size = sizeof(u32), .value_size = sizeof(long), .max_entries = 256, }; SEC("socket1") int bpf_prog1(struct __sk_buff *skb) { int index = load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)); long *value; if (skb->pkt_type != PACKET_OUTGOING) return 0; value = bpf_map_lookup_elem(&my_map, &index); if (value) __sync_fetch_and_add(value, skb->len); return 0; } char _license[] SEC("license") = "GPL"; >
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-01-05 20:29:36 +1000
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-05 09:40:16 -0800
commit9e3596b0c6539e28546ff7c72a06576627068353 (patch)
tree1c150c70bb2f1d2d3960f48c06eebe2d63078e1e /include/dt-bindings/reset/ti-syscon.h
parentae30ab4cd711a147cafaf5674c333c5a84fe53fb (diff)
kbuild: initramfs cleanup, set target from Kconfig
Rather than keep a list of all possible compression types in the Makefile, set the target explicitly from Kconfig. Reviewed-by: Francisco Blas Izquierdo Riera (klondike) <klondike@klondike.es> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/dt-bindings/reset/ti-syscon.h')