summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-02-26 12:19:02 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-02-26 15:29:07 +0100
commit25d11a86c56d50947af33d0b79ede622809bd8b9 (patch)
tree5aca807692e26c8ae84c94569de5521b93ecfd42
parent474572d2ae5a17b6596053c2630753fe04fc304f (diff)
downloaddpdk-25d11a86c56d50947af33d0b79ede622809bd8b9.zip
dpdk-25d11a86c56d50947af33d0b79ede622809bd8b9.tar.gz
dpdk-25d11a86c56d50947af33d0b79ede622809bd8b9.tar.xz
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>
-rw-r--r--MAINTAINERS2
-rw-r--r--doc/guides/testpmd_app_ug/testpmd_funcs.rst8
-rw-r--r--examples/bpf/README8
-rw-r--r--examples/bpf/dummy.c (renamed from test/bpf/dummy.c)0
-rw-r--r--examples/bpf/mbuf.h (renamed from test/bpf/mbuf.h)0
-rw-r--r--examples/bpf/meson.build6
-rw-r--r--examples/bpf/t1.c (renamed from test/bpf/t1.c)0
-rw-r--r--examples/bpf/t2.c (renamed from test/bpf/t2.c)0
-rw-r--r--examples/bpf/t3.c (renamed from test/bpf/t3.c)0
9 files changed, 19 insertions, 5 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index b690e1e..e1c0f66 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 5de9f1b..1a12da4 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -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
diff --git a/examples/bpf/README b/examples/bpf/README
new file mode 100644
index 0000000..d714180
--- /dev/null
+++ b/examples/bpf/README
@@ -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.
diff --git a/test/bpf/dummy.c b/examples/bpf/dummy.c
index 5851469..5851469 100644
--- a/test/bpf/dummy.c
+++ b/examples/bpf/dummy.c
diff --git a/test/bpf/mbuf.h b/examples/bpf/mbuf.h
index b623d86..b623d86 100644
--- a/test/bpf/mbuf.h
+++ b/examples/bpf/mbuf.h
diff --git a/examples/bpf/meson.build b/examples/bpf/meson.build
new file mode 100644
index 0000000..0a817aa
--- /dev/null
+++ b/examples/bpf/meson.build
@@ -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
diff --git a/test/bpf/t1.c b/examples/bpf/t1.c
index 3364b4f..3364b4f 100644
--- a/test/bpf/t1.c
+++ b/examples/bpf/t1.c
diff --git a/test/bpf/t2.c b/examples/bpf/t2.c
index 69d7a4f..69d7a4f 100644
--- a/test/bpf/t2.c
+++ b/examples/bpf/t2.c
diff --git a/test/bpf/t3.c b/examples/bpf/t3.c
index 9ba3463..9ba3463 100644
--- a/test/bpf/t3.c
+++ b/examples/bpf/t3.c