Skip to content
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

Add some XDP examples #645

Closed
diegobes opened this issue Apr 27, 2022 · 3 comments
Closed

Add some XDP examples #645

diegobes opened this issue Apr 27, 2022 · 3 comments
Labels
good first issue Good for newcomers

Comments

@diegobes
Copy link

There are several examples of different ebpf program types but none for XDP.
Can you please add an example of how to use link/program to attach, deatach, pin, unpin xdp programs and maps ?

Thanks

@diegobes diegobes added the bug Something isn't working label Apr 27, 2022
@diegobes diegobes changed the title XDP Examples will be usefull [Not a BUG] XDP Examples will be usefull Apr 27, 2022
@ti-mo ti-mo removed the bug Something isn't working label Apr 27, 2022
@ti-mo ti-mo changed the title [Not a BUG] XDP Examples will be usefull Add some XDP examples Apr 27, 2022
@Cyc1ing1313
Copy link

agree

@ti-mo ti-mo added the good first issue Good for newcomers label May 4, 2022
@ti-mo
Copy link
Collaborator

ti-mo commented May 4, 2022

We'll add an example for attaching XDP progs using the link package. We could add a fallback using netlink later on if the kernel doesn't support bpf_link, but let's start with a simple example.

@diegobes Pinning is already demonstrated in other examples, is there something specific that needs to be highlighted?

wedaly added a commit to wedaly/ebpf that referenced this issue Jun 10, 2022
Add an example for attaching an eBPF program to a network
interface with XDP. The example program parses the IPv4
source address from packets (if available) and records
packet counts by IP address in an LRU hash map.

Issue: cilium#645

Signed-off-by: Will Daly <[email protected]>
wedaly added a commit to wedaly/ebpf that referenced this issue Jun 10, 2022
Add an example for attaching an eBPF program to a network
interface with XDP. The example program parses the IPv4
source address from packets (if available) and records
packet counts by IP address in an LRU hash map.

Issue: cilium#645

Signed-off-by: Will Daly <[email protected]>
wedaly added a commit to wedaly/ebpf that referenced this issue Jun 14, 2022
Add an example for attaching an eBPF program to a network
interface with XDP. The example program parses the IPv4
source address from packets (if available) and records
packet counts by IP address in an LRU hash map.

Issue: cilium#645

Signed-off-by: Will Daly <[email protected]>
wedaly added a commit to wedaly/ebpf that referenced this issue Jun 14, 2022
Add an example for attaching an eBPF program to a network
interface with XDP. The example program parses the IPv4
source address from packets (if available) and records
packet counts by IP address in an LRU hash map.

Issue: cilium#645

Signed-off-by: Will Daly <[email protected]>
wedaly added a commit to wedaly/ebpf that referenced this issue Jun 14, 2022
Add an example for attaching an eBPF program to a network
interface with XDP. The example program parses the IPv4
source address from packets (if available) and records
packet counts by IP address in an LRU hash map.

Issue: cilium#645

Signed-off-by: Will Daly <[email protected]>
lmb pushed a commit that referenced this issue Jun 15, 2022
Add an example for attaching an eBPF program to a network
interface with XDP. The example program parses the IPv4
source address from packets (if available) and records
packet counts by IP address in an LRU hash map.

Issue: #645

Signed-off-by: Will Daly <[email protected]>
@lmb
Copy link
Collaborator

lmb commented Jun 15, 2022

We have an XDP link example thanks to @wedaly now.

@lmb lmb closed this as completed Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants