Re: [iovisor-dev] AF_XDP query

2019-08-02 Thread William Tu
On Fri, Aug 2, 2019 at 3:23 AM Bjorn Topel wrote: > > On Tue, 30 Jul 2019 at 22:25, Kanthi P wrote: > > > > Hi, > > > > Is it possible to have 2 processes each with its own AF_XDP socket and its > > own UMEM? > > > Hi Kanthi, In the case of OVS AF_XDP netdev, we've used multiple PMD threads.

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

2019-01-09 Thread William Tu
gtime > - March-May timeframe > - 2 days? > > William > * Adding AF_XDP support to vSphere driver Sorry, I mean AF_XDP for veth driver. Thank you William > > > === Attendees === > Brenden Blanco > Quentin Monnet > Jakub Kicinski &g

[iovisor-dev] [PATCHv3 RFC 2/3] tests: add AF_XDP netdev test cases.

2018-11-28 Thread William Tu
interface. Signed-off-by: William Tu --- tests/automake.mk | 17 + tests/system-afxdp-macros.at| 153 tests/system-afxdp-testsuite.at | 26 + tests/system-afxdp-traffic.at | 1541 +++ 4 files changed, 1737 insertions(+) create mode

[iovisor-dev] [PATCHv3 RFC 0/3] AF_XDP netdev support for OVS

2018-11-28 Thread William Tu
r more specific function to pull in pthread library.") - remove the dependency on libbpf and dpif-bpf. instead, use the built-in XDP_ATTACH feature. - data structure optimizations for better performance, see[1] - more test cases support William Tu (3): netdev-afxdp: add new netdev type for AF_XDP

[iovisor-dev] [PATCHv2 RFC 3/3] tests: add afxdp test cases.

2018-08-31 Thread William Tu
The patch adds the test framework for OVS using afxdp. Currently there are two test cases, using ping and http as traffic forwarding through ovs with 2 afxdp netdev. Signed-off-by: William Tu --- tests/automake.mk | 17 + tests/ofproto-macros.at | 1 + tests/system

[iovisor-dev] [PATCHv2 RFC 0/3] AF_XDP support for OVS

2018-08-31 Thread William Tu
e tx part as well as l2fwd 2) try the zero copy mode driver v1->v2: - add a list to maintain unused umem elements - remove copy from rx umem to ovs internal buffer - use hugetlb to reduce misses (not much difference) - use pmd mode netdev in OVS (huge performance improve) - remove malloc dp_packet,

[iovisor-dev] [PATCH RFC 3/3] tests: add afxdp test cases.

2018-08-17 Thread William Tu
The patch adds the test framework for OVS using afxdp. Currently there are two test cases, using ping and http as traffic forwarding through ovs with 2 afxdp netdev. Signed-off-by: William Tu --- tests/automake.mk | 17 + tests/ofproto-macros.at | 1 + tests/system

[iovisor-dev] [PATCH RFC 0/3] AF_XDP support for OVS

2018-08-17 Thread William Tu
e ovs-ebpf implementaion. A copy is put at: https://github.com/williamtu/ovs-ebpf/ branch afxdp-v1 William Tu (3): afxdp: add ebpf code for afxdp and xskmap. netdev-linux: add new netdev type afxdp. tests: add afxdp test cases. acinclude.m4| 1 + bpf/api.h

[iovisor-dev] [RFC PATCHv2 12/13] ofproto: disable megaflow for bpf datapath.

2018-07-14 Thread William Tu
BPF datapath is always exact match. Signed-off-by: William Tu --- ofproto/ofproto-dpif-upcall.c | 4 1 file changed, 4 insertions(+) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 4f696fdca7f6..92a55d0b7768 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b

[iovisor-dev] [RFC PATCHv2 10/13] tests: Add "make check-bpf" traffic target.

2018-07-14 Thread William Tu
Add a separate test file tests/system-bpf-traffic.at for bpf testing. The test cases are a subset of the existing system-traffic.at, and with additional bpf-specific tests. When test passes, the log file is saved under: tests/system-bpf-testsuite.dir// Signed-off-by: William Tu Signed-off

[iovisor-dev] [RFC PATCHv2 09/13] utilities: Add ovs-bpfctl utility.

2018-07-14 Thread William Tu
From: Joe Stringer This new utility is used for standalone probing of BPF datapath state. Signed-off-by: Joe Stringer Signed-off-by: William Tu Signed-off-by: Yifeng Sun Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- utilities/automake.mk | 9 ++ utilities/ovs-bpfctl.8

[iovisor-dev] [RFC PATCHv2 07/13] bpf: implement OVS BPF datapath.

2018-07-14 Thread William Tu
lookup. The protocol headers are auto-generated and defined at generated_headers.h. The bpf_flow_key is extracted using the P4-to-eBPF compiler from the bcc project. A couple of manual tweaks are required, see parser.h. Signed-off-by: William Tu Signed-off-by: Yifeng Sun Signed-off-by: Joe Stringer

[iovisor-dev] [RFC PATCHv2 06/13] dpif-bpf-odp: Add bpf datapath interface and impl.

2018-07-14 Thread William Tu
From: Joe Stringer Add an implementation of the API between the userspace "Open vSwitch Datapath Protocol" and the BPF datapath. Signed-off-by: Joe Stringer Signed-off-by: William Tu Signed-off-by: Yifeng Sun Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- lib/a

[iovisor-dev] [RFC PATCHv2 03/13] lib: implement perf event ringbuffer for upcall.

2018-07-14 Thread William Tu
From: Joe Stringer A flow missed by the match action table in ebpf triggers an upcall, which forwards the information to ovs-vswitchd using skb_perf_event_output helper function. The patch implements the userspace receiving logic. Signed-off-by: Joe Stringer Signed-off-by: William Tu

[iovisor-dev] [RFC PATCHv2 04/13] lib/bpf: add support for managing bpf program/map.

2018-07-14 Thread William Tu
From: Joe Stringer Through libbpf, the patch adds support for loading bpf program and maps, pinning the program and map to /sys/fs/bpf/ovs/, managing the file descriptor of each loaded map, and printting. Signed-off-by: Joe Stringer Co-authored-by: William Tu Co-authored-by: Yifeng Sun

[iovisor-dev] [RFC PATCHv2 05/13] dpif: add 'dpif-bpf' provider.

2018-07-14 Thread William Tu
=3139657 [2] http://openvswitch.org/support/ovscon2016/7/1120-tu.pdf Signed-off-by: Joe Stringer Signed-off-by: William Tu Signed-off-by: Yifeng Sun Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- lib/dpif-bpf.c | 1996 +++ lib/dpif

[iovisor-dev] [RFC PATCHv2 01/13] ovs-bpf: add documentation and configuration.

2018-07-14 Thread William Tu
From: Joe Stringer The patch add bpf installation guide and configuration for linking to libbpf library. Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- Documentation/automake.mk | 1 + Documentation/index.rst | 2 +- Documentation/intro/install

[iovisor-dev] [RFC PATCHv2 02/13] netdev: add ebpf support for netdev provider.

2018-07-14 Thread William Tu
, netdev-linux and netdev-vport, have the actual implementation. Signed-off-by: William Tu Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- include/linux/pkt_cls.h | 21 +++ lib/dpif-netdev.c | 29 ++-- lib/netdev-bsd.c| 2 + lib/netdev-dpdk.c | 2 + lib/netdev

[iovisor-dev] [RFC PATCHv2 00/13] OVS eBPF datapath.

2018-07-14 Thread William Tu
ion. netdev: add ebpf support for netdev provider. lib: implement perf event ringbuffer for upcall. lib/bpf: add support for managing bpf program/map. dpif: add 'dpif-bpf' provider. dpif-bpf-odp: Add bpf datapath interface and impl. utilities: Add ovs-bpfctl utility. William Tu (6):

Re: [iovisor-dev] [RFC PATCH 00/11] OVS eBPF datapath.

2018-07-05 Thread William Tu
> > d71962f ("bpf: allow map helpers access to map values directly") removes > that limitation from the verifier and should allow you to use map values > as map keys directly. 4.18-rc1 has it. > >> Thanks >> William Hi Paul, Thanks a lot! This is very helpful. I'm testing it now, works great so

Re: [iovisor-dev] [RFC PATCH 00/11] OVS eBPF datapath.

2018-07-04 Thread William Tu
On Tue, Jul 3, 2018 at 10:56 AM, Alexei Starovoitov wrote: > On Thu, Jun 28, 2018 at 07:19:35AM -0700, William Tu wrote: >> Hi Alexei, >> >> Thanks a lot for the feedback! >> >> On Wed, Jun 27, 2018 at 8:00 PM, Alexei Starovoitov >> wrote: >> > O

Re: [iovisor-dev] [RFC PATCH 00/11] OVS eBPF datapath.

2018-06-28 Thread William Tu
Hi Alexei, Thanks a lot for the feedback! On Wed, Jun 27, 2018 at 8:00 PM, Alexei Starovoitov wrote: > On Sat, Jun 23, 2018 at 05:16:32AM -0700, William Tu wrote: >> >> Discussion >> == >> We are still actively working on finishing the feature, curren

[iovisor-dev] [RFC PATCH 05/11] dpif: add 'dpif-bpf' provider.

2018-06-23 Thread William Tu
=3139657 [2] http://openvswitch.org/support/ovscon2016/7/1120-tu.pdf Signed-off-by: Joe Stringer Signed-off-by: William Tu Signed-off-by: Yifeng Sun Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- lib/dpif-bpf.c | 1995 +++ lib/dpif

[iovisor-dev] [RFC PATCH 00/11] OVS eBPF datapath.

2018-06-23 Thread William Tu
path interface and impl. utilities: Add ovs-bpfctl utility. William Tu (4): bpf: implement OVS BPF datapath. vswitch/bridge.c: add bpf datapath initialization. tests: Add "make check-bpf" traffic target. vagrant: add ebpf support using ubuntu/bionic Documentation/au

[iovisor-dev] [RFC PATCH 01/11] ovs-bpf: add documentation and configuration.

2018-06-23 Thread William Tu
From: Joe Stringer The patch add bpf installation guide and configuration for linking to libbpf library. Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- Documentation/automake.mk | 1 + Documentation/index.rst | 2 +- Documentation/intro/install

[iovisor-dev] [RFC PATCH 04/11] lib/bpf: add support for managing bpf program/map.

2018-06-23 Thread William Tu
From: Joe Stringer Through libbpf, the patch adds support for loading bpf program and maps, pinning the program and map to /sys/fs/bpf/ovs/, managing the file descriptor of each loaded map, and printting. Signed-off-by: Joe Stringer Co-authored-by: William Tu Co-authored-by: Yifeng Sun

[iovisor-dev] [RFC PATCH 10/11] tests: Add "make check-bpf" traffic target.

2018-06-23 Thread William Tu
Add a separate test file tests/system-bpf-traffic.at for bpf testing. The test cases are a subset of the existing system-traffic.at, and with additional bpf-specific tests. When test passes, the log file is saved under: tests/system-bpf-testsuite.dir// Signed-off-by: William Tu Signed-off

[iovisor-dev] [RFC PATCH 03/11] lib: implement perf event ringbuffer for upcall.

2018-06-23 Thread William Tu
From: Joe Stringer A flow missed by the match action table in ebpf triggers an upcall, which forwards the information to ovs-vswitchd using skb_perf_event_output helper function. The patch implements the userspace receiving logic. Signed-off-by: Joe Stringer Signed-off-by: William Tu

[iovisor-dev] [RFC PATCH 08/11] vswitch/bridge.c: add bpf datapath initialization.

2018-06-23 Thread William Tu
The patch initializes the bpf datapath when bridge starts. The check_support could be avoided since we know what datapath bpf program supports what feature. Signed-off-by: Joe Stringer Signed-off-by: William Tu Signed-off-by: Yifeng Sun Co-authored-by: William Tu Co-authored-by: Yifeng Sun

[iovisor-dev] [RFC PATCH 11/11] vagrant: add ebpf support using ubuntu/bionic

2018-06-23 Thread William Tu
VAGRANT_VAGRANTFILE=Vagrantfile-eBPF vagrant up Signed-off-by: William Tu Signed-off-by: Yifeng Sun --- Makefile.am | 1 + Vagrantfile-eBPF | 99 2 files changed, 100 insertions(+) create mode 100644 Vagrantfile-eBPF diff --git

[iovisor-dev] [RFC PATCH 02/11] netdev: add ebpf support for netdev provider.

2018-06-23 Thread William Tu
, netdev-linux and netdev-vport, have the actual implementation. Signed-off-by: William Tu Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- include/linux/pkt_cls.h | 21 +++ lib/dpif-netdev.c | 29 ++-- lib/netdev-bsd.c| 2 + lib/netdev-dpdk.c | 2 + lib/netdev

[iovisor-dev] [RFC PATCH 09/11] utilities: Add ovs-bpfctl utility.

2018-06-23 Thread William Tu
From: Joe Stringer This new utility is used for standalone probing of BPF datapath state. Signed-off-by: Joe Stringer Signed-off-by: William Tu Signed-off-by: Yifeng Sun Co-authored-by: William Tu Co-authored-by: Yifeng Sun --- utilities/automake.mk | 9 ++ utilities/ovs-bpfctl.8

[iovisor-dev] [RFC PATCH 07/11] bpf: implement OVS BPF datapath.

2018-06-23 Thread William Tu
lookup. The protocol headers are auto-generated and defined at generated_headers.h. The bpf_flow_key is extracted using the P4-to-eBPF compiler from the bcc project. A couple of manual tweaks are required, see parser.h. Signed-off-by: William Tu Signed-off-by: Yifeng Sun Signed-off-by: Joe Stringer

Re: [iovisor-dev] GCOV coverage on BPF program

2018-06-19 Thread William Tu
On Tue, Jun 19, 2018 at 8:47 AM, Y Song wrote: > On Tue, Jun 19, 2018 at 7:54 AM, William Tu wrote: >> Hi, >> >> I'm trying to run coverage tests on my bpf program and it compiles fails. >> I guess BPF does not support '--coverage' flags? > > This will not work.

[iovisor-dev] GCOV coverage on BPF program

2018-06-19 Thread William Tu
Hi, I'm trying to run coverage tests on my bpf program and it compiles fails. I guess BPF does not support '--coverage' flags? root@boxes:~/ovs# clang-4.0 -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter

Re: [iovisor-dev] BPF verifier: ctx+const+const is not allowed

2018-04-29 Thread William Tu via iovisor-dev
erstand why the compiler generates r1+0 and whether >> we could possibly avoid it. >> >> Thanks, >> Yonghong >> >> >> On Sat, Apr 28, 2018 at 7:57 AM, William Tu via iovisor-dev >> <iovisor-dev@lists.iovisor.org> wrote: >>> Hi, >>

[iovisor-dev] BPF verifier: ctx+const+const is not allowed

2018-04-28 Thread William Tu via iovisor-dev
Hi, We're hitting a BPF verifier error saying "dereference of modified ctx ptr R1 off=36+0, ctx+const is allowed, ctx+const+const is not " but actually the 2nd const is 0. I don't know why compiler generate (r1+0) in this case: 602: (61) r4 = *(u32 *)(r1 +0) verifier log 594: (15) if r6

Re: [iovisor-dev] Is there information about eBPF + OVS ?

2017-12-27 Thread William Tu via iovisor-dev
t find any information on how to install it. >> >> If you are using eBPF + OVS, please let me know if you have any insights >> about it. > > I'll redirect that question to William Tu (Cc'ed). > > -- > Best regards, > Jesper Dangaard Brouer >

Re: [iovisor-dev] [PATCH RFC] bpf: add connection tracking helper functions

2017-09-04 Thread William Tu via iovisor-dev
On Sun, Sep 3, 2017 at 3:26 PM, Thomas Graf <tg...@suug.ch> wrote: > On 1 September 2017 at 04:30, William Tu via iovisor-dev > <iovisor-dev@lists.iovisor.org> wrote: > > This patch adds two BPF conntrack helper functions, bpf_ct_lookup() > > and bpf_ct_commit(), to

Re: [iovisor-dev] [PATCH RFC] bpf: add connection tracking helper functions

2017-09-03 Thread William Tu via iovisor-dev
Hi Alexei, Thanks, I do see the lockdep complain now. I will switch to use GFP_ATOMIC. William On Sat, Sep 2, 2017 at 8:20 AM, William Tu <u9012...@gmail.com> wrote: > > > On Fri, Sep 1, 2017 at 10:53 PM, Alexei Starovoitov < > alexei.starovoi...@gmail.com> wrote: >

[iovisor-dev] [PATCH RFC] bpf: add connection tracking helper functions

2017-09-01 Thread William Tu via iovisor-dev
! Signed-off-by: William Tu <u9012...@gmail.com> Cc: Joe Stringer <j...@ovn.org> Cc: Daniel Borkmann <dan...@iogearbox.net> Cc: Alexei Starovoitov <a...@kernel.org> --- include/uapi/linux/bpf.h | 31 + net/core/filter.c

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

2017-04-20 Thread William Tu via iovisor-dev
On Wed, Apr 19, 2017 at 10:44 AM, William Tu <u9012...@gmail.com> wrote: > Thanks for the reply. > >> could you increase the max to 1M or so >> and see what the actual number of insns it needs? > > it takes 112,762 insns. And the kernel runs a while (~6 seconds) to

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

2017-04-19 Thread William Tu via iovisor-dev
Thanks for the reply. > could you increase the max to 1M or so > and see what the actual number of insns it needs? it takes 112,762 insns. And the kernel runs a while (~6 seconds) to verify it. > If the program is short, as you say, can you debug > the state prunning to see why it's not

Re: [iovisor-dev] BPF unrolled loop doesn't work and its workaround

2017-04-19 Thread William Tu via iovisor-dev
t; Yonghong > > > On Tue, Apr 18, 2017 at 9:00 PM, William Tu via iovisor-dev > <iovisor-dev@lists.iovisor.org> wrote: >> >> Hi Mauricio, >> >> Thanks! Yes, I think like you said the compiler couldn't unroll in >> this case. Because we are passing

Re: [iovisor-dev] BPF unrolled loop doesn't work and its workaround

2017-04-18 Thread William Tu via iovisor-dev
On Tue, Apr 18, 2017 at 6:22 PM, Mauricio Vasquez <mauricio.vasq...@polito.it> wrote: > Hi William, > > On 04/18/2017 06:54 PM, William Tu via iovisor-dev wrote: >> >> Hi, >> >> I found that if the loop variable "int i" is used in the map look

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

2017-04-14 Thread William Tu via iovisor-dev
Error fetching program/map! Regards, William On Fri, Feb 10, 2017 at 10:59 AM, Alexei Starovoitov <alexei.starovoi...@gmail.com> wrote: > On Fri, Feb 10, 2017 at 9:08 AM, William Tu <u9012...@gmail.com> wrote: >> my program is too huge so I start with simple example using

Re: [iovisor-dev] BPF verifier: cannot add integer value with 0 upper zero bits to ptr_to_packet

2017-02-23 Thread William Tu via iovisor-dev
Borkmann <dan...@iogearbox.net> wrote: > On 02/17/2017 06:07 PM, William Tu via iovisor-dev wrote: >> >> Hi, >> >> I encountered another BPF verifier issue related to my previous one >> https://lists.iovisor.org/pipermail/iovisor-dev/2017-January/000603.html >> &g

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

2017-02-09 Thread William Tu via iovisor-dev
On Thu, Feb 9, 2017 at 5:11 AM, Daniel Borkmann <dan...@iogearbox.net> wrote: > On 02/08/2017 09:22 PM, William Tu via iovisor-dev wrote: >> >> Hi, >> >> I have a program which I use around at most 300byte of local stack as >> below. The largest struct is

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

2017-02-08 Thread William Tu via iovisor-dev
Hi, I have a program which I use around at most 300byte of local stack as below. The largest struct is the "struct Headers" which is around 80 byte. However, when loading into the verifier, it says 393: (7b) *(u64 *)(r10 -56) = r1 394: (05) goto pc+56 451: (7b) *(u64 *)(r10 -528) = r0 invalid

Re: [iovisor-dev] BPF verifier: cannot add integer value with 0 upper zero bits to ptr_to_packet

2017-01-18 Thread William Tu via iovisor-dev
>max_value; + } Then it passes verifier. William On Tue, Jan 17, 2017 at 3:16 PM, Daniel Borkmann <dan...@iogearbox.net> wrote: > Hi William, > > > On 01/12/2017 07:32 PM, William Tu via iovisor-dev wrote: >> >> Hi, >> I encounter the following BPF veri

Re: [iovisor-dev] direct packet access boundary check

2017-01-16 Thread William Tu via iovisor-dev
thanks! code generation is a good idea. On Fri, Jan 13, 2017 at 2:28 PM, Thomas Graf <tg...@suug.ch> wrote: > On 12 January 2017 at 10:50, William Tu via iovisor-dev > <iovisor-dev@lists.iovisor.org> wrote: >> Hi, >> >> I observed that for direct pac

[iovisor-dev] BPF verifier: cannot add integer value with 0 upper zero bits to ptr_to_packet

2017-01-12 Thread William Tu via iovisor-dev
Hi, I encounter the following BPF verifier error: from 28 to 30: R0=imm1,min_value=1,max_value=1 R1=pkt(id=0,off=0,r=22) R2=pkt_end R3=imm144,min_value=144,max_value=144 R4=imm0,min_value=0,max_value=0 R5=inv48,min_value=2054,max_value=2054 R10=fp 30: (bf) r5 = r3 31: (07) r5 += 23 32: (77) r5

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

2017-01-09 Thread William Tu via iovisor-dev
C and look for inline asm usage. > > On Fri, Jan 6, 2017 at 1:30 PM, William Tu via iovisor-dev > <iovisor-dev@lists.iovisor.org> wrote: >> thanks >> the code is at >> https://gist.github.com/williamtu/7e41392a34672d7b4574aee063ea4a3b >> >> >> On Fri, J

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

2017-01-06 Thread William Tu via iovisor-dev
thanks the code is at https://gist.github.com/williamtu/7e41392a34672d7b4574aee063ea4a3b On Fri, Jan 6, 2017 at 1:21 PM, Brenden Blanco <bbla...@gmail.com> wrote: > Yes, it would be helpful to share the code. > > On Fri, Jan 6, 2017 at 12:34 PM, William Tu via iovisor-dev

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

2017-01-06 Thread William Tu via iovisor-dev
Hi, I'm adding parser and extra map lookup into the xdp1_kern.c and encounter this LLVM error. My environment: clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) LLVM version 4.0.0svn I think it might be related to bpf map access, if I comment out the map access code, then the problem goes

Re: [iovisor-dev] kprobe/kretprobe on cls_bpf_classify

2016-10-31 Thread William Tu via iovisor-dev
Hi Brenden, thanks, I will double check my kernel settings. On Sat, Oct 29, 2016 at 3:16 PM, Brenden Blanco <bbla...@plumgrid.com> wrote: > > > On Sat, Oct 29, 2016 at 1:27 AM, William Tu via iovisor-dev > <iovisor-dev@lists.iovisor.org> wrote: >> >

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

2016-10-24 Thread William Tu via iovisor-dev
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 that. So at beginning when loading the BPF, I pre-allocate a pool of hash maps and

[iovisor-dev] BPF switch case LLVM error

2016-10-22 Thread William Tu via iovisor-dev
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=9] 0x3bc98f0: i64,ch = load 0x3bb0db0:1, 0x3baf588, 0x3bc8c58

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

2016-08-22 Thread William Tu via iovisor-dev
I see, thanks! I miss the fact that the xdp prog is attached to struct e1000_adapter *adapter, which is different per netdev, and thus different per ifindex. On Mon, Aug 22, 2016 at 4:47 PM, Alexei Starovoitov <alexei.starovoi...@gmail.com> wrote: > On Mon, Aug 22, 2016 at 4:26 PM, W

[iovisor-dev] question about struct xdp_md

2016-08-01 Thread William Tu via iovisor-dev
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 example in xdp2_kern.c int xdp_prog1(struct xdp_md *ctx) { void *data_end = (void