Re: BPF dev env
O Mahony, Billy <billy.o.mahony@...>
Thanks Brendan,
Good to know. I’ll take you up on that offer if (when!) I run in to problems.
/Billy.
From: Brenden Blanco [mailto:bblanco@...]
Sent: Tuesday, October 27, 2015 10:50 PM To: O Mahony, Billy <billy.o.mahony@...> Cc: iovisor-dev@... Subject: Re: [iovisor-dev] BPF dev env
Hi Billy,
Yes, a VBox will work just fine to develop in. I personally test in both physical and kvm environments. AWS also works. So far, most of the examples are self-contained on a single machine, running in namespaces, etc.
Thanks, let us know if you have any troubles getting the environment working!
-Brenden
On Tue, Oct 27, 2015 at 3:00 AM, O Mahony, Billy via iovisor-dev <iovisor-dev@...> wrote:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IO Visor booth volunteers for OPNFV
Valentina Alaria <vale@...>
If you plan to attend OPNFV next week in Burlingame please LMK if you'd be available to help with booth duty on Wednesday 11/11 and Thursday 11/12. We have extra passes available for booth duty volunteers. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bpf_trace_printk
O Mahony, Billy <billy.o.mahony@...>
Hi,
Where should I see o/p from bpf_trace_printk() ? I've added bpf_trace_printk to examples/simple_tc. And also a long sleep after the veth pair is setup. It compiles without complaint. After I start the simple_tc I add ip addrs to the veth pair with ifconfig. And ping the assigned addresses which works. But I don't see any o/p in dmesg for example. Below are the changes to simple_tc.py along with the filter itself which had to go into it's own .c file in order to compile once the trace was added. Regards, Billy. billy@ubuntu:~/iovisor/bcc/examples$ git diff diff --git a/examples/simple_tc.py b/examples/simple_tc.py index 4dd8aa5..01843b3 100755 --- a/examples/simple_tc.py +++ b/examples/simple_tc.py @@ -4,6 +4,7 @@ from bcc import BPF from pyroute2 import IPRoute +import time ipr = IPRoute() @@ -14,7 +15,7 @@ int hello(struct __sk_buff *skb) { """ try: - b = BPF(text=text, debug=0) + b = BPF(src_file="simple_tc.c", debug=0) fn = b.load_func("hello", BPF.SCHED_CLS) ipr.link_create(ifname="t1a", kind="veth", peer="t1b") idx = ipr.link_lookup(ifname="t1a")[0] @@ -25,6 +26,7 @@ try: ipr.tc("add", "sfq", idx, "1:") ipr.tc("add-filter", "bpf", idx, ":1", fd=fn.fd, name=fn.name, parent="1:", action="ok", classid=1) + time.sleep(60) finally: if "idx" in locals(): ipr.link_remove(idx) print("BPF tc functionality - SCHED_CLS: OK") billy@ubuntu:~/iovisor/bcc/examples$ billy@ubuntu:~/iovisor/bcc$ cat examples/simple_tc.c #include <uapi/linux/ptrace.h> #include <linux/blkdev.h> int hello(struct __sk_buff *skb) { bpf_trace_printk("meep\n"); return 1; } |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
Daniel Borkmann
On 11/11/2015 06:41 PM, O Mahony, Billy via iovisor-dev wrote:
Hi,Depends where you have tracefs mounted, f.e. cat /sys/kernel/debug/tracing/trace_pipe Cheers, Daniel |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
Brenden Blanco <bblanco@...>
Hi,
The output goes into /sys/kernel/debug/tracing/trace_pipe (or elswhere depending where you mount debugfs). If you look at the hello_world.py example, it uses a helper in the BPF class, trace_print(), which does a continuous read from the trace_pipe for you. You could add a similar b.trace_print() in place of time.sleep(60), or open a separate shell and do `cat /sys/kernel/debug/tracing/trace_pipe`. Thanks, Brenden On Wed, Nov 11, 2015 at 9:41 AM, O Mahony, Billy via iovisor-dev <iovisor-dev@...> wrote: Hi, |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
conf call today for IOVisor
Pere Monclus
we are having some problems with Webex and most of the people is busy with OPNFV conference. We will reschedule it. regards, pere |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
O Mahony, Billy <billy.o.mahony@...>
Hi Daniel & Brendan,
toggle quoted message
Show quoted text
Cool. Thanks for the help! One thing I notice is that immediately after I assign ip addrs to the endpoints of the veth pair I see several log messages: <idle>-0 [000] .Ns. 73082.699758: : meep ksoftirqd/0-3 [000] ..s. 73082.699828: : meep <idle>-0 [000] ..s. 73082.960638: : meep kworker/0:2-4011 [000] ..s. 73083.146783: : meep kworker/0:2-4011 [000] ..s1 73083.346750: : meep <idle>-0 [000] ..s. 73083.368876: : meep kworker/0:2-4011 [000] ..s. 73084.146130: : meep kworker/0:2-4011 [000] ..s. 73084.146238: : meep But thereafter when I ping either of the assigned addresses I don't see any further invocations of the log message. I was expecting it to be called for each eth frame received by the either of the interfaces. Billy. -----Original Message----- |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
Daniel Borkmann
On 11/12/2015 12:14 AM, O Mahony, Billy wrote:
... One thing I notice is that immediately after I assign ip addrs to the endpoints of the veth pair I see several log messages:Ahh, they're not being moved into different netns'es in your given setup, right? So, maybe try ping with -I on the peer? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
Alexei Starovoitov
On Wed, Nov 11, 2015 at 3:14 PM, O Mahony, Billy via iovisor-dev
<iovisor-dev@...> wrote: if you're actually doing 'ping IPaddr' of veth interface, it doesn't actually go into that veth. If 'ip -s link show veth0' doesn't show stats incrementing it means that packets are not seen by the device, so won't be seen by qdisc and won't be seen by bpf either. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
O Mahony, Billy <billy.o.mahony@...>
Hi Alexei,
toggle quoted message
Show quoted text
Thanks. I suspected something surprising like that going on! I'd like to build a toy router with eBPF just to route some frames between interfaces. So ideally I'd like to attach my eBPF program to frame ingress on a device, parse it and egress it on another device. What's the best example to deep-dive into - I was thinking tc_neighbor_sharing? /Billy. -----Original Message----- |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: bpf_trace_printk
Brenden Blanco <bblanco@...>
Hi, I would suggest something like tests/cc/test_brb.py or
tests/cc/test_brb2.py. The brb stands for bridge-router-bridge, with a router implemented in a linux namespace in both versions. brb has the bridge implemented in bpf, while brb2 has the bridge implemented as a namespace, so you can compare and contrast. On Thu, Nov 12, 2015 at 1:57 AM, O Mahony, Billy via iovisor-dev <iovisor-dev@...> wrote: Hi Alexei, |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Update] IOvisor TSC & Dev Members call
bblanco@...
Hi All, It has been several weeks since our last meeting, so let's meet tomorrow and recap as well as plan the next steps! There has been quite a bit of activity over the past month which would be good to summarize, including many conferences and some coding updates. * Conference summary * Coding
Please let us know if there is an additional topic to be added to the agenda.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: [Update] IOvisor TSC & Dev Members call
Keith Burns (krb) <krb@...>
See you there. On Nov 24, 2015 10:27 PM, bblanco@... wrote:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Update] IOvisor TSC & Dev Members call
Pere Monclus
here you have the correct invite for today https://plumgrid.webex.com/plumgrid/e.php?MTID=m7d73fc36b3276e943c1270060b2c628a
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IOVisor TSC/Dev Meeting Minutes 2015-11-25
Brenden Blanco <bblanco@...>
Hi All, here are the (belated due to holidays) meeting minutes for last week. === Attendees === Affan Syed Brendan Gregg Brenden Blanco Daniel Borkmann Jianwen Pi Keith Burns Luis Rodriguez Mihai Budiu Pere Monclus Rich Lane Yonghong Song === Discussion === We had a lively discussion about IO Modules. The thesis so far is that the definition of an IO Module has not yet been clearly specified, and eBPF itself is too flexible and too open (many hook points, many use cases with different inputs, etc.) to the point that it is difficult to conceptualize the notion of a module. Simple tools such as the storage monitoring examples are okay and self contained. But a chain of IO modules that interacts i) between themselves, ii) with linux kernel components, will be difficult until we close the definition and remove some of the flexibility. AI: Brenden - create a proposal of 'net interface' and 'io module' to discuss within the mailing list note: for now defocus some on performance, e.g. no high rate CP<->DP interaction The idea will be to build up the initial concepts around the GBP use case. Also, so far there is a concept of a host local module manager, comparable to libvirtd to networking, which holds the running modules and their relationship/connectivity to each other. A developer from PG with some spare cycles has been prototyping a GUI that would one day go on top of this rest API, which was demoed during this meeting. The code for this should go up on github before the next meeting. === Summary of previous month activities === Since the last meeting, IOVisor participated in several conferences: OpenStack Tokyo - 2 hour discussion/tutorial - NFV architecture overview from PoV of Huawei - demo of Mesos+docker/libnetwork+iovisor integration OPNFV - several panels - 2 days of booth, lots of good questions P4 Workshop - 15 minute intro to iovisor+P4 - p4 + rest api + iperf demo AI: simple_router demo was buggy, Mihai to add bugfix === Code changes === iovisor/bcc: - p4 frontend updates from mbudiu - p4-demo branch is available for people to try - upcoming: packaging support for suse and archlinux iovisor/iomodules: new project, rest-based plugin manager for iomodules odl/gbp: iovisor renderer support in progress from kburns+adetalhouet |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IOVisor TSC & Dev Members call Agenda
Brenden Blanco <bblanco@...>
Hi All, Tomorrow in the TSC/Dev call, I would like to continue on the previous meeting's topic of IO Module definition. To bring some concreteness to the discussion, I have just pushed a set of sample code for an IO Module Manager (I code-named it "hive" for now, though that name is already taken) to https://github.com/iovisor/iomodules. What you'll find there is by no means complete (nor really even functional), but hopefully there is enough meat there to be able to serve as a talking point for a discussion. Of note, the files iomodule.h and the contents of server.go:NewServer() capture my thoughts for the minimal dataplane and control plane APIs, respectively. If there are additional topics to add to the agenda, please reply here as well. In the morning I will send Webex Dial-in info. Thanks, Brenden Blanco |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: IOVisor TSC & Dev Members call Agenda
Brenden Blanco <bblanco@...>
Hi All, below you will find the dial-in info for the meeting. If you are receiving this email because you are on the iovisor-dev@... mailing list, please also consider yourself invited! ===================================================
On Tue, Dec 8, 2015 at 11:58 PM, Brenden Blanco <bblanco@...> wrote:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changing packet fields before redirect
Ashhad Sheikh <ashhadsheikh394@...>
Hello, I there any way ton change the packet fields in BPF program before redirecting it to another ifindex. I want to make changes in packet fields before redirecting it to next ifindex i.e I want to change ARP request packet to response packet by making changes in its field. arp->oper=0x0002 bpf_clone_redirect won't work in this scenerio, tried bpf_redirect too but no luck so far. Regards Ashhad |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: Changing packet fields before redirect
Alexei Starovoitov
On Sat, Dec 19, 2015 at 11:20 AM, Ashhad Sheikh via iovisor-dev
<iovisor-dev@...> wrote: Hello,have you tried bpf_skb_store_bytes() to write into packet data ? meta-data fields of skb are mostly read-only with few exceptions. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Using IOVisor to resize IP packets
Mat and Helen <matandhelen@...>
I’m interested in the possibility of using ebpf / IOVisor to add encapsulation to IP packets, or to translate IPv4 packets to IPv6. Either of these would require me to increase the size of the packet header. Can you tell me whether this is possible please? Or is it outside of the scope of what can be done with ebpf? Many thanks! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|