Fix verified eBPF tutorial examples and instructions (#211)

* docs: fix XDP stub compile command

* docs: link hardirqs example headers

* fix: capture the actual TCP header length

* docs: refresh generated tutorial index

* Revert "docs: refresh generated tutorial index"

This reverts commit 6a2418a277.

* fix: print TCP header length as unsigned

* docs: sync TCP header debug format

* fix: address final tutorial portability review

* docs: auto-generate documentation

* Revert "docs: auto-generate documentation"

This reverts commit be93763602.

---------

Co-authored-by: LinuxDev9002 <i@littlefisher.me>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
云微
2026-07-14 14:14:09 -07:00
committed by GitHub
parent 929aec4441
commit c054586a39
9 changed files with 205 additions and 100 deletions

View File

@@ -446,9 +446,11 @@ sudo ./teardown.sh
### 运行负载均衡器
要运行 XDP 负载均衡器,执行以下命令,指定接口和后端服务器的 IP 和 MAC 地址:
要运行 XDP 负载均衡器,执行以下命令,指定接口和后端服务器的 IP 和 MAC 地址。为了让 XDP 在 veth 接口上工作,还需要在 veth 对的另一端挂载一个返回 `XDP_PASS` 的桩程序。
```console
clang -target bpf -I/usr/include/$(gcc -print-multiarch) -o stub.bpf.o -c stub.bpf.c
sudo ip l set dev veth7 xdp obj ./stub.bpf.o sec .xdp
sudo ip netns exec lb ./xdp_lb veth6 10.0.0.2 de:ad:be:ef:00:02 10.0.0.3 de:ad:be:ef:00:03
```
@@ -556,4 +558,4 @@ sudo bpftrace -e 'tracepoint:xdp:xdp_bulk_tx{@redir_errno[-args->err] = count();
### 参考文献
- [XDP 编程实践教程](https://github.com/xdp-project/xdp-tutorial)
- [XDP 编程实践教程](https://github.com/xdp-project/xdp-tutorial)