Skip to content

Commit

Permalink
XDP: start document about setting up build environment
Browse files Browse the repository at this point in the history
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
  • Loading branch information
netoptimizer committed Jan 18, 2017
1 parent 555ecdd commit 5acc5d5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions kernel/Documentation/networking/XDP/end-user/build_environment.rst
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.

1 change: 1 addition & 0 deletions kernel/Documentation/networking/XDP/end-user/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Contents:
.. toctree::
:maxdepth: 2

build_environment

0 comments on commit 5acc5d5

Please sign in to comment.