Re: [iovisor-dev] [PATCH, BPF 1/5] BPF: Use a provisional ELF e_machine value

2016-06-15 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 15, 2016 at 2:37 PM, Richard Henderson via iovisor-dev wrote: > This same value for EM_BPF is being propagated to glibc, > elfutils, and binutils. great! Can you share the link to glibc and the other patches? > diff --git a/include/llvm/Support/ELF.h b/include/llvm/Support/ELF.h > in

Re: [iovisor-dev] [PATCH, BPF 2/5] BPF: Rearrange instruction classes

2016-06-15 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 15, 2016 at 2:37 PM, Richard Henderson via iovisor-dev wrote: > Avoid duplicating lots of field definitions. > > Signed-off-by: Richard Henderson > --- > lib/Target/BPF/BPFInstrFormats.td | 45 +++- > lib/Target/BPF/BPFInstrInfo.td| 536 > +++---

Re: [iovisor-dev] [PATCH, BPF 4/5] BPF: Add 32-bit move patterns

2016-06-15 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 15, 2016 at 2:37 PM, Richard Henderson via iovisor-dev wrote: > Since all 32-bit operations zero-extend, the move operations are > immediately usable for loading unsigned constants and zero-extension. > > Signed-off-by: Richard Henderson > --- > lib/Target/BPF/BPFInstrInfo.td | 39 ++

Re: [iovisor-dev] [PATCH, BPF 5/5] BPF: Add 32-bit and pattern

2016-06-15 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 15, 2016 at 2:37 PM, Richard Henderson via iovisor-dev wrote: > We can represent a 64-bit AND with unsigned immediate > with a 32-bit AND opcode. > > Signed-off-by: Richard Henderson > --- > lib/Target/BPF/BPFInstrInfo.td | 15 +++ > 1 file changed, 15 insertions(+) > > d

Re: [iovisor-dev] [PATCH, BPF 4/5] BPF: Add 32-bit move patterns

2016-06-16 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 16, 2016 at 10:28 AM, Richard Henderson wrote: > On 06/15/2016 10:38 PM, Alexei Starovoitov wrote: >> but before we go too far with new asm syntax like 'movw', >> Do you want to revamp the whole thing? >> imo the kernel verifier asm output is easier to read >> due to being C-like and n

Re: [iovisor-dev] [PATCH, BPF 5/5] BPF: Add 32-bit and pattern

2016-06-16 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 16, 2016 at 10:42 AM, Richard Henderson wrote: > On 06/15/2016 10:41 PM, Alexei Starovoitov wrote: >> Do you have further optimizations that take advantage of 32-bit >> subregisters and zero extension? >> Should it be added in more generic way instead of pattern match? > > This is the

Re: [iovisor-dev] Fwd: Re: Request ELF e_machine number for Linux BPF

2016-06-20 Thread Alexei Starovoitov via iovisor-dev
On Mon, Jun 20, 2016 at 10:17 AM, Richard Henderson via iovisor-dev wrote: > Well, that was quick. thanks! > Would someone from the iovisor project like to be the official contact for > this? Otherwise I'll give them contact details for Red Hat. can probably put my name or something generic li

Re: [iovisor-dev] Failed to run sockex2 and sockex3 at latest samples/bpf/

2016-06-21 Thread Alexei Starovoitov via iovisor-dev
On Tue, Jun 21, 2016 at 11:03 AM, William Tu via iovisor-dev wrote: > Hi, > > I'm trying to run sockex2 and sockex3 but got the error: > [root@vm-dev bpf]# ./sockex2 > failed to create a map: 1 Operation not permitted > > Then I found that I have max locked memory set to 64K, after reconfig > to u

Re: [iovisor-dev] Assertion fails at samples/bpf/test_maps

2016-06-21 Thread Alexei Starovoitov via iovisor-dev
On Tue, Jun 21, 2016 at 11:48 AM, William Tu via iovisor-dev wrote: > Hi, > > I'm running test_maps under net-next/samples/bpf/, commit > 601009780635. The code logic all make sense but I got the assertion > errors / coredump for some unknown reason under different compiler > optimization flags (-

Re: [iovisor-dev] XDP summit agenda

2016-06-22 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 22, 2016 at 3:21 AM, Jesper Dangaard Brouer via iovisor-dev wrote: > > On Tue, 21 Jun 2016 18:25:14 -0700 > Tom Herbert via iovisor-dev wrote: > >> Here is an agenda for the XDP summit. We expect this to be a lot of >> interactive conversation so the agenda can be dynamic as needed! >

Re: [iovisor-dev] Assertion fails at samples/bpf/test_maps

2016-06-22 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 22, 2016 at 8:54 AM, Jesper Dangaard Brouer wrote: > On Tue, 21 Jun 2016 18:54:53 -0700 > Alexei Starovoitov wrote: > >> On Tue, Jun 21, 2016 at 11:48 AM, William Tu via iovisor-dev >> wrote: >> > Hi, >> > >> > I'm running test_maps under net-next/samples/bpf/, commit >> > 6010097806

Re: [iovisor-dev] Assertion fails at samples/bpf/test_maps

2016-06-22 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 22, 2016 at 9:52 AM, Jesper Dangaard Brouer wrote: > On Wed, 22 Jun 2016 08:59:14 -0700 > Alexei Starovoitov wrote: > >> On Wed, Jun 22, 2016 at 8:54 AM, Jesper Dangaard Brouer >> wrote: >> > On Tue, 21 Jun 2016 18:54:53 -0700 >> > Alexei Starovoitov wrote: >> > >> >> On Tue, Jun 21

Re: [iovisor-dev] [PATCH, BPF 0/5] Minor improvements to the bpf backend

2016-06-22 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 15, 2016 at 2:37 PM, Richard Henderson via iovisor-dev wrote: > Hi, > > Using EM_NONE for the bpf backend e_machine value is less than optimal. > With a unique value we can interact with other tools, e.g. objdump for > disassembly. > > As a bonus, I noticed a few missing patterns that

Re: [iovisor-dev] [PATCH v2 2/5] BPF: Rearrange instruction classes

2016-06-24 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 23, 2016 at 3:52 PM, Richard Henderson via iovisor-dev wrote: > Avoid duplicating lots of field definitions. > > Signed-off-by: Richard Henderson > --- > lib/Target/BPF/BPFInstrFormats.td | 39 ++- > lib/Target/BPF/BPFInstrInfo.td| 536 > +++--- >

Re: [iovisor-dev] Direct packet access validation across tail calls

2016-07-05 Thread Alexei Starovoitov via iovisor-dev
On Mon, Jul 04, 2016 at 04:21:23PM +0200, Thomas Graf wrote: > 2016-07-04 13:02 GMT+02:00 Daniel Borkmann : > > Yeah, checks cannot be carried over in two occasions: i) calling helpers > > that change skb->data (and therefore prior checks become invalid) and > > ii) tail calls. For tail calls the v

Re: [iovisor-dev] XDP eBPF extending with an input parameter?

2016-07-06 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jul 06, 2016 at 05:21:53PM +0200, Jesper Dangaard Brouer wrote: > > How easy is it to extend the XDP/eBPF program with a new input > parameter? trivial. do git blame include/uapi/linux/bpf.h and see commits for struct __sk_buff We've been adding input md fields non stop without breaking e

Re: [iovisor-dev] XDP seeking input from NIC hardware vendors

2016-07-07 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jul 07, 2016 at 03:18:11PM +, Fastabend, John R wrote: > Hi Jesper, > > I have done some previous work on proprietary systems where we used hardware > to do the classification/parsing then passed a cookie to the software which > used the cookie to lookup a program to run on the packe

Re: [iovisor-dev] XDP seeking input from NIC hardware vendors

2016-07-07 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jul 07, 2016 at 09:05:29PM -0700, John Fastabend wrote: > On 16-07-07 07:22 PM, Alexei Starovoitov wrote: > > On Thu, Jul 07, 2016 at 03:18:11PM +, Fastabend, John R wrote: > >> Hi Jesper, > >> > >> I have done some previous work on proprietary systems where we > >> used hardware to do

Re: [iovisor-dev] XDP seeking input from NIC hardware vendors

2016-07-11 Thread Alexei Starovoitov via iovisor-dev
On Sat, Jul 09, 2016 at 01:27:26PM +0200, Jesper Dangaard Brouer wrote: > On Fri, 8 Jul 2016 18:51:07 +0100 > Jakub Kicinski wrote: > > > On Fri, 8 Jul 2016 09:45:25 -0700, John Fastabend wrote: > > > The only distinction between VFs and queue groupings on my side is VFs > > > provide RSS where a

Re: [iovisor-dev] Todays call & filtering probes on strings

2016-07-14 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jul 13, 2016 at 4:17 PM, Kyle Laracey via iovisor-dev wrote: > > An additional issue brought up on the call (I apologize for forgetting by > whom) was that any comparisons on long strings would bloat the program, > perhaps beyond the maximum allowed program size. Would the solution to this

Re: [iovisor-dev] Todays call & filtering probes on strings

2016-07-15 Thread Alexei Starovoitov via iovisor-dev
On Fri, Jul 15, 2016 at 12:56 AM, Sasha Goldshtein wrote: > On Fri, Jul 15, 2016 at 3:59 AM Alexei Starovoitov > wrote: >> >> On Wed, Jul 13, 2016 at 4:17 PM, Kyle Laracey via iovisor-dev >> wrote: >> > >> > An additional issue brought up on the call (I apologize for forgetting >> > by >> > whom

[iovisor-dev] headsup: llvm now uses official bpf e_machine value

2016-07-15 Thread Alexei Starovoitov via iovisor-dev
just pushed Richard's patch https://github.com/llvm-mirror/llvm/commit/36b9c09330bfb5e771914cfe307588f30d5510d2 tested with bcc and different bpf loaders. Thankfully none of them rely on old and arguably buggy em_none value, so no breakage expected. if you're using special bpf elf loader, please t

Re: [iovisor-dev] Todays call & filtering probes on strings

2016-07-19 Thread Alexei Starovoitov via iovisor-dev
On Mon, Jul 18, 2016 at 01:57:24PM -0700, Kyle Laracey wrote: > Alexei, > > > > What is your use case that needs strings? > > > We are trying to filter on SQL query strings at USDT probes in our product > (a database). We would like to be able to compare a string probe parameter > to another st

Re: [iovisor-dev] Todays call & filtering probes on strings

2016-07-19 Thread Alexei Starovoitov via iovisor-dev
On Tue, Jul 19, 2016 at 05:19:20PM -0700, Kyle Laracey wrote: > Alexei, > > with stringmap the user space process will be able to populate the map > > with its own strings, then the bpf prog can do bpf_get_unsafe_string > > to put a string pointed to by uprobe parameter into a map. > > The helper

Re: [iovisor-dev] question about struct xdp_md

2016-08-01 Thread Alexei Starovoitov via iovisor-dev
On Sun, Jul 31, 2016 at 11:05:55PM -0700, William Tu via iovisor-dev wrote: > Hi, > > I'm looking at definition of xdp_md: > struct xdp_md { > __u32 data; > __u32 data_end; > }; > > I'm curious why are we using __u32? Isn't data and data_end an 8-byte > pointer to the packet's buffer? For

Re: [iovisor-dev] bpf verification fails when accessing an array element

2016-08-08 Thread Alexei Starovoitov via iovisor-dev
On Mon, Aug 8, 2016 at 10:56 AM, William Tu wrote: > Hi Alexei, > > I wonder if anyone is working on this issue currently? > Or I could start learning from your "direct packet access" patch and > see if could implement it? Thanks. This patch does direct packet access from helpers (like lookup and

Re: [iovisor-dev] bpf verification fails when accessing an array element

2016-08-08 Thread Alexei Starovoitov via iovisor-dev
On Mon, Aug 8, 2016 at 11:29 AM, William Tu wrote: > Hi Alexei, > > Thanks. >> >> This patch does direct packet access from helpers (like lookup and csum): >> https://git.kernel.org/cgit/linux/kernel/git/ast/bpf.git/commit/?id=d2c24a2769693524d >> it's waiting for net-next to reopen. > > I'm confu

Re: [iovisor-dev] BCC: bpf_probe_read read function arguments

2016-08-12 Thread Alexei Starovoitov via iovisor-dev
On Fri, Aug 12, 2016 at 4:50 PM, Brenden Blanco via iovisor-dev wrote: > > > On Fri, Aug 12, 2016 at 4:46 PM, Mark Drayton via iovisor-dev > wrote: >> >> Here’s a version that works: >> >> >> >> https://gist.github.com/markdrayton/d077459b7ed23ce25bb3eff2d5e220ba >> >> >> >> It looks like SSL_rea

Re: [iovisor-dev] [RFC] samples/bpf: Add tunnel set/get tests.

2016-08-12 Thread Alexei Starovoitov via iovisor-dev
On Fri, Aug 12, 2016 at 10:35:08AM -0700, William Tu via iovisor-dev wrote: > The patch creates sample code exercising bpf_skb_{set,get}_tunnel_key, > and bpf_skb_{set,get}_tunnel_opt for GRE, VXLAN, and GENEVE. A native > tunnel device is created in a namespace to interact with a lwtunnel > devic

Re: [iovisor-dev] Checmate / LSM use cases

2016-08-12 Thread Alexei Starovoitov via iovisor-dev
On Thu, Aug 11, 2016 at 12:06 PM, Sargun Dhillon via iovisor-dev wrote: > Hello all, > Sorry for my bumbling on the phone yesterday. I promised to share the > use cases for the LSM. I'd love to get opinions. > > There is a large enterprise that runs between 8-24 containers on each > server. These

Re: [iovisor-dev] Checmate / LSM use cases

2016-08-16 Thread Alexei Starovoitov via iovisor-dev
On Tue, Aug 16, 2016 at 5:09 PM, Sargun Dhillon wrote: > On Fri, Aug 12, 2016 at 6:16 PM, Alexei Starovoitov > wrote: >> On Thu, Aug 11, 2016 at 12:06 PM, Sargun Dhillon via iovisor-dev >> wrote: >>> Hello all, >>> Sorry for my bumbling on the phone yesterday. I promised to share the >>> use cas

Re: [iovisor-dev] Checmate / LSM use cases

2016-08-16 Thread Alexei Starovoitov via iovisor-dev
On Tue, Aug 16, 2016 at 9:16 PM, Sargun Dhillon wrote: > On Tue, Aug 16, 2016 at 07:38:45PM -0700, Alexei Starovoitov wrote: >> On Tue, Aug 16, 2016 at 5:09 PM, Sargun Dhillon wrote: >> > On Fri, Aug 12, 2016 at 6:16 PM, Alexei Starovoitov >> > wrote: >> >> On Thu, Aug 11, 2016 at 12:06 PM, Sarg

Re: [iovisor-dev] Question about XDP on multiple NICs with the same driver

2016-08-22 Thread Alexei Starovoitov via iovisor-dev
On Mon, Aug 22, 2016 at 4:26 PM, William Tu via iovisor-dev wrote: > Hi, > > I'm not sure if we discussed this before, but I'm thinking that if I > have two identical NICs (ex: two e1000 cards with ifindex 1 and 2), > and I load the e1000.ko driver. At userspace, I run > $ /samples/bpf/xdp 1 > $ /

Re: [iovisor-dev] [PATCH RFC 01/11] net/mlx5e: Single flow order-0 pages for Striding RQ

2016-09-07 Thread Alexei Starovoitov via iovisor-dev
On Wed, Sep 07, 2016 at 03:42:22PM +0300, Saeed Mahameed wrote: > From: Tariq Toukan > > To improve the memory consumption scheme, we omit the flow that > demands and splits high-order pages in Striding RQ, and stay > with a single Striding RQ flow that uses order-0 pages. > > Moving to fragment

Re: [iovisor-dev] [PATCH RFC 04/11] net/mlx5e: Build RX SKB on demand

2016-09-07 Thread Alexei Starovoitov via iovisor-dev
On Wed, Sep 07, 2016 at 03:42:25PM +0300, Saeed Mahameed wrote: > For non-striding RQ configuration before this patch we had a ring > with pre-allocated SKBs and mapped the SKB->data buffers for > device. > > For robustness and better RX data buffers management, we allocate a > page per packet and

Re: [iovisor-dev] README: [PATCH RFC 11/11] net/mlx5e: XDP TX xmit more

2016-09-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Sep 08, 2016 at 10:11:47AM +0200, Jesper Dangaard Brouer wrote: > > I'm sorry but I have a problem with this patch! is it because the variable is called 'xdp_doorbell'? Frankly I see nothing scary in this patch. It extends existing code by adding a flag to ring doorbell or not. The end of

Re: [iovisor-dev] README: [PATCH RFC 11/11] net/mlx5e: XDP TX xmit more

2016-09-08 Thread Alexei Starovoitov via iovisor-dev
On Fri, Sep 09, 2016 at 07:36:52AM +0200, Jesper Dangaard Brouer wrote: > > > Lets do bundling/bulking from the start! > > > > mlx4 already does bulking and this proposed mlx5 set of patches > > does bulking as well. > > See nothing wrong about it. RX side processes the packets and > > when it'

Re: [iovisor-dev] README: [PATCH RFC 11/11] net/mlx5e: XDP TX xmit more

2016-09-12 Thread Alexei Starovoitov via iovisor-dev
On Mon, Sep 12, 2016 at 10:56:55AM +0200, Jesper Dangaard Brouer wrote: > On Thu, 8 Sep 2016 23:30:50 -0700 > Alexei Starovoitov wrote: > > > On Fri, Sep 09, 2016 at 07:36:52AM +0200, Jesper Dangaard Brouer wrote: > > > > > Lets do bundling/bulking from the start! > > > > > > > > mlx4 alrea

Re: [iovisor-dev] README: [PATCH RFC 11/11] net/mlx5e: XDP TX xmit more

2016-09-12 Thread Alexei Starovoitov via iovisor-dev
On Mon, Sep 12, 2016 at 01:30:25PM +0200, Jesper Dangaard Brouer wrote: > On Thu, 8 Sep 2016 23:30:50 -0700 > Alexei Starovoitov wrote: > > > On Fri, Sep 09, 2016 at 07:36:52AM +0200, Jesper Dangaard Brouer wrote: > [...] > > > Imagine you have packets intermixed towards the stack and XDP_TX. >

Re: [iovisor-dev] XDP (eXpress Data Path) documentation

2016-09-20 Thread Alexei Starovoitov via iovisor-dev
On Tue, Sep 20, 2016 at 11:08:44AM +0200, Jesper Dangaard Brouer via iovisor-dev wrote: > Hi all, > > As promised, I've started documenting the XDP eXpress Data Path): > > [1] > https://prototype-kernel.readthedocs.io/en/latest/networking/XDP/index.html > > IMHO the documentation have reached

Re: [iovisor-dev] Explaining RX-stages for XDP

2016-09-27 Thread Alexei Starovoitov via iovisor-dev
On Tue, Sep 27, 2016 at 11:32:37AM +0200, Jesper Dangaard Brouer wrote: > > Let me try in a calm way (not like [1]) to explain how I imagine that > the XDP processing RX-stage should be implemented. As I've pointed out > before[2], I'm proposing splitting up the driver into RX-stages. This > is a

Re: [iovisor-dev] Explaining RX-stages for XDP

2016-09-28 Thread Alexei Starovoitov via iovisor-dev
On Wed, Sep 28, 2016 at 12:44:31PM +0200, Jesper Dangaard Brouer wrote: > > The idea is quite different. It has nothing to do with Edward's > proposal[3]. The RX packet-vector is simply an array, either of pointers > or index numbers (into the RX-ring). The needed changes are completely > conta

Re: [iovisor-dev] BPF switch case LLVM error

2016-10-22 Thread Alexei Starovoitov via iovisor-dev
On Fri, Oct 21, 2016 at 11:38 PM, William Tu via iovisor-dev wrote: > Hi, > I'm running into this LLVM ERROR at compile time. Does anyone seem > this before or can give me some suggestions? thanks! > > --- > LLVM ERROR: Cannot select: 0x3bafa28: ch = brind 0x3bc98f0:1, > 0x3bc98f0 [ORD=1] [ID=

Re: [iovisor-dev] clear/empty a bpf hash map

2016-10-24 Thread Alexei Starovoitov via iovisor-dev
On Mon, Oct 24, 2016 at 2:22 PM, William Tu via iovisor-dev wrote: > Hi, > > Is there an easy way to clear all entries in a BPF hash map? > > My use case: > When my BPF userspace program and kernel BPF is running, I want to > dynamically adding a new BPF hash map. IIUC, there is no way to do > tha

Re: [iovisor-dev] clear/empty a bpf hash map

2016-10-25 Thread Alexei Starovoitov via iovisor-dev
On Mon, Oct 24, 2016 at 10:42:44PM -0700, William Tu wrote: > Hi Alexei, > Thanks for your reply. > > On Mon, Oct 24, 2016 at 7:01 PM, Alexei Starovoitov > wrote: > > On Mon, Oct 24, 2016 at 2:22 PM, William Tu via iovisor-dev > > wrote: > >> Hi, > >> > >> Is there an easy way to clear all entri

Re: [iovisor-dev] bpf_skb_load_bytes for kprobes?

2016-10-28 Thread Alexei Starovoitov via iovisor-dev
On Tue, Oct 25, 2016 at 5:19 PM, Krister Johansen via iovisor-dev wrote: > Folks, > I have a bcc script that I've been using to debug the packet path in a > project that I'm working on. I've been using kprobes and tracepoints to > grab skb pointers. Most of the time enough of the skb's data is l

Re: [iovisor-dev] Unable to attach tracepoint to syscalls event

2016-11-21 Thread Alexei Starovoitov via iovisor-dev
On Sat, Nov 19, 2016 at 9:45 AM, Mazhar Naqvi via iovisor-dev wrote: > Hi, > > > I am trying to attach my function to a tracepoint. I followed brendangregg's > script "urandomread.py" and modified it to attach to > syscalls:sys_enters_socket but the program gives me an error. > > > Here's a code s

Re: [iovisor-dev] reminder: IO Visor TSC and Dev Members Call

2016-11-29 Thread Alexei Starovoitov via iovisor-dev
sorry. I cannot make it tomorrow. On Tue, Nov 29, 2016 at 8:58 PM, Brenden Blanco via iovisor-dev < iovisor-dev@lists.iovisor.org> wrote: > Hi All, > > Please join us for our bi-weekly call. This meeting is open to everybody > and completely optional. > > *IOVisor TSC/Dev Meeting* > Every 2 weeks

Re: [iovisor-dev] Build Docker image for iovisor/bcc

2016-11-29 Thread Alexei Starovoitov via iovisor-dev
On Tue, Nov 29, 2016 at 10:21 AM, Alban Crequy via iovisor-dev wrote: > Hi, > > I think that's a good idea to make it easier to try bcc. > > There is this Docker image but I don't know who is managing it: > https://github.com/zlim/bcc-docker > https://hub.docker.com/r/zlim/bcc/ Hi Zi, looks like

Re: [iovisor-dev] arm64: LLVM ERROR: Inline asm not supported

2016-12-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Dec 8, 2016 at 8:20 AM, Ming Lei via iovisor-dev wrote: > Hi, > > Bcc can be installed on ubuntu 16.04/arm64 successfully, but when > I try to trace, the folllowing failure[1] is triggered. > > So is bcc not ready for arm64? Or something is wrong? > > BTW, clang/llvm is 3.8, and I am happy

Re: [iovisor-dev] arm64: LLVM ERROR: Inline asm not supported

2016-12-12 Thread Alexei Starovoitov via iovisor-dev
On Sun, Dec 11, 2016 at 5:27 PM, Ming Lei via iovisor-dev wrote: > On Sun, Dec 11, 2016 at 9:21 AM, Chaiken, Alison via iovisor-dev > wrote: >> Ming Lei inquires: >> >> Bcc can be installed on ubuntu 16.04/arm64 successfully, but when >> I try to trace, the folllowing failure[1] is triggered. >>

Re: [iovisor-dev] arm64: LLVM ERROR: Inline asm not supported

2016-12-12 Thread Alexei Starovoitov via iovisor-dev
On Mon, Dec 12, 2016 at 9:44 PM, Ming Lei wrote: > >> so you can send me a pre-processed .c file or even better .ll file ? >> I don't have arm64 to reproduce it... > > Please see the whole log of building the prog. that raw asm outside of any function body comes from arch/arm64/include/asm/sysreg

Re: [iovisor-dev] arm64: LLVM ERROR: Inline asm not supported

2016-12-12 Thread Alexei Starovoitov via iovisor-dev
On Mon, Dec 12, 2016 at 10:33 PM, Ming Lei wrote: > On Tue, Dec 13, 2016 at 2:11 PM, Alexei Starovoitov > wrote: >> On Mon, Dec 12, 2016 at 9:44 PM, Ming Lei wrote: >>> so you can send me a pre-processed .c file or even better .ll file ? I don't have arm64 to reproduce it... >>> >>> Pl

Re: [iovisor-dev] arm64: LLVM ERROR: Inline asm not supported

2016-12-13 Thread Alexei Starovoitov via iovisor-dev
On Tue, Dec 13, 2016 at 8:43 AM, Brenden Blanco wrote: > > > On Mon, Dec 12, 2016 at 10:38 PM, Alexei Starovoitov > wrote: >> >> On Mon, Dec 12, 2016 at 10:33 PM, Ming Lei wrote: >> > On Tue, Dec 13, 2016 at 2:11 PM, Alexei Starovoitov >> > wrote: >> >> On Mon, Dec 12, 2016 at 9:44 PM, Ming Lei

Re: [iovisor-dev] const qualifier for key argument in eBPF map access functions

2016-12-13 Thread Alexei Starovoitov via iovisor-dev
when you change the prototype to 'const void *' does it help compiler to unroll it? On Tue, Dec 13, 2016 at 12:06 PM, Mauricio Vasquez via iovisor-dev wrote: > Hello, > > We are having some doubts about the use of the const qualifier for the key > argument in functions to access eBPF maps, both,

Re: [iovisor-dev] [LPC] User Space Dynamic Tracing

2016-12-18 Thread Alexei Starovoitov via iovisor-dev
On Mon, Nov 14, 2016 at 7:34 AM, Joe Lawrence wrote: > On 11/11/2016 09:41 PM, Alexei Starovoitov wrote: >> On Thu, Nov 10, 2016 at 7:36 AM, Joe Lawrence >> wrote: >>> On 11/09/2016 11:11 PM, Alexei Starovoitov wrote: On Wed, Nov 9, 2016 at 8:59 AM, Joe Lawrence wrote: > Hi Alexe

Re: [iovisor-dev] buffered polling

2016-12-20 Thread Alexei Starovoitov via iovisor-dev
On Tue, Dec 20, 2016 at 1:47 PM, Brendan Gregg via iovisor-dev wrote: > I'd like to BPF_PERF_OUTPUT() at a high rate (>1000/s), and have these > buffered and read in groups by bcc. But the typical loop we're using: > > b["events"].open_perf_buffer(print_event) > while 1: > b.kprobe_poll() > >

Re: [iovisor-dev] LLVM error: couldn't allocate output register for constraint 'r' at line 473618

2017-01-08 Thread Alexei Starovoitov via iovisor-dev
"couldn't allocate output register for constraint 'r' " means that inline asm was used. Try preprocessing C and look for inline asm usage. On Fri, Jan 6, 2017 at 1:30 PM, William Tu via iovisor-dev wrote: > thanks > the code is at > https://gist.github.com/williamtu/7e41392a34672d7b4574aee063ea4a

Re: [iovisor-dev] rpbf: Rust port of uBPF (user space VM for eBPF)

2017-01-09 Thread Alexei Starovoitov via iovisor-dev
On Mon, Jan 9, 2017 at 8:00 AM, Quentin Monnet via iovisor-dev wrote: > Hello, > > Just in case some people might be interested, I ported the user space > eBPF implementation from Rich Lane (uBPF, in C, > https://github.com/iovisor/ubpf/) to Rust, and it is available on > GitHub: https://github.co

Re: [iovisor-dev] [iovisor/bcc] Dealing with long path names (#900)

2017-01-11 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jan 11, 2017 at 4:23 PM, Konstantin Bukin wrote: > Here is a diff against kernel 4.9.2: > > build-test1:linux-4.9.2$git diff > diff --git a/include/linux/bpf.h b/include/linux/bpf.h > index c201017..64516be 100644 > --- a/include/linux/bpf.h > +++ b/include/linux/bpf.h > @@ -327,6 +327,7

Re: [iovisor-dev] Handling a set of free elements with current map implementations

2017-01-20 Thread Alexei Starovoitov via iovisor-dev
dhcp function is a slow path and has quite a bit of complexity that is not appropriate for datapath. Normal dhcp is handled by user space dhclient. So I think it would be better to do the same in your case. As an orthogonal discussion it would be useful indeed to have push()/pop() like logic in bpf

Re: [iovisor-dev] Howto debug eBPF programs and bpf_trace_printk

2017-01-24 Thread Alexei Starovoitov via iovisor-dev
On Tue, Jan 24, 2017 at 2:16 AM, Jesper Dangaard Brouer wrote: > On Tue, 24 Jan 2017 10:52:39 +0100 > Jesper Dangaard Brouer wrote: > >> Hi IOvisor-group, >> >> I'm playing with kernels samples/bpf, and want so advice on debugging >> eBPF programs. >> >> First question: I noticed bpf_trace_printk

Re: [iovisor-dev] Documentation on eBPF map types?

2017-01-31 Thread Alexei Starovoitov via iovisor-dev
On Tue, Jan 31, 2017 at 9:54 AM, Jesper Dangaard Brouer via iovisor-dev wrote: > > On Sat, 28 Jan 2017 10:14:58 +1100 Brendan Gregg > wrote: > >> I did some in the bcc ref guide, but it's incomplete, and the bcc versions: >> https://github.com/iovisor/bcc/blob/master/docs/reference_guide.md > >

Re: [iovisor-dev] Accessing __string fields in tracepoints

2017-01-31 Thread Alexei Starovoitov via iovisor-dev
On Tue, Jan 31, 2017 at 4:19 AM, Sasha Goldshtein via iovisor-dev wrote: > Hi all, > > I'm trying to attach a BPF program to a tracepoint that has a __string > field, such as net:net_dev_start_xmit. This tracepoint has the following > format (from debugfs/events/.../format): > > name: net_dev_star

Re: [iovisor-dev] Accessing __string fields in tracepoints

2017-02-01 Thread Alexei Starovoitov via iovisor-dev
On Wed, Feb 1, 2017 at 1:25 AM, Sasha Goldshtein wrote: > > Do you expect the data_loc field structure to change? E.g., do you expect > the size to be != 4 bytes, and the two words (length, offset) to mean > something > else in the future? I don't expect it to change any time soon, but it can. __

Re: [iovisor-dev] Documentation on eBPF map types?

2017-02-02 Thread Alexei Starovoitov via iovisor-dev
On Thu, Feb 02, 2017 at 06:00:09PM +0100, Jesper Dangaard Brouer wrote: > > [PATCH] doc: how interacting with eBPF maps works > > Documented by reading the code. looks great! please submit the patch to net-next and cc Jonathan ? Comments below: > I hope someone more knowledgeable will review th

Re: [iovisor-dev] Documentation on eBPF map types?

2017-02-03 Thread Alexei Starovoitov via iovisor-dev
On Fri, Feb 3, 2017 at 5:52 AM, Jesper Dangaard Brouer wrote: > On Thu, 2 Feb 2017 20:27:15 -0800 > Alexei Starovoitov wrote: > >> On Thu, Feb 02, 2017 at 06:00:09PM +0100, Jesper Dangaard Brouer wrote: > [...] >> Comments below: > [...] > >> > +Interacting with maps >> > += >

Re: [iovisor-dev] reminder: IO Visor TSC/Dev Meeting

2017-02-07 Thread Alexei Starovoitov via iovisor-dev
On Tue, Feb 7, 2017 at 4:07 PM, Brenden Blanco via iovisor-dev wrote: > > === IO Visor Dev/TSC Meeting === > Every 2 weeks on Wednesday, from Wednesday, January 25, 2017, to no end date > 11:00 am | Pacific Standard Time (San Francisco, GMT-08:00) | 1 hr i have a dental appointment at that ti

Re: [iovisor-dev] bpf invalid stack off=-528

2017-02-09 Thread Alexei Starovoitov via iovisor-dev
On Thu, Feb 9, 2017 at 8:43 AM, William Tu via iovisor-dev wrote: > > $(CLANG) \ > -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ > -Wno-compare-distinct-pointer-types \ > -Wno-gnu-variable-sized-type-not-at-end \ > -Wno-tautological-compare

Re: [iovisor-dev] bpf invalid stack off=-528

2017-02-10 Thread Alexei Starovoitov via iovisor-dev
On Fri, Feb 10, 2017 at 9:08 AM, William Tu wrote: > my program is too huge so I start with simple example using xdp1_kern.c > I tried adding an ethernet header as local variable: > > --- a/samples/bpf/xdp1_kern.c > +++ b/samples/bpf/xdp1_kern.c > @@ -51,10 +51,19 @@ int xdp_prog1(struct xdp_md *c

Re: [iovisor-dev] Describing howto read the eBPF generated ELF binary

2017-03-06 Thread Alexei Starovoitov via iovisor-dev
On Mon, Mar 6, 2017 at 3:53 AM, Jesper Dangaard Brouer wrote: > Hi All, > > I've added a section to my eBPF documentation, about how to read the > eBPF generated ELF binary, and deduct the size of the compiled program > (mostly for kernel/samples/bpf). > > https://prototype-kernel.readthedocs.io/e

Re: [iovisor-dev] Describing howto read the eBPF generated ELF binary

2017-03-06 Thread Alexei Starovoitov via iovisor-dev
On Mon, Mar 6, 2017 at 10:29 AM, Jesper Dangaard Brouer wrote: > On Mon, 6 Mar 2017 09:11:46 -0800 > Alexei Starovoitov via iovisor-dev wrote: > >> On Mon, Mar 6, 2017 at 3:53 AM, Jesper Dangaard Brouer >> wrote: >> > Hi All, >> > >> > I've a

Re: [iovisor-dev] Describing howto read the eBPF generated ELF binary

2017-03-07 Thread Alexei Starovoitov via iovisor-dev
On Tue, Mar 7, 2017 at 3:07 AM, Jesper Dangaard Brouer wrote: > On Mon, 6 Mar 2017 16:14:06 -0800 > Alexei Starovoitov via iovisor-dev wrote: > >> On Mon, Mar 6, 2017 at 10:29 AM, Jesper Dangaard Brouer >> wrote: >> > On Mon, 6 Mar 2017 09:11:46 -0800 >>

Re: [iovisor-dev] Describing howto read the eBPF generated ELF binary

2017-03-07 Thread Alexei Starovoitov via iovisor-dev
On Tue, Mar 07, 2017 at 10:13:13PM +0100, Jesper Dangaard Brouer wrote: > On Tue, 7 Mar 2017 21:54:42 +0100 > Jesper Dangaard Brouer wrote: > > > > I also suggest to replace it with 'llvm-objdump -h file.o' > > > since it prints the same info as 'readelf -SW' > > > but less verbose. > > > > Go

Re: [iovisor-dev] Can we attach an IOmodule to a pcap file?

2017-03-20 Thread Alexei Starovoitov via iovisor-dev
On Mon, Mar 20, 2017 at 10:08:57AM +0100, Fulvio Risso via iovisor-dev wrote: > Dear all, > > perhaps a naive question. > > Instead of attaching an Iomodule to a NIC and perform statistics/whatever, > can we attach the Iomodule to a pcap file? > > The classical BPF (with libpcap) has this featur

Re: [iovisor-dev] Reading src/dst addresses in reuseport programs

2017-03-29 Thread Alexei Starovoitov via iovisor-dev
On Tue, Mar 28, 2017 at 7:08 PM, Marek Vavruša via iovisor-dev wrote: > Hi, > > so I was tinkering with programs attached to reuseport groups again, and > simple decisions work as expected. > The problem comes when I want to make decisions based on source or > destination IP address. Since the soc

Re: [iovisor-dev] Iovisor and Real-time Llinux scheduler

2017-04-11 Thread Alexei Starovoitov via iovisor-dev
On Mon, Apr 10, 2017 at 9:18 AM, Fulvio Risso via iovisor-dev wrote: > Dear all, > > since IOVisor is an in-kernel paradigm, is there anyone aware of any study > regarding how RT scheduling within the linux kernel is impacted by the > presence (and operation) of various IO-Modules? I don't think

Re: [iovisor-dev] Iovisor and Real-time Llinux scheduler

2017-04-11 Thread Alexei Starovoitov via iovisor-dev
On Tue, Apr 11, 2017 at 1:06 PM, Fulvio Risso wrote: > > Is there any documentation that presents the interrupt context in which the > different iomodules operate, according to the attaching point? BPF_PROG_TYPE_SCHED_CLS and BPF_PROG_TYPE_XDP programs run in softirq. BPF_PROG_TYPE_KPROBE and BPF

Re: [iovisor-dev] Wrong size-extension check in BPFDAGToDAGISel::SelectAddr

2017-04-12 Thread Alexei Starovoitov via iovisor-dev
On Tue, Apr 11, 2017 at 8:48 PM, Nadav Amit wrote: > Using the LLVM backend of BPF, I sometimes get the wrong code to be > generated. > > For example, for the following program: > > int bpf_prog1(void *ign) > { > volatile unsigned long t = 0x8983984739ull; > return *(unsigned long *)((

Re: [iovisor-dev] Wrong size-extension check in BPFDAGToDAGISel::SelectAddr

2017-04-13 Thread Alexei Starovoitov via iovisor-dev
On Thu, Apr 13, 2017 at 2:53 PM, Nadav Amit wrote: > > I sent a patch to https://reviews.llvm.org/D32055 . > > I do not know the LLVM test-suite, so please prepare a test based on the > example and the bug-fix. pushed with the test. Do you mind sharing how did you find this issue? What kind of p

Re: [iovisor-dev] bpf invalid stack off=-528

2017-04-14 Thread Alexei Starovoitov via iovisor-dev
On Fri, Apr 14, 2017 at 12:48:11PM -0700, William Tu wrote: > Thanks for all the feedbacks from the iovisor summit. Since then, > we've tried a couple of workarounds for this issue, the following > shares the observations and code. > > === Original code, xdp9.c === > xdp9.c is to parse IPv4, TCP,

Re: [iovisor-dev] BPF array initialization fails

2017-04-19 Thread Alexei Starovoitov via iovisor-dev
On Tue, Apr 18, 2017 at 5:48 PM, William Tu via iovisor-dev wrote: > Hi, > > I have a struct like below: > struct bpf_flow_keys { >long src; > }; > > I'm initializing an array of it using structures like below: >struct bpf_flow_keys flow_mask_array[] = { > {.src = }, >

Re: [iovisor-dev] reminder: IO Visor TSC/Dev Meeting

2017-05-16 Thread Alexei Starovoitov via iovisor-dev
On Tue, May 16, 2017 at 5:40 PM, Brenden Blanco via iovisor-dev wrote: > 11:00 am | Pacific Daylight Time (San Francisco, GMT-07:00) | 1 hr > https://bluejeans.com/568677804/ few topics for the agenda: - Plumbers Conference will be happening Sep 13-15 in LA if you're planning to attend pleas

Re: [iovisor-dev] minutes: IO Visor TSC/Dev Meeting

2017-05-17 Thread Alexei Starovoitov via iovisor-dev
On Wed, May 17, 2017 at 2:14 PM, Brenden Blanco via iovisor-dev wrote: > Hi All, > > Thanks for attending the call today, here are the notes. thanks a lot for taking and publishing these notes! > CFP for Linux Plumbers > Sept 13-15, Los Angeles > Tracing microconference accepted > (Alexei, Bren

Re: [iovisor-dev] More BPF verifier questions

2017-06-05 Thread Alexei Starovoitov via iovisor-dev
On 6/2/17 7:42 AM, Edward Cree wrote: Also, I feel I haven't fully understood the semantics of {min,max}_value and signed vs. unsigned comparisons. It seems that currently reg_set_min_max [_inv] assumes that any given register-value will either only be used as signed, or only be used as unsig

Re: [iovisor-dev] [RFC PATCH net-next 2/5] bpf/verifier: rework value tracking

2017-06-07 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 07, 2017 at 03:58:31PM +0100, Edward Cree wrote: > Tracks value alignment by means of tracking known & unknown bits. > Tightens some min/max value checks and fixes a couple of bugs therein. > > Signed-off-by: Edward Cree > --- > include/linux/bpf.h | 34 +- > include/linux

Re: [iovisor-dev] [RFC PATCH net-next 3/5] bpf/verifier: feed pointer-to-unknown-scalar casts into scalar ALU path

2017-06-07 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 07, 2017 at 03:58:50PM +0100, Edward Cree wrote: > If pointer leaks are allowed, and adjust_ptr_min_max_vals returns -EACCES, > treat the pointer as an unknown scalar and try again, because we might be > able to conclude something about the result (e.g. pointer & 0x40 is either > 0 o

Re: [iovisor-dev] [RFC PATCH net-next 4/5] bpf/verifier: track signed and unsigned min/max values

2017-06-07 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 07, 2017 at 03:59:25PM +0100, Edward Cree wrote: > Allows us to, sometimes, combine information from a signed check of one > bound and an unsigned check of the other. > We now track the full range of possible values, rather than restricting > ourselves to [0, 1<<30) and considering an

Re: [iovisor-dev] [RFC PATCH net-next 5/5] selftests/bpf: change test_verifier expectations

2017-06-07 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 07, 2017 at 04:00:02PM +0100, Edward Cree wrote: > Some of the verifier's error messages have changed, and some constructs > that previously couldn't be verified are now accepted. > > Signed-off-by: Edward Cree > --- > tools/testing/selftests/bpf/test_verifier.c | 226 > +++

Re: [iovisor-dev] [RFC PATCH net-next 2/5] bpf/verifier: rework value tracking

2017-06-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 08, 2017 at 03:53:36PM +0100, Edward Cree wrote: > >> > >> - } else if (reg->type == FRAME_PTR || reg->type == PTR_TO_STACK) { > >> + } else if (reg->type == PTR_TO_STACK) { > >> + /* stack accesses must be at a fixed offset, so that we can > >> + * determine what

Re: [iovisor-dev] [RFC PATCH net-next 4/5] bpf/verifier: track signed and unsigned min/max values

2017-06-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 08, 2017 at 04:23:24PM +0100, Edward Cree wrote: > On 08/06/17 03:40, Alexei Starovoitov wrote: > > On Wed, Jun 07, 2017 at 03:59:25PM +0100, Edward Cree wrote: > >> Allows us to, sometimes, combine information from a signed check of one > >> bound and an unsigned check of the other. >

Re: [iovisor-dev] [RFC PATCH net-next 3/5] bpf/verifier: feed pointer-to-unknown-scalar casts into scalar ALU path

2017-06-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 08, 2017 at 04:25:39PM +0100, Edward Cree wrote: > On 08/06/17 03:35, Alexei Starovoitov wrote: > > such large back and forth move doesn't help reviewing. > > may be just merge it into previous patch? > > Or keep that function in the right place in patch 2 already? > I think 'diff' got

Re: [iovisor-dev] [RFC PATCH net-next 3/5] bpf/verifier: feed pointer-to-unknown-scalar casts into scalar ALU path

2017-06-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 08, 2017 at 06:12:39PM +0100, Edward Cree wrote: > On 08/06/17 17:50, Alexei Starovoitov wrote: > > On Thu, Jun 08, 2017 at 04:25:39PM +0100, Edward Cree wrote: > >> On 08/06/17 03:35, Alexei Starovoitov wrote: > >>> such large back and forth move doesn't help reviewing. > >>> may be ju

Re: [iovisor-dev] [RFC PATCH net-next 3/5] bpf/verifier: feed pointer-to-unknown-scalar casts into scalar ALU path

2017-06-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 08, 2017 at 08:07:53PM +0100, Edward Cree wrote: > On 08/06/17 19:41, Alexei Starovoitov wrote: > > On Thu, Jun 08, 2017 at 06:12:39PM +0100, Edward Cree wrote: > >> On 08/06/17 17:50, Alexei Starovoitov wrote: > >>> On Thu, Jun 08, 2017 at 04:25:39PM +0100, Edward Cree wrote: > On

Re: [iovisor-dev] [RFC PATCH net-next 2/5] bpf/verifier: rework value tracking

2017-06-08 Thread Alexei Starovoitov via iovisor-dev
On Thu, Jun 08, 2017 at 08:38:29PM +0100, Edward Cree wrote: > On 08/06/17 17:45, Alexei Starovoitov wrote: > > On Thu, Jun 08, 2017 at 03:53:36PM +0100, Edward Cree wrote: > > -} else if (reg->type == FRAME_PTR || reg->type == PTR_TO_STACK) > { > +} else if (

Re: [iovisor-dev] [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier

2017-06-28 Thread Alexei Starovoitov via iovisor-dev
On Wed, Jun 28, 2017 at 10:38:02PM +0200, Daniel Borkmann wrote: > On 06/28/2017 04:11 PM, Edward Cree wrote: > > On 28/06/17 14:50, Daniel Borkmann wrote: > > > Hi Edward, > > > > > > Did you also have a chance in the meantime to look at reducing complexity > > > along with your unification? I di

Re: [iovisor-dev] Backporting ebpf

2017-06-30 Thread Alexei Starovoitov via iovisor-dev
On Fri, Jun 30, 2017 at 6:05 AM, carlos antonio neira bustos via iovisor-dev wrote: > Hi, > > I just integrated changes from this commit for Kernel version 3.15 > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bd4cf0ed331a275e9bf5a49e6d0fd55dffc551b8 that is just

Re: [iovisor-dev] [PATCH v3 net-next 00/12] bpf: rewrite value tracking in verifier

2017-06-30 Thread Alexei Starovoitov via iovisor-dev
On 6/30/17 9:44 AM, Edward Cree wrote: I haven't measured the test_progs ones, because I *still* haven't gotten around to actually setting up a BPF toolchain (it doesn't help that I'm building everything on a test server that gets reimaged every night to run our nightly tests...). then you'r

Re: [iovisor-dev] [PATCH v3 net-next] bpf/verifier: track liveness for pruning

2017-08-17 Thread Alexei Starovoitov via iovisor-dev
On 8/15/17 12:34 PM, Edward Cree wrote: State of a register doesn't matter if it wasn't read in reaching an exit; a write screens off all reads downstream of it from all explored_states upstream of it. This allows us to prune many more branches; here are some processed insn counts for some Cil

Re: [iovisor-dev] [PATCH v3 net-next] bpf/verifier: track liveness for pruning

2017-08-18 Thread Alexei Starovoitov via iovisor-dev
On 8/18/17 7:16 AM, Edward Cree wrote: On 18/08/17 04:21, Alexei Starovoitov wrote: On 8/15/17 12:34 PM, Edward Cree wrote: State of a register doesn't matter if it wasn't read in reaching an exit; a write screens off all reads downstream of it from all explored_states upstream of it. This al

  1   2   >