-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the simplest prog.c
can be passed to vm/test
?
#54
Comments
Hi! Example for
Compile and run
|
Thank you @carverdamien I actually looked at Oko, and I realized that there are a couple of things not available in the uBPF, for example, maps. Although Oko has been built on top of uBPF. I'd like to write complex eBPF functionalities using uBPF, isn't it possible? Imagine the following scenario for a single packet. Wire -> NIC -> Kernel -> Userspace - Run a chain of BPF programs on the packet via uBPF -> Kernel -> NIC -> Wire I'm also wondering what libraries I'm allowed or able to include in the uBPF programs? |
You can call external functions in a bpf program but they must be registered first. register_functions |
I'm wondering why I couldn't call for example Here is what I did.
Here is the warning generated. When I run the program I get the following:
Probably, I'm missing something obvious here. Thanks, |
Helper calls in BPF are encoded as a call to an integer, where the integer is the index of the registered function you want to call. I think it should look something like this in C:
Unfortunately, I haven't been able to compile this such that |
Compile with
|
You might be confusing |
True, thank you :) |
You are welcome ! :D |
Oko author here 👋 That's true, Oko supports additional features on top of ubpf, such as hash maps, arrays, and a simple verifier. I unfortunately never found the time to upstream all of those to ubpf 😞
That is definitely possible. However, note that ubpf will only implement the actual uBPF loading and execution. To receive and send packets from userspace, you'll have to use something else, such as DPDK or Linux's AK_PACKET API. |
+1 to @pchaigno upstreaming those Oko changes back into this repo ;-)! |
Hello,
I'd like to play with this tool, however, I'm not quite sure how to get started with it.
Is there a simple example to get started with? Like a simple
prog.c
?Thanks,
Alireza
The text was updated successfully, but these errors were encountered: