-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XDP: start document about setting up build environment
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
- Loading branch information
1 parent
555ecdd
commit 5acc5d5
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
kernel/Documentation/networking/XDP/end-user/build_environment.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
========================== | ||
XDP/eBPF build environment | ||
========================== | ||
|
||
Tool chain | ||
========== | ||
|
||
The XDP program running (in the driver hook point) is an eBPF program | ||
(short for Extended Berkeley Packet Filters). Unless you want to write | ||
eBPF machine-code like instruction by hand, you likely want to install | ||
some front-ends, that allow you to write some pseudo C-code. | ||
|
||
Tools for compiling `kernel bpf samples`_ requires having installed: | ||
* clang >= version 3.4.0 | ||
* llvm >= version 3.7.1 | ||
|
||
Note that LLVM's tool 'llc' must support target 'bpf', list version | ||
and supported targets with command: ``llc --version``. | ||
|
||
.. _kernel bpf samples: | ||
https://github.com/torvalds/linux/blob/master/samples/bpf/README.rst | ||
|
||
There is also toolkit called BCC_ (BPF Compiler Collection) that makes | ||
eBPF programs easier to write, and front-ends in Python and lua. But | ||
it also depend on LLVM. | ||
|
||
.. _BCC: https://github.com/iovisor/bcc/blob/master/README.md | ||
|
||
Linux distros | ||
============= | ||
|
||
Fedora 25 | ||
--------- | ||
|
||
Since Fedora 25, the package BCC_ is included with the distribution, | ||
and LLVM+clang in the correct versions. | ||
|
||
Install commands for Fedora 25:: | ||
|
||
dnf install llvm llvm-libs llvm-doc clang clang-libs | ||
dnf install bcc bcc-tools bcc-doc --enablerepo=updates-testing | ||
dnf install kernel-devel | ||
dnf install python3-pyroute2 | ||
|
||
.. Note:: As of this writing (2017-01-18) BCC for F25 is still in the | ||
updates-testing repository. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ Contents: | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
build_environment | ||
|