Re: [iovisor-dev] How can I know XDP supporting NICs?

2017-04-05 Thread Paul Chaignon via iovisor-dev
2017-04-05 13:17 GMT+02:00 Taekho Nam via iovisor-dev < iovisor-dev@lists.iovisor.org>: > Dear All, > > > I'm studying XDP for acceleation function. > > > I think that XDP appears to have been implemented only on Mellanox NIC, > ConnectX-3 Pro including specific network driver, mlx4. Is it right?

Re: [iovisor-dev] BPF.attach_kprobe() register pre/post handler for kprobe?

2017-08-03 Thread Paul Chaignon via iovisor-dev
Hi Nan, With BPF.attack_kprobe, the BPF program is attached as a pre-handler. You can use BPF.attach_kretprobe to attach it as a post-handler. Paul On 04/08/2017 05:30, Nan Xiao via iovisor-dev wrote: Hi all, When reading Kprobes docume

Re: [iovisor-dev] multi-key eBPF map

2017-08-10 Thread Paul Chaignon via iovisor-dev
Hi Mauricio, It sounds like you're trying to implement wildcard matching over a hash map. Using all the keys would be an exact match, whereas using a subset of the keys would mean wildcarding the other. If that's the case, you might want to contact William Tu at VMware, who's been working on

Re: [iovisor-dev] ebpf kprobe modify skb ?

2017-08-24 Thread Paul Chaignon via iovisor-dev
On Fri, Aug 25, 2017 at 4:28 AM, 周小明 via iovisor-dev < iovisor-dev@lists.iovisor.org> wrote: > Now i want to modify something of the skb with the ebpf in the prog_type > kprobe. > However, the help function `bpf_skb_store_bytes` is not supported with the > prog_type BPF_PROG_TYPE_KPROBE. > I test

[iovisor-dev] [PATCH RFC] bpf: allow map helpers access to map values directly

2017-09-08 Thread Paul Chaignon via iovisor-dev
Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. Allow these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. This change removes the need for an extra copy to the stack when using a map value to perform a

Re: [iovisor-dev] [PATCH RFC] bpf: allow map helpers access to map values directly

2017-09-09 Thread Paul Chaignon via iovisor-dev
On Fri, Sep 08, 2017 at 05:19:41PM -0700, Alexei Starovoitov via iovisor-dev wrote: > On Fri, Sep 08, 2017 at 10:42:06PM +0200, Paul Chaignon wrote: > > Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only > > access stack and packet memory. Allow these helpers to directly acc

[iovisor-dev] [PATCH RFC v2] bpf: allow map helpers access to map values directly

2017-09-09 Thread Paul Chaignon via iovisor-dev
Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. Allow these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. This change removes the need for an extra copy to the stack when using a map value to perform a

Re: [iovisor-dev] [PATCH RFC v2] bpf: allow map helpers access to map values directly

2017-09-12 Thread Paul Chaignon via iovisor-dev
On Mon, Sep 11, 2017 at 06:14:59PM -0700, Alexei Starovoitov via iovisor-dev wrote: > On Sat, Sep 09, 2017 at 04:31:16PM +0200, Paul Chaignon wrote: > > Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only > > access stack and packet memory. Allow these helpers to directly acc

Re: [iovisor-dev] Tracing eBPF programs use only one core

2017-09-13 Thread Paul Chaignon via iovisor-dev
On Wed, Sep 13, 2017 at 8:59 AM, Fabio Salvini via iovisor-dev < iovisor-dev@lists.iovisor.org> wrote: > Hi, > > > I have written a simple tracing program, attached to kprobe " > __netif_receive_skb_core", to analyze some sk_buff fields. > > I have done some stress tests and I have always seen onl

Re: [iovisor-dev] Tracing eBPF programs use only one core

2017-09-13 Thread Paul Chaignon via iovisor-dev
On 13/09/2017 17:01, Fabio Salvini wrote: Thanks for your suggestions. Sorry for the naive question: any idea how can I distribute the traffic among different cores? If my NIC supports RSS mechanism should it do automatically, right? Yes, if you have multiple flows in your incoming traff

Re: [iovisor-dev] [PATCH RFC v2] bpf: allow map helpers access to map values directly

2017-09-18 Thread Paul Chaignon via iovisor-dev
On Mon, Sep 11, 2017 at 06:14:59PM -0700, Alexei Starovoitov via iovisor-dev wrote: > On Sat, Sep 09, 2017 at 04:31:16PM +0200, Paul Chaignon wrote: > > Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only > > access stack and packet memory. Allow these helpers to directly acc

Re: [iovisor-dev] eBPF language choice

2017-09-28 Thread Paul Chaignon via iovisor-dev
On Tue, Sep 26, 2017 at 10:44 AM, Alban Crequy via iovisor-dev < iovisor-dev@lists.iovisor.org> wrote: > On Fri, Sep 22, 2017 at 5:43 PM, zhiting zhu via iovisor-dev > wrote: > > Dear All, > > > > I have a question about what language people use to write eBPF program. > We > > can write it in C a

Re: [iovisor-dev] [PATCH RFC v2] bpf: allow map helpers access to map values directly

2017-09-28 Thread Paul Chaignon via iovisor-dev
On Tue, Sep 19, 2017 at 10:03:23PM -0700, Alexei Starovoitov via iovisor-dev wrote: > On Mon, Sep 18, 2017 at 11:14 AM, Paul Chaignon > wrote: > >> > + BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, > >> > + offsetof(struct test_val, foo)), > >> > >> there are

[iovisor-dev] [PATCH RFC v3] bpf: allow map helpers access to map values directly

2017-09-28 Thread Paul Chaignon via iovisor-dev
Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. Allow these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. This change removes the need for an extra copy to the stack when using a map value to perform a

Re: [iovisor-dev] Simple example to start XDP/eBPF programming

2017-12-18 Thread Paul Chaignon via iovisor-dev
On Sun, Dec 17, 2017 at 12:55 PM, Avi Cohen (A) via iovisor-dev < iovisor-dev@lists.iovisor.org> wrote: > I've installed (packaged) bcc as per https://github.com/iovisor/bcc > /blob/master/INSTALL.md > Now I want to start playing. a simple one like 'hello-world' . I > couldn't find a guide for t

Re: [iovisor-dev] Simple example to start XDP/eBPF programming

2017-12-18 Thread Paul Chaignon via iovisor-dev
On Mon, Dec 18, 2017 at 10:23 AM, Avi Cohen (A) wrote: > [Avi Cohen (A)] > > Thank you Paul and Y. Song > I have 2 questions: > 1. I’m already running some ‘packet filtering’ , e.g ICMP pkts, I try to > ’DROP’ > all ICMP pkts (return 0) Indeed it is not sent to userspace (python > program) ,

Re: [iovisor-dev] Access to struct with kprobe

2018-04-21 Thread Paul Chaignon via iovisor-dev
On Wed, Apr 18, 2018 at 6:17 PM, Aharram Bilal via iovisor-dev < iovisor-dev@lists.iovisor.org> wrote: > Dear all > > I'm a student at Paris-VI Univercity and currently I'm working on a > project involving eBPF with linux network stack ,and I need some guidence. > > If we attach the eBPF program

[iovisor-dev] [PATCH bpf-next v4 0/2] bpf: allow map helpers access to map values directly

2018-04-22 Thread Paul Chaignon via iovisor-dev
Currently, helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. This patchset allows these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. The first patch changes the verifier; the second adds new test cases.

[iovisor-dev] [PATCH bpf-next v4 1/2] bpf: allow map helpers access to map values directly

2018-04-22 Thread Paul Chaignon via iovisor-dev
Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. Allow these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. This change removes the need for an extra copy to the stack when using a map value to perform a

[iovisor-dev] [PATCH bpf-next v4 2/2] tools/bpf: add verifier tests for accesses to map

2018-04-22 Thread Paul Chaignon via iovisor-dev
This patch adds new test cases for accesses to map values from map helpers. Signed-off-by: Paul Chaignon --- tools/testing/selftests/bpf/test_verifier.c | 266 1 file changed, 266 insertions(+) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testin

[iovisor-dev] [PATCH bpf-next v5 0/2] bpf: allow map helpers access to map values directly

2018-04-24 Thread Paul Chaignon via iovisor-dev
Currently, helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. This patchset allows these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. The first patch changes the verifier; the second adds new test cases.

[iovisor-dev] [PATCH bpf-next v5 1/2] bpf: allow map helpers access to map values directly

2018-04-24 Thread Paul Chaignon via iovisor-dev
Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only access stack and packet memory. Allow these helpers to directly access map values by passing registers of type PTR_TO_MAP_VALUE. This change removes the need for an extra copy to the stack when using a map value to perform a

[iovisor-dev] [PATCH bpf-next v5 2/2] tools/bpf: add verifier tests for accesses to map values

2018-04-24 Thread Paul Chaignon via iovisor-dev
This patch adds new test cases for accesses to map values from map helpers. Signed-off-by: Paul Chaignon --- tools/testing/selftests/bpf/test_verifier.c | 266 1 file changed, 266 insertions(+) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testin

Re: [iovisor-dev] [PATCH bpf-next v4 1/2] bpf: allow map helpers access to map values directly

2018-04-24 Thread Paul Chaignon via iovisor-dev
On 04/23/2018 11:18 PM +0200, Daniel Borkmann wrote: > On 04/22/2018 11:52 PM, Paul Chaignon wrote: > > Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only > > access stack and packet memory. Allow these helpers to directly access > > map values by passing registers of type PT

[iovisor-dev] Incorrect "invalid indirect read" error from verifier?

2018-05-09 Thread Paul Chaignon via iovisor-dev
Hi, I'm getting an "invalid indirect read from stack" when trying to run the following bcc script: paul$ cat tmp.py from bcc import BPF bpf_text = """ #include #include #include BPF_HASH(currsock, u32, struct sock **); int trace_entry(struct pt_regs *ctx, struct sock *sk) { u32 zero = 0;

Re: [iovisor-dev] Incorrect "invalid indirect read" error from verifier?

2018-05-09 Thread Paul Chaignon via iovisor-dev
On Wed, May 09, 2018 at 07:26:17AM -0700, Alexei Starovoitov wrote: > On Wed, May 9, 2018 at 4:48 AM, Paul Chaignon via iovisor-dev > wrote: > > Hi, > > > > I'm getting an "invalid indirect read from stack" when trying to run the > > following bcc

Re: [iovisor-dev] Incorrect "invalid indirect read" error from verifier?

2018-05-09 Thread Paul Chaignon via iovisor-dev
On Wed, May 9, 2018 at 4:38 PM, Paul Chaignon wrote: > On Wed, May 09, 2018 at 07:26:17AM -0700, Alexei Starovoitov wrote: > > On Wed, May 9, 2018 at 4:48 AM, Paul Chaignon via iovisor-dev > > wrote: > > > Hi, > > > > > > I'm getting an "