History log of /dpdk/app/test/test_bpf.c (Results 1 – 17 of 17)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 55ae8965 22-Mar-2022 Tyler Retzlaff <[email protected]>

test/bpf: skip test if libpcap is unavailable

test_bpf_convert is being conditionally registered depending on the
presence of RTE_HAS_LIBPCAP except the UT unconditionally lists it as a
test to run.

test/bpf: skip test if libpcap is unavailable

test_bpf_convert is being conditionally registered depending on the
presence of RTE_HAS_LIBPCAP except the UT unconditionally lists it as a
test to run.

When the UT runs test_bpf_convert test-dpdk can't find the registration
and assumes the DPDK_TEST environment variable hasn't been defined
resulting in test-dpdk dropping to interactive mode and subsequently
waiting for the remainder of the UT fast-test timeout period before
reporting the test as having timed out.

* unconditionally register test_bpf_convert,
* if ! RTE_HAS_LIBPCAP provide a stub test_bpf_convert that reports the
test is skipped similar to that done with the test_bpf test.

Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
Cc: [email protected]

Signed-off-by: Tyler Retzlaff <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>

show more ...


Revision tags: v22.03, v22.03-rc4, v22.03-rc3, v22.03-rc2, v22.03-rc1
# 78e7b29f 10-Feb-2022 Stephen Hemminger <[email protected]>

test/bpf: skip dump if conversion fails

If conversion of cBPF to eBPF fails (in rte_bpf_convert)
then the test should not try and print the result.

Coverity issue: 373661
Fixes: 2eccf6afbea9 ("bpf:

test/bpf: skip dump if conversion fails

If conversion of cBPF to eBPF fails (in rte_bpf_convert)
then the test should not try and print the result.

Coverity issue: 373661
Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
Cc: [email protected]

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>

show more ...


# 3c60274c 26-Jan-2022 Jie Zhou <[email protected]>

test: skip unsupported tests on Windows

Skip tests which are not yet supported for Windows:
- The libraries that tests depend on are not enabled on Windows yet
- The tests can compile but with issue

test: skip unsupported tests on Windows

Skip tests which are not yet supported for Windows:
- The libraries that tests depend on are not enabled on Windows yet
- The tests can compile but with issue still under investigation
* test_func_reentrancy:
Windows EAL has no protection against repeated calls.
* test_lcores:
Execution enters an infinite loops, requires investigation.
* test_rcu_qsbr_perf:
Execution hangs on Windows, requires investigation.

Signed-off-by: Jie Zhou <[email protected]>
Signed-off-by: Dmitry Kozlyuk <[email protected]>
Acked-by: Tyler Retzlaff <[email protected]>

show more ...


# 7be78d02 29-Nov-2021 Josh Soref <[email protected]>

fix spelling in comments and strings

The tool comes from https://github.com/jsoref

Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Thomas Monjalon <[email protected]>


Revision tags: v21.11, v21.11-rc4, v21.11-rc3
# 7e6533c1 17-Nov-2021 Joyce Kong <[email protected]>

test/bpf: use compiler atomics for calculation

Convert rte_atomic usages to compiler atomic built-ins
for calculation in bpf test cases.

Signed-off-by: Joyce Kong <[email protected]>
Reviewed-by:

test/bpf: use compiler atomics for calculation

Convert rte_atomic usages to compiler atomic built-ins
for calculation in bpf test cases.

Signed-off-by: Joyce Kong <[email protected]>
Reviewed-by: Ruifeng Wang <[email protected]>

show more ...


# 4a6672c2 12-Nov-2021 Stephen Hemminger <[email protected]>

fix spelling in comments and doxygen

Fix spelling errors in comments including doxygen found using codespell.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Konstantin Anan

fix spelling in comments and doxygen

Fix spelling errors in comments including doxygen found using codespell.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>
Acked-by: Vladimir Medvedkin <[email protected]>
Reviewed-by: Honnappa Nagarahalli <[email protected]>
Acked-by: Ray Kinsella <[email protected]>
Acked-by: Cristian Dumitrescu <[email protected]>
Acked-by: Chenbo Xia <[email protected]>

show more ...


# 79b3275a 15-Nov-2021 Stephen Hemminger <[email protected]>

test/bpf: do not require DNS lookup

These tests were using strings with hostname (dpdk.org) and this makes
test code do a DNS lookup. In container environment used for OpenSuse
build, DNS is unavail

test/bpf: do not require DNS lookup

These tests were using strings with hostname (dpdk.org) and this makes
test code do a DNS lookup. In container environment used for OpenSuse
build, DNS is unavailable. Replace dpdk.org with an IPv4 address
reserved for documentation (RFC5737) and use IPv6 in one example
(RFC3849). Actual addresses don't matter for this test which is
validating that code generated in classic BPF can be successfully
converted to eBPF.

Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Luca Boccassi <[email protected]>

show more ...


Revision tags: v21.11-rc2
# d6024c0a 08-Nov-2021 David Marchand <[email protected]>

build: cleanup libpcap dependent components

The RTE_PORT_PCAP variable is used to signal libpcap availability,
though its name seems to refer to pcap support in the port library.
Prefer a generic na

build: cleanup libpcap dependent components

The RTE_PORT_PCAP variable is used to signal libpcap availability,
though its name seems to refer to pcap support in the port library.
Prefer a generic name and add explicit link dependencies where needed.

Fixes: 7a944656b33f ("test/pcapng: test pcapng library")
Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")

Signed-off-by: David Marchand <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>

show more ...


Revision tags: v21.11-rc1
# 2eccf6af 20-Oct-2021 Stephen Hemminger <[email protected]>

bpf: add function to convert classic BPF to DPDK BPF

The pcap library emits classic BPF (32 bit) and is useful for
creating filter programs. The DPDK BPF library only implements
extended BPF (eBPF)

bpf: add function to convert classic BPF to DPDK BPF

The pcap library emits classic BPF (32 bit) and is useful for
creating filter programs. The DPDK BPF library only implements
extended BPF (eBPF). Add an function to convert from old to
new.

The rte_bpf_convert function uses rte_malloc to put the resulting
program in hugepage shared memory so it can be passed from a
secondary process to a primary process.

The code to convert was originally done as part of the Linux
kernel implementation then converted to a userspace program.
See https://github.com/tklauser/filter2xdp

Both authors have agreed that it is allowable to create a modified
version of this code and license it with BSD license used by DPDK.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>
Acked-by: Ray Kinsella <[email protected]>

show more ...


# 3ac2dffa 18-Oct-2021 Konstantin Ananyev <[email protected]>

test/bpf: fix undefined behavior with clang

test_shift1_check() function fails with clang build.
The reason for that is that clang uses 64-bit shift instruction for
what expected to be 32-bit operat

test/bpf: fix undefined behavior with clang

test_shift1_check() function fails with clang build.
The reason for that is that clang uses 64-bit shift instruction for
what expected to be 32-bit operation.
To be more specific, this C code:
r2 = (uint32_t)r2 >> r4;
With clang produces:
41a4eb: 48 d3 ef shr %cl,%rdi
In that particular case it is an allowed choice, as from one side
left-operand value is known to fit into 32 bits, from other side
according to 'C' standard:
"...if the value of the right operand is negative or is greater than
or equal to the width of the promoted left operand, the behavior is
undefined."
The problem is that on x86 behavior for 64-bit and 32-bit shift
operation might differ.
The fix avoids undefined behavior by making sure
that right operand will not exceed width of the promoted left operand.

Bugzilla ID: 811
Fixes: 9f8f9d91a701 ("test/bpf: introduce functional test")
Cc: [email protected]

Reported-by: Stephen Hemminger <[email protected]>
Signed-off-by: Konstantin Ananyev <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>

show more ...


# 04d43857 07-Oct-2021 Dmitry Kozlyuk <[email protected]>

net: rename Ethernet header fields

Definition of `rte_ether_addr` structure used a workaround allowing DPDK
and Windows SDK headers to be used in the same file, because Windows SDK
defines `s_addr`

net: rename Ethernet header fields

Definition of `rte_ether_addr` structure used a workaround allowing DPDK
and Windows SDK headers to be used in the same file, because Windows SDK
defines `s_addr` as a macro. Rename `s_addr` to `src_addr` and `d_addr`
to `dst_addr` to avoid the conflict and remove the workaround.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <[email protected]>

show more ...


Revision tags: v21.08, v21.08-rc4, v21.08-rc3, v21.08-rc2, v21.08-rc1, v21.05, v21.05-rc4, v21.05-rc3, v21.05-rc2, v21.05-rc1
# 7eff355b 21-Apr-2021 Min Hu (Connor) <[email protected]>

test/bpf: fix error message

This patch fixed wrong error variable in logging message.

Fixes: 83633ba23076 ("test/bpf: fix few small issues")
Cc: [email protected]

Signed-off-by: Min Hu (Connor) <hum

test/bpf: fix error message

This patch fixed wrong error variable in logging message.

Fixes: 83633ba23076 ("test/bpf: fix few small issues")
Cc: [email protected]

Signed-off-by: Min Hu (Connor) <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>

show more ...


Revision tags: v21.02, v21.02-rc4, v21.02-rc3, v21.02-rc2, v21.02-rc1, v20.11, v20.11-rc5, v20.11-rc4, v20.11-rc3, v20.11-rc2, v20.11-rc1, v20.08, v20.08-rc4, v20.08-rc3, v20.08-rc2, v20.08-rc1
# b901d928 27-May-2020 Konstantin Ananyev <[email protected]>

bpf: support packet data load instructions

To fill the gap with linux kernel eBPF implementation,
add support for two non-generic instructions:
(BPF_ABS | <size> | BPF_LD) and (BPF_IND | <size> | BP

bpf: support packet data load instructions

To fill the gap with linux kernel eBPF implementation,
add support for two non-generic instructions:
(BPF_ABS | <size> | BPF_LD) and (BPF_IND | <size> | BPF_LD)
which are used to access packet data.
These instructions can only be used when BPF context is a pointer
to 'struct rte_mbuf' (i.e: RTE_BPF_ARG_PTR_MBUF type).

Signed-off-by: Konstantin Ananyev <[email protected]>

show more ...


# 83633ba2 27-May-2020 Konstantin Ananyev <[email protected]>

test/bpf: fix few small issues

Address for few small issues:
- unreachable return statement
- failed test-case can finish with 'success' status

Also use unified cmp_res() function to check return

test/bpf: fix few small issues

Address for few small issues:
- unreachable return statement
- failed test-case can finish with 'success' status

Also use unified cmp_res() function to check return value.

Cc: [email protected]

Signed-off-by: Konstantin Ananyev <[email protected]>

show more ...


Revision tags: v20.05, v20.05-rc4, v20.05-rc3, v20.05-rc2, v20.05-rc1, v20.02, v20.02-rc4, v20.02-rc3, v20.02-rc2, v20.02-rc1, v19.11, v19.11-rc4, v19.11-rc3, v19.11-rc2, v19.11-rc1
# cddd8795 25-Sep-2019 Harman Kalra <[email protected]>

test/bpf: add new test cases

This patch implements following new test cases:
- test_call4: test case to verify if stack corruption occurs
across with multiple function calls.
- test_jump2: test case

test/bpf: add new test cases

This patch implements following new test cases:
- test_call4: test case to verify if stack corruption occurs
across with multiple function calls.
- test_jump2: test case with a default packet in memory, parse
the packet and check if dest ip is part of a subnet.
- test_call5: test case with string data in the stack and
calling string comaprision.

Signed-off-by: Harman Kalra <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>

show more ...


Revision tags: v19.08, v19.08-rc4, v19.08-rc3, v19.08-rc2, v19.08-rc1
# 7e30313f 03-Jul-2019 Konstantin Ananyev <[email protected]>

test/bpf: add test-case for function return value

New test-case to cover situation when external function returns a
pointer the data.

Signed-off-by: Konstantin Ananyev <[email protected]>


Revision tags: v19.05, v19.05-rc4, v19.05-rc3, v19.05-rc2, v19.05-rc1
# a9de470c 26-Feb-2019 Bruce Richardson <[email protected]>

test: move to app directory

Since all other apps have been moved to the "app" folder, the autotest app
remains alone in the test folder. Rather than having an entire top-level
folder for this, we ca

test: move to app directory

Since all other apps have been moved to the "app" folder, the autotest app
remains alone in the test folder. Rather than having an entire top-level
folder for this, we can move it back to where it all started in early
versions of DPDK - the "app/" folder.

This move has a couple of advantages:
* This reduces clutter at the top level of the project, due to one less
folder.
* It eliminates the separate build task necessary for building the
autotests using make "make test-build" which means that developers are
less likely to miss something in their own compilation tests
* It re-aligns the final location of the test binary in the app folder when
building with make with it's location in the source tree.

For meson builds, the autotest app is different from the other apps in that
it needs a series of different test cases defined for it for use by "meson
test". Therefore, it does not get built as part of the main loop in the
app folder, but gets built separately at the end.

Signed-off-by: Bruce Richardson <[email protected]>

show more ...