[4/4] test/bpf: move to examples folder
Checks
Commit Message
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>
---
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 ++++----
examples/bpf/README | 8 ++++++++
{test => examples}/bpf/dummy.c | 0
{test => examples}/bpf/mbuf.h | 0
examples/bpf/meson.build | 6 ++++++
{test => examples}/bpf/t1.c | 0
{test => examples}/bpf/t2.c | 0
{test => examples}/bpf/t3.c | 0
8 files changed, 18 insertions(+), 4 deletions(-)
create mode 100644 examples/bpf/README
rename {test => examples}/bpf/dummy.c (100%)
rename {test => examples}/bpf/mbuf.h (100%)
create mode 100644 examples/bpf/meson.build
rename {test => examples}/bpf/t1.c (100%)
rename {test => examples}/bpf/t2.c (100%)
rename {test => examples}/bpf/t3.c (100%)
@@ -4487,20 +4487,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
~~~~~~~~~~
@@ -4513,4 +4513,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
new file mode 100644
@@ -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.
similarity index 100%
rename from test/bpf/dummy.c
rename to examples/bpf/dummy.c
similarity index 100%
rename from test/bpf/mbuf.h
rename to examples/bpf/mbuf.h
new file mode 100644
@@ -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
similarity index 100%
rename from test/bpf/t1.c
rename to examples/bpf/t1.c
similarity index 100%
rename from test/bpf/t2.c
rename to examples/bpf/t2.c
similarity index 100%
rename from test/bpf/t3.c
rename to examples/bpf/t3.c