Comments (4)
what's mean with Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!?
root@xxx:/home/tttt/bin# ip link set dev ens3 xdp obj xdp-pass-ebpf.o
Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!
root@xxx:/home/tttt/bin#
from xdpcap.
Thanks for the example, I didn't realize that maps could be pinned with ip link set xdp
.
The only problem I can spot is that your program doesn't tail_call
into the map. Instead of:
return XDP_PASS;
You need to:
#include "hook.h"
...
return xdpcap_exit(ctx, &bpf_elf_map, XDP_PASS);
You also don't need max_elem
to be 100
, there are only 5
possible actions (but it should work with 100
too).
from xdpcap.
Thanks for the example, I didn't realize that maps could be pinned with
ip link set xdp
.The only problem I can spot is that your program doesn't
tail_call
into the map. Instead of:return XDP_PASS;
You need to:
#include "hook.h" ... return xdpcap_exit(ctx, &bpf_elf_map, XDP_PASS);
You also don't need
max_elem
to be100
, there are only5
possible actions (but it should work with100
too).
thanks very much ! I get it. xdpcap run successfully
Best wishes ~~.
root@xxx:/home/tttt/bin# ./xdpcap /sys/fs/bpf/xdp/globals/action_map dump-new.pcap
ws----- os.Args[0]= ./xdpcap [1:]= [/sys/fs/bpf/xdp/globals/action_map dump-new.pcap]
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 1/1 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 2/2 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 3/3 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
aborted: 0/0 drop: 0/0 pass: 4/4 tx: 0/0 redirect: 0/0 (received/matched packets)
************ write packet pkt.data
from xdpcap.
This problem has been solved perfectly!
from xdpcap.
Related Issues (20)
- Is xdpcap filtering packets in user mode?
- Why can xdpcap capture packets when tcpdump capture packets from the same port.
- What's the performance of xdpcap? HOT 8
- In xdpcap, perfMapSpec's type is PerfEventArray, is there some examples for PerCPUHash or PerCpuArray? HOT 1
- xdpcap & bcc/llvm error: Assertion `Val && "isa<> used on a null pointer"' failed. HOT 2
- xdpcap support for IP-in-IP tunneled packets. HOT 2
- Can not Parse bfd as udp ? HOT 2
- why xdpcap can't capture egress traffic ? HOT 2
- Does xdpcap work similarly to xdpdump, where it can capture packets before and after xdp program execution? HOT 1
- Support capturing via fentry / fexit trace points HOT 6
- 编译出现unexpected NUL in input
- Would this be possible to use with redbpf? HOT 1
- clarify statistics output
- Libbpf 1.0 release
- Timestamp at capture time
- Support attaching xdpcap to XDP programs loaded with xdp.frags mode
- Allow user to dump verifier logs
- Update documentation about defining xdpcap map for libbpf >= 1.0.0
- Feature: add xdpcap_enter as a option since programs may modify packets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdpcap.