236 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
50
views
eBPF XDP - how to attach a bfp program to a interface - bpf_xdp_attach is undefined
I wrote an XDP program in C that saves every packet, except some blocked ones, into a ring buffer map, which is sent to userspace. I also made an xdp_loader program in C++ that loads the XDP program ...
2
votes
1
answer
47
views
BPF_LINK_CREATE with BPF_LINK_TYPE_XDP + target_ifindex returns -EINVAL
BPF_LINK_CREATE with BPF_LINK_TYPE_XDP + target_ifindex returns -EINVAL on Ubuntu 24.04 HWE (6.14.0-36-generic, i40e).
Documentation
I’m trying to attach an XDP program to a NIC using BPF_LINK_CREATE ...
0
votes
0
answers
73
views
XDP Program on veth Host-side Blocking Inter-Namespace Communication
I have two namespaces, ns1 and ns2. I created two veth pairs and connected the namespaces to the host via these veth pairs. Now, I want to enable these two namespaces to ping each other using a very ...
1
vote
1
answer
54
views
Writing an eBPF bound check using embedded assembly
I have a bound check statement that is optimized by clang and as a result verifier doesn't accept the program. I would like to write it using embedded assembly. I am not sure how to do it. I know that ...
0
votes
0
answers
74
views
AF_XDP `xsk_socket__create` fails with "Bad address" on Intel i226 (igc driver)
Does the igc driver support AF_XDP TX at all — even in copy mode?
Has anyone successfully used AF_XDP with an Intel i225/i226 NIC using igc?
Would really appreciate confirmation, success stories, or ...
2
votes
0
answers
54
views
avoid AF_XDP socket scale number of sending packets latency linearly
How sendto implemented for non-ZERO_COPY mode(native) for AF_XDP socket?
here is my code for sending:
//fill n packets
xdp_desc[i]->addr = ....
xdp_desc[i]->len = ...
xsk_ring_prod__submit(&...
0
votes
1
answer
95
views
can XDP UDP server bind to a udp port
In kernel based UDP server, we do bind to a address/port. For ebpf as I understand it I can just do filter the port in ebpf program rather than call bind. However some of the existing udp clients are ...
0
votes
1
answer
158
views
Does bpf_redirect() to another interface trigger the target's TC ingress hook?
Here is the scene: When A iface uses bpf_redirect() to redirect data packets to B iface, will B's tc ingress be triggered??
When testing on my machine, I found that B's tc ingress bpf prog is not ...
1
vote
2
answers
128
views
addr_space_cast insn can only be used in a program that has an associated arena
I'm trying to explore using BPF arena in XDP programs.
I learned from this post that XDP programs aren't sleepable and, therefore, they cannot use the kfunc to allocate BPF arenas' pages. So, my ...
2
votes
0
answers
46
views
What are the sources of overhead for a minimal XDP program?
I noticed that when I attach a dummy XDP program (that simply returns XDP_PASS) to the NIC driver, the single-core TCP throughput drops from 28 Gbps to 24 Gbps.
Upon inspecting the CPU function stack ...
-1
votes
1
answer
109
views
Question about how the eBPF Verifier behaves in my specific use case
I have a confusion about how the eBPF verifier behaves in my usecase. In general, I want to implement an eBPF program deployed from a python bcc module to look for my custom option 31 and remove it ...
0
votes
1
answer
161
views
Is it possible to insert new option into packets in eBPF?
I am trying to insert my new option field into packets using ebpf but I do not know what is the correct way to shift the rest of the payload after the IP header to the right without using a CONSTANT ...
0
votes
1
answer
129
views
Sleepable eBPF/XDP programs
Recently, I've been trying to work with BPF_ARENA. My objective is to use it on XDP programs. However, the following error appears when I try to use bpf_arena_alloc_pages:
program must be sleepable ...
2
votes
1
answer
166
views
How to write/attach a "device-bound" XDP program so that I can use XDP metadata kfuncs?
I want to use the kfunc bpf_xdp_metadata_rx_hash to get the flow hash in an XDP program as follows:
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
extern int ...
1
vote
0
answers
108
views
eBPF ring-buffers are not printing event to the stdout, evt struct is populated and printed when printing to trace_pipe
I have the following program structure:
src/main.bpf.c:
#include "../vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_endian.h>
#...