#
4b307a8e |
| 06-May-2016 |
David S. Miller <davem@davemloft.net> |
Merge branch 'bpf-direct-pkt-access'
Alexei Starovoitov says:
==================== bpf: introduce direct packet access
This set of patches introduce 'direct packet access' from cls_bpf and act_bpf
Merge branch 'bpf-direct-pkt-access'
Alexei Starovoitov says:
==================== bpf: introduce direct packet access
This set of patches introduce 'direct packet access' from cls_bpf and act_bpf programs (which are root only).
Current bpf programs use LD_ABS, LD_INS instructions which have to do 'if (off < skb_headlen)' for every packet access. It's ok for socket filters, but too slow for XDP, since single LD_ABS insn consumes 3% of cpu. Therefore we have to amortize the cost of length check over multiple packet accesses via direct access to skb->data, data_end pointers.
The existing packet parser typically look like: if (load_half(skb, offsetof(struct ethhdr, h_proto)) != ETH_P_IP) return 0; if (load_byte(skb, ETH_HLEN + offsetof(struct iphdr, protocol)) != IPPROTO_UDP || load_byte(skb, ETH_HLEN) != 0x45) return 0; ... with 'direct packet access' the bpf program becomes: void *data = (void *)(long)skb->data; void *data_end = (void *)(long)skb->data_end; struct eth_hdr *eth = data; struct iphdr *iph = data + sizeof(*eth);
if (data + sizeof(*eth) + sizeof(*iph) + sizeof(*udp) > data_end) return 0; if (eth->h_proto != htons(ETH_P_IP)) return 0; if (iph->protocol != IPPROTO_UDP || iph->ihl != 5) return 0; ... which is more natural to write and significantly faster. See patch 6 for performance tests: 21Mpps(old) vs 24Mpps(new) with just 5 loads. For more complex parsers the performance gain is higher.
The other approach implemented in [1] was adding two new instructions to interpreter and JITs and was too hard to use from llvm side. The approach presented here doesn't need any instruction changes, but the verifier has to work harder to check safety of the packet access.
Patch 1 prepares the code and Patch 2 adds new checks for direct packet access and all of them are gated with 'env->allow_ptr_leaks' which is true for root only. Patch 3 improves search pruning for large programs. Patch 4 wires in verifier's changes with net/core/filter side. Patch 5 updates docs Patches 6 and 7 add tests.
[1] https://git.kernel.org/cgit/linux/kernel/git/ast/bpf.git/?h=ld_abs_dw ====================
Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
65d472fb |
| 05-May-2016 |
Alexei Starovoitov <ast@fb.com> |
samples/bpf: add 'pointer to packet' tests
parse_simple.c - packet parser exapmle with single length check that filters out udp packets for port 9
parse_varlen.c - variable length parser that under
samples/bpf: add 'pointer to packet' tests
parse_simple.c - packet parser exapmle with single length check that filters out udp packets for port 9
parse_varlen.c - variable length parser that understand multiple vlan headers, ipip, ipip6 and ip options to filter out udp or tcp packets on port 9. The packet is parsed layer by layer with multitple length checks.
parse_ldabs.c - classic style of packet parsing using LD_ABS instruction. Same functionality as parse_simple.
simple = 24.1Mpps per core varlen = 22.7Mpps ldabs = 21.4Mpps
Parser with LD_ABS instructions is slower than full direct access parser which does more packet accesses and checks.
These examples demonstrate the choice bpf program authors can make between flexibility of the parser vs speed.
Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: openbmc-20160505-1 |
|
#
e8c8ce54 |
| 05-May-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc6' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
#
f3391a16 |
| 05-May-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc6' into x86/cpu, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
Revision tags: v4.4.9 |
|
#
3d277b17 |
| 04-May-2016 |
Mark Brown <broonie@kernel.org> |
Merge tag 'v4.6-rc5' into spi-rockchip
Linux 4.6-rc5
|
#
d63c214b |
| 04-May-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc6' into x86/platform, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
#
bc0868c6 |
| 03-May-2016 |
Mark Brown <broonie@kernel.org> |
Merge branch 'for-4.7/pwm-regulator' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm into regulator-pwm
|
#
b33f39e9 |
| 03-May-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc6' into ras/core, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
#
0ce8428b |
| 02-May-2016 |
Mark Brown <broonie@kernel.org> |
Merge tag 'asoc-fix-v4.6-rc5' into asoc-intel
ASoC: Fixes for v4.6
This is a fairly large collection of fixes but almost all driver specific ones, especially to the new Intel drivers which have had
Merge tag 'asoc-fix-v4.6-rc5' into asoc-intel
ASoC: Fixes for v4.6
This is a fairly large collection of fixes but almost all driver specific ones, especially to the new Intel drivers which have had a lot of recent development. The one core fix is a change to the debugfs code to avoid crashes in some relatively unusual configurations.
show more ...
|
#
68af062b |
| 02-May-2016 |
Mauro Carvalho Chehab <mchehab@osg.samsung.com> |
Merge tag 'v4.6-rc6' into patchwork
Linux 4.6-rc6
* tag 'v4.6-rc6': (762 commits) Linux 4.6-rc6 EDAC: i7core, sb_edac: Don't return NOTIFY_BAD from mce_decoder callback Documentation/sysctl/v
Merge tag 'v4.6-rc6' into patchwork
Linux 4.6-rc6
* tag 'v4.6-rc6': (762 commits) Linux 4.6-rc6 EDAC: i7core, sb_edac: Don't return NOTIFY_BAD from mce_decoder callback Documentation/sysctl/vm.txt: update numa_zonelist_order description lib/stackdepot.c: allow the stack trace hash to be zero rapidio: fix potential NULL pointer dereference mm/memory-failure: fix race with compound page split/merge ocfs2/dlm: return zero if deref_done message is successfully handled Ananth has moved kcov: don't profile branches in kcov kcov: don't trace the code coverage code mm: wake kcompactd before kswapd's short sleep .mailmap: add Frank Rowand mm/hwpoison: fix wrong num_poisoned_pages accounting mm: call swap_slot_free_notify() with page lock held mm: vmscan: reclaim highmem zone if buffer_heads is over limit numa: fix /proc/<pid>/numa_maps for THP mm/huge_memory: replace VM_NO_THP VM_BUG_ON with actual VMA check mailmap: fix Krzysztof Kozlowski's misspelled name thp: keep huge zero page pinned until tlb flush mm: exclude HugeTLB pages from THP page_mapped() logic ...
show more ...
|
#
638af178 |
| 29-Apr-2016 |
David S. Miller <davem@davemloft.net> |
Merge branch 'samples-bpf-user-experience'
Jesper Dangaard Brouer says:
==================== samples/bpf: Improve user experience
It is a steep learning curve getting started with using the eBPF e
Merge branch 'samples-bpf-user-experience'
Jesper Dangaard Brouer says:
==================== samples/bpf: Improve user experience
It is a steep learning curve getting started with using the eBPF examples in samples/bpf/. There are several dependencies, and specific versions of these dependencies. Invoking make in the correct manor is also slightly obscure.
This patchset cleanup, document and hopefully improves the first time user experience with the eBPF samples directory by auto-detecting certain scenarios.
V4: - Address Naveen's nitpicks - Handle/fail if extra args are passed in LLC or CLANG (David Laight)
V3: - Add Alexei's ACKs - Remove README paragraph about LLVM experimental BPF target as it only existed between LLVM version 3.6 to 3.7.
V2: - Adjusted recommend minimum versions to 3.7.1 - Included clang build instructions - New patch adding CLANG variable and validation of command ====================
Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
bdefbbf2 |
| 28-Apr-2016 |
Jesper Dangaard Brouer <brouer@redhat.com> |
samples/bpf: like LLC also verify and allow redefining CLANG command
Users are likely to manually compile both LLVM 'llc' and 'clang' tools. Thus, also allow redefining CLANG and verify command exi
samples/bpf: like LLC also verify and allow redefining CLANG command
Users are likely to manually compile both LLVM 'llc' and 'clang' tools. Thus, also allow redefining CLANG and verify command exist.
Makefile implementation wise, the target that verify the command have been generalized.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
b62a796c |
| 28-Apr-2016 |
Jesper Dangaard Brouer <brouer@redhat.com> |
samples/bpf: allow make to be run from samples/bpf/ directory
It is not intuitive that 'make' must be run from the top level directory with argument "samples/bpf/" to compile these eBPF samples.
In
samples/bpf: allow make to be run from samples/bpf/ directory
It is not intuitive that 'make' must be run from the top level directory with argument "samples/bpf/" to compile these eBPF samples.
Introduce a kbuild make file trick that allow make to be run from the "samples/bpf/" directory itself. It basically change to the top level directory and call "make samples/bpf/" with the "/" slash after the directory name.
Also add a clean target that only cleans this directory, by taking advantage of the kbuild external module setting M=$PWD.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
7b01dd57 |
| 28-Apr-2016 |
Jesper Dangaard Brouer <brouer@redhat.com> |
samples/bpf: Makefile verify LLVM compiler avail and bpf target is supported
Make compiling samples/bpf more user friendly, by detecting if LLVM compiler tool 'llc' is available, and also detect if
samples/bpf: Makefile verify LLVM compiler avail and bpf target is supported
Make compiling samples/bpf more user friendly, by detecting if LLVM compiler tool 'llc' is available, and also detect if the 'bpf' target is available in this version of LLVM.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
6ccfba75 |
| 28-Apr-2016 |
Jesper Dangaard Brouer <brouer@redhat.com> |
samples/bpf: add back functionality to redefine LLC command
It is practical to be-able-to redefine the location of the LLVM command 'llc', because not all distros have a LLVM version with bpf target
samples/bpf: add back functionality to redefine LLC command
It is practical to be-able-to redefine the location of the LLVM command 'llc', because not all distros have a LLVM version with bpf target support. Thus, it is sometimes required to compile LLVM from source, and sometimes it is not desired to overwrite the distros default LLVM version.
This feature was removed with 128d1514be35 ("samples/bpf: Use llc in PATH, rather than a hardcoded value").
Add this features back. Note that it is possible to redefine the LLC on the make command like:
make samples/bpf/ LLC=~/git/llvm/build/bin/llc
Fixes: 128d1514be35 ("samples/bpf: Use llc in PATH, rather than a hardcoded value") Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
af9cc93c |
| 27-Apr-2016 |
Takashi Iwai <tiwai@suse.de> |
Merge tag 'asoc-fix-v4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.6
This is a fairly large collection of fixes but almost all driver spe
Merge tag 'asoc-fix-v4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.6
This is a fairly large collection of fixes but almost all driver specific ones, especially to the new Intel drivers which have had a lot of recent development. The one core fix is a change to the debugfs code to avoid crashes in some relatively unusual configurations.
show more ...
|
#
1cbc99df |
| 25-Apr-2016 |
Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
Merge back cpufreq changes for v4.7.
|
#
84eaae15 |
| 23-Apr-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc4' into sched/core, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
#
49047962 |
| 21-Apr-2016 |
Dave Airlie <airlied@redhat.com> |
Merge tag 'v4.6-rc3' into drm-next
Backmerge 4.6-rc3 for i915.
Linux 4.6-rc3
|
Revision tags: v4.4.8 |
|
#
6666ea55 |
| 19-Apr-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc4' into x86/asm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
#
5614e772 |
| 18-Apr-2016 |
Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
Merge 4.6-rc4 into driver-core-next
We want those fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
#
7553c7e6 |
| 18-Apr-2016 |
Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
Merge 4.6-rc4 into char-misc-next
We want the fixes in there to build off of for other dependant patches.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
#
9938b044 |
| 18-Apr-2016 |
Jiri Kosina <jkosina@suse.cz> |
Merge branch 'master' into for-next
Sync with Linus' tree so that patches against newer codebase can be applied.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
#
889fac6d |
| 13-Apr-2016 |
Ingo Molnar <mingo@kernel.org> |
Merge tag 'v4.6-rc3' into perf/core, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
Revision tags: v4.4.7 |
|
#
39702853 |
| 11-Apr-2016 |
Daniel Vetter <daniel.vetter@ffwll.ch> |
Merge tag 'v4.6-rc3' into drm-intel-next-queued
Linux 4.6-rc3
Backmerge requested by Chris Wilson to make his patches apply cleanly. Tiny conflict in vmalloc.c with the (properly acked and all) pat
Merge tag 'v4.6-rc3' into drm-intel-next-queued
Linux 4.6-rc3
Backmerge requested by Chris Wilson to make his patches apply cleanly. Tiny conflict in vmalloc.c with the (properly acked and all) patch in drm-intel-next:
commit 4da56b99d99e5a7df2b7f11e87bfea935f909732 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Apr 4 14:46:42 2016 +0100
mm/vmap: Add a notifier for when we run out of vmap address space
and Linus' tree.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
show more ...
|