-
Notifications
You must be signed in to change notification settings - Fork 829
Update getting started document #1951
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ more. | |
| To follow along with the example, you'll need: | ||
|
|
||
| * Linux kernel version 5.7 or later, for bpf_link support | ||
| * LLVM 11 or later [^1] (`clang` and `llvm-strip`) | ||
| * LLVM 11 or later [^1] (`clang` and `llvm`) | ||
| * libbpf headers [^2] | ||
| * Linux kernel headers [^3] | ||
| * Go compiler version supported by {{ proj }}'s Go module | ||
|
|
@@ -28,7 +28,7 @@ more. | |
| Use `clang --version` to check which version of LLVM you have installed. | ||
| Refer to your distribution's package index to finding the right packages to | ||
| install, as this tends to vary wildly across distributions. Some | ||
| distributions ship `clang` and `llvm-strip` in separate packages. | ||
| distributions ship `clang` and `llvm` in separate packages. | ||
|
|
||
| [^2]: | ||
| For Debian/Ubuntu, you'll typically need `libbpf-dev`. On Fedora, it's | ||
|
|
@@ -214,6 +214,14 @@ standard library here. | |
| `CountPackets`) eBPF program with `eth0`. This returns a {{ | ||
| godoc('link/Link') }} abstraction. | ||
|
|
||
| Note: On virtualized environments or network interfaces whose drivers do not | ||
| support native XDP, attaching may fail with "operation not supported". | ||
| In such cases, you can use generic mode instead: | ||
|
|
||
| Flags: link.XDPGenericMode | ||
|
|
||
| Generic mode has lower performance but works on a wider range of interfaces. | ||
|
Comment on lines
+218
to
+224
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not entirely sure if we want to encourage the usage of generic mode. XDP driver support for Virtio support exists since v4.10, and veth support since v4.19. A lot of more specialized virtual NICs have gained support in later kernels https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_XDP/#driver-support. So for the purposes of testing a user can always use a veth pair (via a container). Generic mode has poor test coverage. So in production, when native XDP is not available, users should fallback to Long story short. I don't think this is advice we want to give people, especially not those that don't know any better. |
||
|
|
||
| 1. Close the file descriptor of the Program-to-interface association. Note that | ||
| this will stop the Program from executing on incoming packets if the Link was | ||
| not {{ godoc('link/Link.Pin') }}ed to the bpf file system. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llvm-stripis the actual utility we use in our makefile hence why it is listed here. Its not a mistake.ebpf/Makefile
Line 5 in 2e4cf1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I my intention was apt package name, not program name. I will fix it.