Re: [iovisor-dev] Problem with ebpf program array map

2017-03-03 Thread Brenden Blanco via iovisor-dev
No, really the only thing you are allowed to do from bpf on a prog array is call() and delete(). It is a one-way street. Unfortunately you will have to keep track of which programs are in which slots from the userspace side entirely. On Fri, Mar 3, 2017 at 12:52 AM, Tanja Ulmen via iovisor-dev w

Re: [iovisor-dev] Problem with ebpf program array map

2017-03-03 Thread Tanja Ulmen via iovisor-dev
Is there another way to look into a program array? I'm currently using the program below: prog = """ BPF_TABLE("prog", int, int, prog_array, 5); int hello(struct __sk_buff* ebpf_packet) { int key = 1; int *value; bpf_trace_printk("Hello, World!\\n"); value = bpf_map_lookup

Re: [iovisor-dev] Problem with ebpf program array map

2017-03-02 Thread Mauricio Vasquez via iovisor-dev
On 02/28/2017 06:01 AM, Tanja Ulmen wrote: Hi Mauricio, thank you for the example program, it works and I get both outputs. Are you calling load_func() for the program in the .c file? Yes I'm calling load_func() for the program. My program is similar to the endToEndTest.py of the P4 fronten

Re: [iovisor-dev] Problem with ebpf program array map

2017-02-28 Thread Tanja Ulmen via iovisor-dev
Hi Mauricio, thank you for the example program, it works and I get both outputs. Are you calling load_func() for the program in the .c file? Yes I'm calling load_func() for the program. My program is similar to the endToEndTest.py of the P4 frontend (https://github.com/iovisor/bcc/blob/0c8c17

Re: [iovisor-dev] Problem with ebpf program array map

2017-02-23 Thread Mauricio Vasquez via iovisor-dev
Hello Tanja, On 02/20/2017 09:53 AM, Tanja Ulmen via iovisor-dev wrote: Hi, I'm new to eBPF and bcc and I hope this is the right platform for my question. Welcome! I have the following problem while working with a bpf program array map: I have a C file that contains a program map like this

[iovisor-dev] Problem with ebpf program array map

2017-02-20 Thread Tanja Ulmen via iovisor-dev
Hi, I'm new to eBPF and bcc and I hope this is the right platform for my question. I have the following problem while working with a bpf program array map: I have a C file that contains a program map like this: BPF_TABLE("prog", int, int, prog_array, 2); Later on it is called with prog_array