Closed esemeniuc closed 18 hours ago
Issue: info!
calls must be removed. The demo is broken due to that. See https://discord.com/channels/855676609003651072/1310568860738388059/1312632243574931517
An alternative is to use bpf_printk
instead
unsafe {
aya_ebpf::bpf_printk!(b"packet received!");
}
To see output, open another terminal enable tracing:
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
Then to see output
sudo cat /sys/kernel/debug/tracing/trace_pipe
From another terminal, ping the interface
ping 127.0.0.1
Source: https://dev.to/stevelatif/aya-rust-tutorial-part-four-xdp-hello-world-4c85
Does it work if you use --release
?
The template and book have been updated to only build ebpf in release mode. Please file an issue against those if you continue to be able to reproduce.
Yes this works, thank you very much
rustup install nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
cargo install bpf-linker
cd examples/xdp-hello/
cargo xtask build-ebpf --release
cargo build --release
Running the xdp_hello example with the following commands fails in:
docker run -it --privileged --network host --rm -v ~/dev/aya-book:/myapp -w /myapp rust bash
Inside the container, I ran:
Output
Host OS: arch running
6.6.52-1-lts