Re: [PATCH iproute2 -next] examples: bpf: fix ld offs to have same prog loaded on ingress/egress

2015-04-20 Thread Alexei Starovoitov
On 4/20/15 4:48 AM, Daniel Borkmann wrote: Fix up the eBPF example program to match our kernel fix in a166151cbe33 (bpf: fix bpf helpers to use skb-mac_header relative offsets). Tested on ingress and egress paths. Signed-off-by: Daniel Borkmann dan...@iogearbox.net Cc: Alexei Starovoitov

[RFC 2/3] tc: deprecate TC_ACT_QUEUED

2015-04-21 Thread Alexei Starovoitov
TC_ACT_QUEUED was always an alias of TC_ACT_STOLEN. Get rid of redundant checks in all qdiscs. Instead do it once. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/uapi/linux/pkt_cls.h |2 +- net/sched/sch_api.c |2 ++ net/sched/sch_atm.c |1 - net

[RFC 3/3] tc: cleanup tc_classify

2015-04-21 Thread Alexei Starovoitov
introduce tc_classify_act() and qdisc_drop_bypass() helper functions to reduce copy-paste among different qdiscs Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/net/pkt_sched.h |2 ++ include/net/sch_generic.h |7 +++ net/sched/sch_api.c | 20

[RFC 1/3] tc: fix return values of ingress qdisc

2015-04-21 Thread Alexei Starovoitov
ingress qdisc should return NET_XMIT_* values just like all other qdiscs. Since it's invoked via qdisc_enqueue_root() (which suppose to return only NET_XMIT_* values as well), it was working by accident, since TC_ACT_* values fit within NET_XMIT_MASK. Signed-off-by: Alexei Starovoitov

[RFC 0/3] tc cleanup?

2015-04-21 Thread Alexei Starovoitov
. Alexei Starovoitov (3): tc: fix return values of ingress qdisc tc: deprecate TC_ACT_QUEUED tc: cleanup tc_classify include/net/pkt_sched.h |2 ++ include/net/sch_generic.h|7 +++ include/uapi/linux/pkt_cls.h |2 +- net/core/dev.c |8 ++-- net

Re: [RFC 2/3] tc: deprecate TC_ACT_QUEUED

2015-04-23 Thread Alexei Starovoitov
On 4/23/15 1:45 PM, Jamal Hadi Salim wrote: 1) the _XMIT semantics are useful on the egress side because in fact we do have queues and they can be attached to qdiscs etc. The TC_ACT_XXX codes were _intentional_ since ingress works as a classifier shell. then it is worse mess than I thought :(

Re: [RFC 2/3] tc: deprecate TC_ACT_QUEUED

2015-04-23 Thread Alexei Starovoitov
On 4/23/15 3:51 PM, Jamal Hadi Salim wrote: So you are planning to add queues? If you are that is a different discussion (and the use case needs some clarity). nope. I wasn't planning to do that. For packets being forwarded we already had egress qdiscs which had queues so it didnt seem to

Re: [RFC 2/3] tc: deprecate TC_ACT_QUEUED

2015-04-22 Thread Alexei Starovoitov
On 4/22/15 4:39 PM, Cong Wang wrote: On Wed, Apr 22, 2015 at 3:22 PM, Alexei Starovoitov a...@plumgrid.com wrote: On 4/21/15 10:02 PM, Cong Wang wrote: On Tue, Apr 21, 2015 at 12:27 PM, Alexei Starovoitov a...@plumgrid.com wrote: TC_ACT_QUEUED was always an alias of TC_ACT_STOLEN. Get rid

Re: [RFC 2/3] tc: deprecate TC_ACT_QUEUED

2015-04-22 Thread Alexei Starovoitov
On 4/21/15 10:02 PM, Cong Wang wrote: On Tue, Apr 21, 2015 at 12:27 PM, Alexei Starovoitov a...@plumgrid.com wrote: TC_ACT_QUEUED was always an alias of TC_ACT_STOLEN. Get rid of redundant checks in all qdiscs. Instead do it once. The current code can be easily extended, while your code

Re: [RFC 1/3] tc: fix return values of ingress qdisc

2015-04-22 Thread Alexei Starovoitov
On 4/21/15 9:59 PM, Cong Wang wrote: On Tue, Apr 21, 2015 at 12:27 PM, Alexei Starovoitov a...@plumgrid.com wrote: ingress qdisc should return NET_XMIT_* values just like all other qdiscs. XMIT already means egress... may be then it should be renamed as well. from include/linux/netdevice.h

Re: [RFC 3/3] tc: cleanup tc_classify

2015-04-22 Thread Alexei Starovoitov
On 4/21/15 10:05 PM, Cong Wang wrote: On Tue, Apr 21, 2015 at 12:27 PM, Alexei Starovoitov a...@plumgrid.com wrote: introduce tc_classify_act() and qdisc_drop_bypass() helper functions to reduce copy-paste among different qdiscs I don't think qdisc_drop_bypass() is more readable than without

[PATCH RFC net-next] netif_receive_skb performance

2015-04-28 Thread Alexei Starovoitov
] fib_validate_source After I'm done with ingress qdisc improvements, I'm planning to look at netif_receive_skb itself, since it looks a bit too hot. Alexei Starovoitov (1): pktgen: introduce 'rx' mode net/core/pktgen.c | 30 -- 1 file changed, 28 insertions(+), 2

[PATCH RFC net-next] pktgen: introduce 'rx' mode

2015-04-28 Thread Alexei Starovoitov
(20656167360bps) errors: 1000 Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- net/core/pktgen.c | 30 -- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 508155b283dd..4f6c56bca550 100644 --- a/net

Re: [PATCH iproute2 -master] tc: {m,f}_ebpf: add option for dumping verifier log

2015-04-28 Thread Alexei Starovoitov
...@iogearbox.net Cc: Alexei Starovoitov a...@plumgrid.com ... @@ -284,8 +287,11 @@ static int bpf_prog_attach(enum bpf_prog_type type, const struct bpf_insn *insns { int prog_fd = bpf_prog_load(type, insns, size, license); - if (prog_fd 0) - bpf_dump_error(BPF program

[PATCH net] bpf: fix 64-bit divide

2015-04-27 Thread Alexei Starovoitov
to be attached to sockets) Reported-by: Michael Holzheu holz...@linux.vnet.ibm.com Acked-by: Daniel Borkmann dan...@iogearbox.net Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- The bug is old and sneaked in during the very first eBPF code drop: Fixes: bd4cf0ed331a (net: filter: rework/optimize

Re: [PATCH RFC net-next] netif_receive_skb performance

2015-04-29 Thread Alexei Starovoitov
On 4/28/15 10:23 PM, Eric Dumazet wrote: On Tue, 2015-04-28 at 19:11 -0700, Alexei Starovoitov wrote: Hi, there were many requests for performance numbers in the past, but not everyone has access to 10/40G nics and we need a common way to talk about RX path performance without overhead

Re: [PATCH 6/6] net: move qdisc ingress filtering on top of netfilter ingress hooks

2015-04-30 Thread Alexei Starovoitov
On Thu, Apr 30, 2015 at 06:05:37AM +0200, Patrick McHardy wrote: 06:05:37AM do you ever sleep? ;) For the sake of completeness - on ingress, this alternativ means simply ditching TC. I'm sure 'ditching TC' doesn't mean to kill ingress qdisc completely. Compatibility needs to be preserved.

Re: [PATCH net-next 4/4] seccomp, filter: add and use bpf_prog_create_from_user from seccomp

2015-05-06 Thread Alexei Starovoitov
. Signed-off-by: Daniel Borkmann dan...@iogearbox.net Cc: Nicolas Schichan nschic...@freebox.fr Cc: Alexei Starovoitov a...@plumgrid.com Cc: Kees Cook keesc...@chromium.org Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body

Re: [PATCH 2/2 net-next] net: move qdisc ingress filtering code where it belongs

2015-05-10 Thread Alexei Starovoitov
On 5/10/15 10:59 AM, Pablo Neira Ayuso wrote: On Sun, May 10, 2015 at 10:45:42AM -0700, Alexei Starovoitov wrote: On 5/10/15 9:59 AM, Pablo Neira Ayuso wrote: The qdisc ingress filtering code is embedded into the core most likely because at that time we had no RCU in place to define a hook

Re: [PATCH 2/2 net-next] net: move qdisc ingress filtering code where it belongs

2015-05-10 Thread Alexei Starovoitov
On 5/10/15 12:00 PM, Pablo Neira Ayuso wrote: The inlined code into the ingress core path seems to have an impact to people that don't need this, even with the static key. two emails ago you've accused me of non-technical comments and now I've posted real numbers that show no impact on users

Re: [PATCH net-next] test_bpf: add 173 new testcases for eBPF

2015-05-12 Thread Alexei Starovoitov
On 5/12/15 12:58 AM, Daniel Borkmann wrote: On 05/12/2015 07:22 AM, Alexei Starovoitov wrote: From: Michael Holzheu holz...@linux.vnet.ibm.com From: Michael Holzheu holz...@linux.vnet.ibm.com 'From' tag somehow slipped in twice for some reason. Downloading the mbox and applying it shows

Re: [PATCH net-next] pktgen: fix packet generation

2015-05-12 Thread Alexei Starovoitov
On 5/12/15 1:19 AM, Jesper Dangaard Brouer wrote: On Mon, 11 May 2015 15:19:48 -0700 Alexei Starovoitov a...@plumgrid.com wrote: pkt_gen-last_ok was not set properly, so after the first burst pktgen instead of allocating new packet, will reuse old one, advance eth_type_trans further, which

Re: [PATCH net] bpf: fix verifier memory corruption

2015-04-15 Thread Alexei Starovoitov
On 4/15/15 8:59 AM, Hannes Frederic Sowa wrote: On Di, 2015-04-14 at 15:57 -0700, Alexei Starovoitov wrote: Due to missing bounds check the DAG pass of the BPF verifier can corrupt the memory which can cause random crashes during program loading: [8.449451] BUG: unable to handle kernel paging

Re: [PATCH 0/7 RFC] Netfilter/nf_tables ingress support

2015-04-15 Thread Alexei Starovoitov
On Wed, Apr 15, 2015 at 12:35:16AM -0700, John Fastabend wrote: I'll dig up my scripts and post them to github this weekend. They are a bit organized and all over the place at the moment. Maybe we can build a master repository. I know there a lot of different scripts running around, for

[PATCH net] bpf: fix bpf helpers to use skb-mac_header relative offsets

2015-04-15 Thread Alexei Starovoitov
bpf_skb_clone_unwritable() to test for unwriteable headers. Reference: http://thread.gmane.org/gmane.linux.network/359129/focus=359694 Fixes: 608cd71a9c7c (tc: bpf: generalize pedit action) Fixes: 91bc4822c3d6 (tc: bpf: add checksum helpers) Signed-off-by: Alexei Starovoitov a...@plumgrid.com Signed-off

[PATCH net] bpf: fix two bugs in verification logic when accessing 'ctx' pointer

2015-04-15 Thread Alexei Starovoitov
programs access skb fields) Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- I would love to add the testcase for bug#1 as well, but it needs bigger refactoring of test_verifier, so will do it after net-next reopens. kernel/bpf/verifier.c |9 +++-- samples/bpf/test_verifier.c

Re: [PATCH iproute2 -next] tc: built-in eBPF exec proxy

2015-04-16 Thread Alexei Starovoitov
in the fashion of std{in,out,err} for read/write access, for example in case of iproute2's examples/bpf/: Amazing that it worked. Acked-by: Alexei Starovoitov a...@plumgrid.com +static void bpf_map_set_env(int *tfd) +{ + char key[64], *val; + int i; + for (i = 0; i BPF_MAP_ID_MAX; i

Re: act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Alexei Starovoitov
On Fri, Apr 17, 2015 at 10:15:01AM +0800, Herbert Xu wrote: seems the cleaner fix will be to push skb-mac_len instead? No skb-mac_len is the same as skb2-dev-hard_header_len. hmm. please help me understand the problem then. In the commit log you mentioned that your vlan dev and ifb have

Re: act_mirred: Fix bogus header when redirecting from VLAN

2015-04-16 Thread Alexei Starovoitov
On Fri, Apr 17, 2015 at 09:02:16AM +0800, Herbert Xu wrote: @@ -105,7 +105,7 @@ static void ri_tasklet(unsigned long dev) if (from AT_EGRESS) { dev_queue_xmit(skb); } else if (from AT_INGRESS) { - skb_pull(skb,

Re: [v2] act_mirred: Fix bogus header when redirecting from VLAN

2015-04-17 Thread Alexei Starovoitov
interpreted as part of the MAC address. This patch fixes this by only pushing skb-mac_len. We also need to fix ifb because it tries to undo the pushing done by act_mirred. Signed-off-by: Herbert Xu herb...@gondor.apana.org.au Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe

Re: [PATCH net-next] ip: Add color output option

2015-04-17 Thread Alexei Starovoitov
On Fri, Apr 17, 2015 at 04:02:02PM +0300, Mathias Nyman wrote: It is hard to quickly find what you are looking for in the output of the ip command. Color helps. This patch adds a '-c' flag to highlight these with individual colors: - interface name - ip addresse - mac addresse -

Re: [PATCH net-next 2/4] x86: bpf_jit: implement bpf_tail_call() helper

2015-05-20 Thread Alexei Starovoitov
On 5/20/15 9:05 AM, Andy Lutomirski wrote: What causes the stack pointer to be right? Is there some reason that the stack pointer is the same no matter where you are in the generated code? that's why I said 'it's _roughly_ expressed in C' this way. Stack pointer doesn't change. It uses the

Re: [PATCH net] net: sched: fix call_rcu() race on classifier module unloads

2015-05-20 Thread Alexei Starovoitov
. +1 indeed unregister_tcf_proto_ops() is only called at module unload time. So there is no overhead from this rcu_barrier(). It's actually mandatory. All modules with rcu callbacks should do that. Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line

[PATCH v2 net-next 1/2] bpf: make programs see skb-data == L2 for ingress and egress

2015-06-04 Thread Alexei Starovoitov
: a166151cbe33 (bpf: fix bpf helpers to use skb-mac_header relative offsets) Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- new V1-V2: fixed u32-bool and added a check for CONFIG_NET_CLS_ACT This patch is on top of 'fix build due to tc_verd': http://patchwork.ozlabs.org/patch/480783/ Earlier

[PATCH v2 net-next 2/2] bpf: allow programs to write to certain skb fields

2015-06-04 Thread Alexei Starovoitov
fields of 'struct __sk_buff' are readable to socket and tc_cls_act progs. mark, tc_index are writeable from tc_cls_act only. cb[0]-cb[4] are writeable by both sockets and tc_cls_act. Add verifier tests and improve sample code. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- v1-v2: no changes

[PATCH net-next] s390/bpf: implement bpf_tail_call() helper

2015-06-08 Thread Alexei Starovoitov
...@linux.vnet.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/s390/net/bpf_jit.h | 10 +++- arch/s390/net/bpf_jit_comp.c | 106 +- 2 files changed, 112 insertions(+), 4 deletions(-) diff --git

Re: iproute2: missing patches in branch net-next

2015-06-05 Thread Alexei Starovoitov
On Fri, May 29, 2015 at 01:15:03AM +0200, Daniel Borkmann wrote: On 05/29/2015 01:12 AM, Stephen Hemminger wrote: ... I will go back and recreate what is missing. Sorry for the confusion. Great thanks, no problem. ping. Daniel's tc-bpf man page is still missing in iproute2 net-next... --

[PATCH net-next] bpf: introduce bpf_clone_redirect() helper

2015-06-02 Thread Alexei Starovoitov
, to load balance skbs into veths, split parts of the traffic to local taps, etc. Signed-off-by: Alexei Starovoitov a...@plumgrid.com Acked-by: Daniel Borkmann dan...@iogearbox.net --- include/uapi/linux/bpf.h | 10 ++ net/core/filter.c| 40

[PATCH net-next] bpf: fix build due to missing tc_verd

2015-06-04 Thread Alexei Starovoitov
...@gmail.com Reported-by: Fengguang Wu fengguang...@intel.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- net/core/filter.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 64c121c09655..09b2062eb5b8 100644 --- a/net/core

Re: [PATCH 0/6] MIPS/BPF fixes for 4.3

2015-06-04 Thread Alexei Starovoitov
On 6/4/15 3:56 AM, Markos Chandras wrote: Here are some fixes for MIPS/BPF. The first 5 patches do some cleanup and lay the groundwork for the final one which introduces assembly helpers for MIPS and MIPS64. The goal is to speed up certain operations that do not need to go through the common C

Re: [net-next:master 264/272] net/core/filter.c:1429:2: note: in expansion of macro 'if'

2015-06-04 Thread Alexei Starovoitov
On 6/4/15 3:01 AM, kbuild test robot wrote: tree:git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: c39c4c6abb89d24454b63798ccbae12b538206a5 commit: 3896d655f4d491c67d669a15f275a39f713410f8 [264/272] bpf: introduce bpf_clone_redirect() helper config:

Re: [PATCH net-next] bpf: introduce bpf_clone_redirect() helper

2015-06-04 Thread Alexei Starovoitov
On 6/3/15 11:45 PM, Or Gerlitz wrote: On Thu, Jun 4, 2015 at 6:17 AM, David Miller da...@davemloft.net wrote: From: Alexei Starovoitov a...@plumgrid.com Date: Tue, 2 Jun 2015 16:03:14 -0700 Allow eBPF programs attached to classifier/actions to call bpf_clone_redirect(skb, ifindex, flags

[PATCH net-next 1/2] bpf: make programs see skb-data == L2 for ingress and egress

2015-06-03 Thread Alexei Starovoitov
: a166151cbe33 (bpf: fix bpf helpers to use skb-mac_header relative offsets) Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- Earlier versions were trying to do too much to make ingress and egress qdisc consistent for all classifiers and actions or had too big of a scope of push/pull: v1: http

[PATCH net-next 2/2] bpf: allow programs to write to certain skb fields

2015-06-03 Thread Alexei Starovoitov
fields of 'struct __sk_buff' are readable to socket and tc_cls_act progs. mark, tc_index are writeable from tc_cls_act only. cb[0]-cb[4] are writeable by both sockets and tc_cls_act. Add verifier tests and improve sample code. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- This patch

Re: [PATCH] lib: test_bpf: purge CPP register redefinitions

2015-06-22 Thread Alexei Starovoitov
On Sun, Jun 21, 2015 at 09:41:03PM +0200, Nicolai Stange wrote: Fix compilation failer with allmodconfig on ARCH=um: lib/test_bpf.c:50:0: warning: R8 redefined #define R8 BPF_REG_8 ^ In file included from arch/um/include/asm/ptrace-generic.h:11:0, from

Re: [PATCH v2] bpf: BPF based latency tracing

2015-06-19 Thread Alexei Starovoitov
changed, 206 insertions(+) create mode 100644 samples/bpf/lathist_kern.c create mode 100644 samples/bpf/lathist_user.c Thanks. That's a useful example. Acked-by: Alexei Starovoitov a...@plumgrid.com Dave, this patch is for net-next and I hope it's not too late for this merge window

Re: [PATCH v2] bpf: fix a bug in verification logic when SUB operation taken on FRAME_PTR

2015-06-18 Thread Alexei Starovoitov
On Thu, Jun 18, 2015 at 08:31:45AM +, Wang Nan wrote: Original code has a problem, cause following code failed to pass verifier: r1 - r10 r1 -= 8 r2 = 8 r3 = unsafe pointer call BPF_FUNC_probe_read -- R1 type=inv expected=fp However, by replacing 'r1 -= 8' to 'r1 += -8' the

Re: [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking

2015-06-16 Thread Alexei Starovoitov
On 6/16/15 2:19 AM, Daniel Borkmann wrote: if you really want to, you could go via skb-sk-sk_socket-file and then retrieve credentials from there for egress side (you can have a look at xt_owner). You'd need a different *_proto helper for tc in that case, which would then map to

[PATCH net-next 2/3] bpf: allow networking programs to use bpf_trace_printk() for debugging

2015-06-12 Thread Alexei Starovoitov
bpf_trace_printk() is a helper function used to debug eBPF programs. Let socket and TC programs use it as well. Note, it's DEBUG ONLY helper. If it's used in the program, the kernel will print warning banner to make sure users don't use it in production. Signed-off-by: Alexei Starovoitov

[PATCH net-next 0/3] bpf: share helpers between tracing and networking

2015-06-12 Thread Alexei Starovoitov
Introduce new helpers to access 'struct task_struct'-pid, tgid, uid, gid, comm fields in tracing and networking. Share bpf_trace_printk() and bpf_get_smp_processor_id() helpers between tracing and networking. Alexei Starovoitov (3): bpf: introduce current-pid, tgid, uid, gid, comm accessors

Re: [PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
On 6/12/15 3:08 PM, Andy Lutomirski wrote: On Fri, Jun 12, 2015 at 2:40 PM, Alexei Starovoitov a...@plumgrid.com wrote: eBPF programs attached to kprobes need to filter based on current-pid, uid and other fields, so introduce helper functions: u64 bpf_get_current_pid_tgid(void) Return: current

[PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
*buf, int size_of_buf) stores current-comm into buf They can be used from the programs attached to TC as well to classify packets based on current task fields. Update tracex2 example to print histogram of write syscalls for each process instead of aggregated for all. Signed-off-by: Alexei

[PATCH net-next 3/3] bpf: let kprobe programs use bpf_get_smp_processor_id() helper

2015-06-12 Thread Alexei Starovoitov
It's useful to do per-cpu histograms. Suggested-by: Daniel Wagner daniel.wag...@bmw-carit.de Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- kernel/trace/bpf_trace.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index

Re: [PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
On 6/12/15 3:54 PM, Andy Lutomirski wrote: On Fri, Jun 12, 2015 at 3:44 PM, Alexei Starovoitov a...@plumgrid.com wrote: On 6/12/15 3:08 PM, Andy Lutomirski wrote: On Fri, Jun 12, 2015 at 2:40 PM, Alexei Starovoitov a...@plumgrid.com wrote: eBPF programs attached to kprobes need to filter

Re: [PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
On 6/12/15 4:25 PM, Andy Lutomirski wrote: It's a dangerous tool. Also, shouldn't the returned uid match the namespace of the task that installed the probe, not the task that's being probed? so leaking info to unprivileged apps is the concern? The whole thing is for root only as you know. The

Re: [PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
On 6/12/15 4:47 PM, Andy Lutomirski wrote: On Fri, Jun 12, 2015 at 4:38 PM, Alexei Starovoitov a...@plumgrid.com wrote: On 6/12/15 4:25 PM, Andy Lutomirski wrote: It's a dangerous tool. Also, shouldn't the returned uid match the namespace of the task that installed the probe, not the task

Re: [PATCH net-next 2/2] flow_dissector: add support for dst, hop-by-hop and routing ext hdrs

2015-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2015 at 06:37:34PM -0700, Eric Dumazet wrote: On Fri, 2015-06-12 at 18:27 -0700, Alexei Starovoitov wrote: On Fri, Jun 12, 2015 at 09:01:06AM -0700, Tom Herbert wrote: If dst, hop-by-hop or routing extension headers are present determine length of the options and skip over

[PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking

2015-06-12 Thread Alexei Starovoitov
v1-v2: switched to init_user_ns from current_user_ns as suggested by Andy Introduce new helpers to access 'struct task_struct'-pid, tgid, uid, gid, comm fields in tracing and networking. Share bpf_trace_printk() and bpf_get_smp_processor_id() helpers between tracing and networking. Alexei

[PATCH v2 net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
*buf, int size_of_buf) stores current-comm into buf They can be used from the programs attached to TC as well to classify packets based on current task fields. Update tracex2 example to print histogram of write syscalls for each process instead of aggregated for all. Signed-off-by: Alexei

Re: [PATCH net-next 2/2] flow_dissector: add support for dst, hop-by-hop and routing ext hdrs

2015-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2015 at 07:11:16PM -0700, Eric Dumazet wrote: On Fri, 2015-06-12 at 18:50 -0700, Alexei Starovoitov wrote: sure, that's better. If you're going to submit it officialy, please add my Tested-by. My server is happy now :) Sure , will do. I tried adding __must_check

[PATCH v2 net-next 3/3] bpf: let kprobe programs use bpf_get_smp_processor_id() helper

2015-06-12 Thread Alexei Starovoitov
It's useful to do per-cpu histograms. Suggested-by: Daniel Wagner daniel.wag...@bmw-carit.de Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- v1-v2: no changes kernel/trace/bpf_trace.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace

[PATCH v2 net-next 2/3] bpf: allow networking programs to use bpf_trace_printk() for debugging

2015-06-12 Thread Alexei Starovoitov
bpf_trace_printk() is a helper function used to debug eBPF programs. Let socket and TC programs use it as well. Note, it's DEBUG ONLY helper. If it's used in the program, the kernel will print warning banner to make sure users don't use it in production. Signed-off-by: Alexei Starovoitov

Re: [PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
On 6/12/15 5:03 PM, Andy Lutomirski wrote: On Fri, Jun 12, 2015 at 4:55 PM, Alexei Starovoitov a...@plumgrid.com wrote: On 6/12/15 4:47 PM, Andy Lutomirski wrote: On Fri, Jun 12, 2015 at 4:38 PM, Alexei Starovoitov a...@plumgrid.com wrote: On 6/12/15 4:25 PM, Andy Lutomirski wrote: It's

Re: [PATCH net-next 2/2] flow_dissector: add support for dst, hop-by-hop and routing ext hdrs

2015-06-12 Thread Alexei Starovoitov
On Fri, Jun 12, 2015 at 09:01:06AM -0700, Tom Herbert wrote: If dst, hop-by-hop or routing extension headers are present determine length of the options and skip over them in flow dissection. Signed-off-by: Tom Herbert t...@herbertland.com --- net/core/flow_dissector.c | 17

Re: [PATCH net-next 1/3] bpf: introduce current-pid, tgid, uid, gid, comm accessors

2015-06-12 Thread Alexei Starovoitov
On 6/12/15 5:24 PM, Andy Lutomirski wrote: so what specifically you proposing? Use from_kuid(init_user_ns,...) instead? That seems reasonable to me. After all, you can't install one of these probes from a non-init userns. ok. will respin with that change. -- To unsubscribe from this list:

Re: [PATCH v2 net-next 0/3] bpf: share helpers between tracing and networking

2015-06-15 Thread Alexei Starovoitov
On 6/15/15 4:01 PM, David Miller wrote: Although I agree with the sentiment that this thing can cause surprising results and can be asking for trouble. If someone wants to filter traffic by UID they might make a simple ingress TC ebpf program using these new interfaces and expect it to work.

[PATCH net-next] bpf: disallow bpf tc programs access current-pid,uid

2015-06-15 Thread Alexei Starovoitov
Accessing current-pid/uid from cls_bpf may lead to misleading results and should not be used when TC classifiers need accurate information about pid/uid. Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- net/core/filter.c |6 -- 1 file changed, 6 deletions(-) diff --git a/net/core

[PATCH net-next] bpf: add missing rcu protection when releasing programs from prog_array

2015-05-28 Thread Alexei Starovoitov
) Reported-by: Martin Schwidefsky schwidef...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/linux/bpf.h |6 +- kernel/bpf/arraymap.c |4 ++-- kernel/bpf/syscall.c | 19 ++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git

[PATCH net-next 1/3] s390/bpf: fix stack allocation

2015-05-30 Thread Alexei Starovoitov
...@linux.vnet.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/s390/net/bpf_jit.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/s390/net/bpf_jit.h b/arch/s390/net/bpf_jit.h index ba8593a515ba..de156ba3bd71 100644

[PATCH net-next 2/3] s390/bpf: fix bpf frame pointer setup

2015-05-30 Thread Alexei Starovoitov
(%r15) - save backchain Cc: sta...@vger.kernel.org # 4.0+ Signed-off-by: Michael Holzheu holz...@linux.vnet.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/s390/net/bpf_jit_comp.c | 11 +++ 1 file changed, 7

[PATCH net-next 3/3] s390/bpf: implement bpf_tail_call() helper

2015-05-30 Thread Alexei Starovoitov
...@linux.vnet.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/s390/net/bpf_jit.h | 10 +++- arch/s390/net/bpf_jit_comp.c | 106 +- 2 files changed, 112 insertions(+), 4 deletions(-) diff --git

[PATCH net-next 0/3] s390/bpf: implement bpf_tail_call JIT support

2015-05-30 Thread Alexei Starovoitov
This set is for net-next tree. Patch 3 adds bpf_tail_call() support for s390x JIT. It has a dependency on patches 1 and 2 that will also be submitted to stable via Martin Schwidefsky. Michael Holzheu (3): s390/bpf: fix stack allocation s390/bpf: fix bpf frame pointer setup s390/bpf:

Re: [PATCH net-next 2/2] ebpf: misc core cleanup

2015-05-29 Thread Alexei Starovoitov
() a bit. Signed-off-by: Daniel Borkmann dan...@iogearbox.net bpf_check_tail_call() cleanup is nice. The rest won't hurt ;) Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More

Re: [PATCH net-next] bpf: add missing rcu protection when releasing programs from prog_array

2015-05-29 Thread Alexei Starovoitov
On 5/29/15 2:10 AM, Daniel Borkmann wrote: +static void __prog_put_rcu(struct rcu_head *rcu) +{ +struct bpf_prog_aux *aux = container_of(rcu, struct bpf_prog_aux, rcu); + +free_used_maps(aux); +bpf_prog_free(aux-prog); Not sure if it's worth it to move these two into a common

[PATCH net-next] bpf: allow BPF programs access skb-skb_iif and skb-dev-ifindex fields

2015-05-27 Thread Alexei Starovoitov
' field, since programs triggered by redirected packet need to known the original interface index. Summary: __skb-ifindex - skb-dev-ifindex __skb-ingress_ifindex - skb-skb_iif Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- include/uapi/linux/bpf.h |2 ++ net/core/filter.c

[PATCH net 1/2] s390/bpf: fix stack allocation

2015-06-01 Thread Alexei Starovoitov
-by: Michael Holzheu holz...@linux.vnet.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- Resubmitting against 'net' with proper 'Fixes' tag. arch/s390/net/bpf_jit.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH net 2/2] s390/bpf: fix bpf frame pointer setup

2015-06-01 Thread Alexei Starovoitov
(%r15) - save backchain Fixes: 054623105728 (s390/bpf: Add s390x eBPF JIT compiler backend) Signed-off-by: Michael Holzheu holz...@linux.vnet.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- arch/s390/net/bpf_jit_comp.c | 11

Re: [PATCH net-next 0/3] s390/bpf: implement bpf_tail_call JIT support

2015-06-01 Thread Alexei Starovoitov
On 5/31/15 9:39 PM, David Miller wrote: From: Alexei Starovoitov a...@plumgrid.com Date: Sat, 30 May 2015 10:42:08 -0700 This set is for net-next tree. Patch 3 adds bpf_tail_call() support for s390x JIT. It has a dependency on patches 1 and 2 that will also be submitted to stable via Martin

Re: [PATCH net-next] test_bpf: extend tests for 32-bit endianness conversion

2015-06-30 Thread Alexei Starovoitov
On 6/26/15 8:25 AM, Xi Wang wrote: Currently ALU_END_FROM_BE 32 and ALU_END_FROM_LE 32 do not test if the upper bits of the result are zeros (the arm64 JIT had such bugs). Extend the two tests to catch this. Cc: Alexei Starovoitova...@plumgrid.com Signed-off-by: Xi Wangxi.w...@gmail.com looks

Re: [PATCH net-next 3/6] net_sched: act: make tcfg_pval non zero

2015-07-02 Thread Alexei Starovoitov
On 7/2/15 6:07 AM, Eric Dumazet wrote: First step for gact RCU operation : Instead of testing if tcfg_pval is zero or not, just make it 1. No change in behavior, but slightly faster code. Signed-off-by: Eric Dumazeteduma...@google.com Nice trick! Acked-by: Alexei Starovoitov

Re: [PATCH net-next 6/6] net_sched: act: remove spinlock in fast path

2015-07-02 Thread Alexei Starovoitov
. My host with 8 RX queues was handling 5 Mpps before the patch, and more than 10 Mpps after patch. Signed-off-by: Eric Dumazeteduma...@google.com Great stuff. Thank you for fixing it! Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH net] net_sched: gen_estimator: extend pps limit

2015-07-02 Thread Alexei Starovoitov
4067Mbit 11053596pps backlog 0b 0p requeues 0 Signed-off-by: Eric Dumazeteduma...@google.com Looks good to me. Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH v3 net-next 7/7] net_sched: act_mirred: remove spinlock in fast path

2015-07-06 Thread Alexei Starovoitov
queue capability to ifb device Signed-off-by: Eric Dumazeteduma...@google.com Nice! Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH] samples: bpf: enable trace samples for s390x

2015-07-06 Thread Alexei Starovoitov
. Thanks! Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3 net-next 1/7] net: sched: extend percpu stats helpers

2015-07-06 Thread Alexei Starovoitov
() is renamed to qdisc_qstats_cpu_drop() Signed-off-by: Eric Dumazeteduma...@google.com Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH net-next] ifb: add multiqueue operation

2015-07-06 Thread Alexei Starovoitov
-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH net] x86: bpf_jit: fix compilation of large bpf programs

2015-05-22 Thread Alexei Starovoitov
: filter: Just In Time compiler for x86-64) Reported-by: Daniel Borkmann dan...@iogearbox.net Signed-off-by: Alexei Starovoitov a...@plumgrid.com --- Daniel wrote the 'Edge hopping nuthouse' test case with 4k jump instructions that managed to trigger this bug. The test case is nuts and the bug is real

Re: [PATCH net-next] test_bpf: add more eBPF jump torture cases

2015-05-22 Thread Alexei Starovoitov
! Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH iproute2] tc: bpf: add initial man page

2015-05-21 Thread Alexei Starovoitov
. And, that there's now more incentive for others to also start documenting their classifier and actions as well. ;) Signed-off-by: Daniel Borkmann dan...@iogearbox.net Very well written! Better than a blog :) Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line

[PATCH net-next] test_bpf: Add backward jump test case

2015-05-22 Thread Alexei Starovoitov
From: Michael Holzheu holz...@linux.vnet.ibm.com Currently the testsuite does not have a test case with a backward jump. The s390x JIT (kernel 4.0) had a bug in that area. So add one new test case for this now. Signed-off-by: Michael Holzheu holz...@linux.vnet.ibm.com Signed-off-by: Alexei

Re: [PATCH net-next 1/4] bpf: allow bpf programs to tail-call other bpf programs

2015-05-21 Thread Alexei Starovoitov
On 5/21/15 9:43 AM, Andy Lutomirski wrote: On Thu, May 21, 2015 at 9:40 AM, Alexei Starovoitov a...@plumgrid.com wrote: On 5/21/15 9:20 AM, Andy Lutomirski wrote: What I mean is: why do we need the interface to be look up this index in an array and just to what it references as a single

Re: [PATCH net-next 1/4] bpf: allow bpf programs to tail-call other bpf programs

2015-05-21 Thread Alexei Starovoitov
On 5/21/15 9:20 AM, Andy Lutomirski wrote: What I mean is: why do we need the interface to be look up this index in an array and just to what it references as a single atomic instruction? Can't we break it down into first look up this index in an array and then do this tail call? I've

Re: [PATCH net-next 1/4] bpf: allow bpf programs to tail-call other bpf programs

2015-05-21 Thread Alexei Starovoitov
On 5/21/15 9:57 AM, Andy Lutomirski wrote: On Thu, May 21, 2015 at 9:53 AM, Alexei Starovoitov a...@plumgrid.com wrote: On 5/21/15 9:43 AM, Andy Lutomirski wrote: On Thu, May 21, 2015 at 9:40 AM, Alexei Starovoitov a...@plumgrid.com wrote: On 5/21/15 9:20 AM, Andy Lutomirski wrote: What

Re: [PATCH net-next v2] test_bpf: add similarly conflicting jump test case only for classic

2015-05-26 Thread Alexei Starovoitov
-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: linux-4.2-rc1/samples/bpf/sockex3_kern.c: bad expression ?

2015-07-07 Thread Alexei Starovoitov
On Tue, Jul 07, 2015 at 11:27:55AM +, David Binderman wrote: Hello there, [linux-4.2-rc1/samples/bpf/sockex3_kern.c:268]: (style) Expression '(X 0xf0) == 0x4' is always false. Source code is    if ((verlen 0xF0) == 4) Maybe    if ((verlen 0xF0) == 0x40) oops, yes. Could

Re: [net-next PATCH 1/3] net: make default tx_queue_len configurable

2015-08-11 Thread Alexei Starovoitov
On Tue, Aug 11, 2015 at 06:23:35PM +0200, Phil Sutter wrote: I have an unfinished solution in the oven, but being kept busy with other things for now. The action plan is as follows: 1) Introduce IFF_NO_QUEUE net_device-priv_flag. 2) Have attach_default_qdiscs() and

Re: [PATCH] net: fix wrong skb_get() usage / crash in IGMP/MLD parsing code

2015-08-12 Thread Alexei Starovoitov
...@plumgrid.com Signed-off-by: Linus Lüssing linus.luess...@c0d3.blue I think the fix actually made the code easier to read. Thank you. Looks good to me. Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message

Re: [PATCH net-next v2 1/4] packet: add classic BPF fanout mode

2015-08-15 Thread Alexei Starovoitov
looks good. Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH net-next v2 2/4] packet: add extended BPF fanout mode

2015-08-15 Thread Alexei Starovoitov
returned by bpf(). Signed-off-by: Willem de Bruijnwill...@google.com Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [PATCH v2 net-next 11/13] vxlan: metadata based tunneling for IPv6

2015-08-19 Thread Alexei Starovoitov
+++-- 1 file changed, 40 insertions(+), 29 deletions(-) Looks good. Acked-by: Alexei Starovoitov a...@plumgrid.com -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http

  1   2   3   4   5   6   7   8   9   10   >