examples/bpf: move from test directory

The bpf folder didn't actual contain a test application, but instead
basic examples of BPF code for use with testpmd. Therefore we can
move it to the `examples` folder. Being different, it also needs
a README with it, explaining what it is and how to use it. References
to the code from the testpmd docs are suitably updated.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
Bruce Richardson 2019-02-26 12:19:02 +00:00 committed by Thomas Monjalon
parent 474572d2ae
commit 25d11a86c5
9 changed files with 19 additions and 5 deletions

View file

@ -1229,7 +1229,7 @@ F: doc/guides/howto/telemetry.rst
BPF - EXPERIMENTAL
M: Konstantin Ananyev <konstantin.ananyev@intel.com>
F: lib/librte_bpf/
F: test/bpf/
F: examples/bpf/
F: test/test/test_bpf.c
F: doc/guides/prog_guide/bpf_lib.rst

View file

@ -4503,20 +4503,20 @@ For example:
.. code-block:: console
cd test/bpf
cd examples/bpf
clang -O2 -target bpf -c t1.c
Then to load (and JIT compile) t1.o at RX queue 0, port 1::
.. code-block:: console
testpmd> bpf-load rx 1 0 J ./dpdk.org/test/bpf/t1.o
testpmd> bpf-load rx 1 0 J ./dpdk.org/examples/bpf/t1.o
To load (not JITed) t1.o at TX queue 0, port 0::
.. code-block:: console
testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/t1.o
testpmd> bpf-load tx 0 0 - ./dpdk.org/examples/bpf/t1.o
bpf-unload
~~~~~~~~~~
@ -4529,4 +4529,4 @@ For example to unload BPF filter from TX queue 0, port 0:
.. code-block:: console
testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/t1.o
testpmd> bpf-unload tx 0 0

8
examples/bpf/README Normal file
View file

@ -0,0 +1,8 @@
This folder contains example BPF programs for use with the DPDK bpf
library. To get details of each program and how to compile it, see
the header on the '.c' file itself.
Once compiled, these example programs can be loaded into `testpmd`
for execution on a packet stream. See `bpf-load` and `bpf-unload`
commands documented in the `Testpmd Application User Guide` for
details on how to do so.

6
examples/bpf/meson.build Normal file
View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2019 Intel Corporation
# This contains BPF example code for use in testing BPF with testpmd,
# therefore it should not be built as part of a meson build.
build=false