Skip to content

Commit 25d11a8

Browse files
bruce-richardsontmonjalo
authored andcommitted
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 <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
1 parent 474572d commit 25d11a8

File tree

9 files changed

+19
-5
lines changed

9 files changed

+19
-5
lines changed

MAINTAINERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ F: doc/guides/howto/telemetry.rst
12291229
BPF - EXPERIMENTAL
12301230
M: Konstantin Ananyev <[email protected]>
12311231
F: lib/librte_bpf/
1232-
F: test/bpf/
1232+
F: examples/bpf/
12331233
F: test/test/test_bpf.c
12341234
F: doc/guides/prog_guide/bpf_lib.rst
12351235

doc/guides/testpmd_app_ug/testpmd_funcs.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -4503,20 +4503,20 @@ For example:
45034503

45044504
.. code-block:: console
45054505
4506-
cd test/bpf
4506+
cd examples/bpf
45074507
clang -O2 -target bpf -c t1.c
45084508
45094509
Then to load (and JIT compile) t1.o at RX queue 0, port 1::
45104510

45114511
.. code-block:: console
45124512
4513-
testpmd> bpf-load rx 1 0 J ./dpdk.org/test/bpf/t1.o
4513+
testpmd> bpf-load rx 1 0 J ./dpdk.org/examples/bpf/t1.o
45144514
45154515
To load (not JITed) t1.o at TX queue 0, port 0::
45164516

45174517
.. code-block:: console
45184518
4519-
testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/t1.o
4519+
testpmd> bpf-load tx 0 0 - ./dpdk.org/examples/bpf/t1.o
45204520
45214521
bpf-unload
45224522
~~~~~~~~~~
@@ -4529,4 +4529,4 @@ For example to unload BPF filter from TX queue 0, port 0:
45294529

45304530
.. code-block:: console
45314531
4532-
testpmd> bpf-load tx 0 0 - ./dpdk.org/test/bpf/t1.o
4532+
testpmd> bpf-unload tx 0 0

examples/bpf/README

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

examples/bpf/meson.build

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

test/bpf/t1.c examples/bpf/t1.c

File renamed without changes.

test/bpf/t2.c examples/bpf/t2.c

File renamed without changes.

test/bpf/t3.c examples/bpf/t3.c

File renamed without changes.

0 commit comments

Comments
 (0)