From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Jerin Jacob <jerinj@marvell.com>,
Konstantin Ananyev <konstantin.ananyev@huawei.com>,
Marat Khalili <marat.khalili@huawei.com>,
Akhil Goyal <gakhil@marvell.com>,
Anoob Joseph <anoobj@marvell.com>
Subject: [PATCH v3 07/23] app/test: include headers directly
Date: Tue, 4 Aug 2026 08:44:55 -0700 [thread overview]
Message-ID: <20260804154549.148691-8-stephen@networkplumber.org> (raw)
In-Reply-To: <20260804154549.148691-1-stephen@networkplumber.org>
The test code was getting network headers indirectly via inclusion
of rte_ethdev.h. This will change in the future, instead get the
headers directly.
For BPF test, use the tool "iwyu" to get more complete set of headers.
Replace use of htons() with equivalent DPDK byteorder macro.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-eventdev/test_pipeline_common.h | 1 +
app/test/test_bpf.c | 20 +++++++++++++++-----
app/test/test_security_inline_macsec.c | 2 ++
app/test/test_security_inline_proto.c | 1 +
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h
index 61370fb799..e9f20e7f62 100644
--- a/app/test-eventdev/test_pipeline_common.h
+++ b/app/test-eventdev/test_pipeline_common.h
@@ -12,6 +12,7 @@
#include <rte_cycles.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
+#include <rte_ip.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_event_eth_tx_adapter.h>
#include <rte_eventdev.h>
diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
index 3205afaa63..5b71f94a71 100644
--- a/app/test/test_bpf.c
+++ b/app/test/test_bpf.c
@@ -5,16 +5,28 @@
#include <stdio.h>
#include <string.h>
#include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdalign.h>
#include <inttypes.h>
+#include <errno.h>
+#include <limits.h>
#include <unistd.h>
-#include <rte_memory.h>
+#include <rte_bitops.h>
#include <rte_debug.h>
#include <rte_hexdump.h>
#include <rte_malloc.h>
+#include <rte_memcpy.h>
+#include <rte_mbuf.h>
#include <rte_random.h>
#include <rte_byteorder.h>
#include <rte_errno.h>
+#include <rte_ether.h>
+#include <rte_ip.h>
+#include <rte_udp.h>
+#include <rte_tcp.h>
#include "test.h"
@@ -30,8 +42,6 @@ test_bpf(void)
#else
#include <rte_bpf.h>
-#include <rte_ether.h>
-#include <rte_ip.h>
/* Tests of most simple BPF programs (no instructions, one instruction etc.) */
@@ -1331,7 +1341,7 @@ test_jump2_check(uint64_t rc, const void *arg)
uint16_t eth_type;
uint64_t v = -1;
- if (eth_hdr->ether_type == htons(0x8100)) {
+ if (eth_hdr->ether_type == rte_cpu_to_be_16(0x8100)) {
const struct rte_vlan_hdr *vlan_hdr =
(const void *)(eth_hdr + 1);
eth_type = vlan_hdr->eth_proto;
@@ -1341,7 +1351,7 @@ test_jump2_check(uint64_t rc, const void *arg)
next = eth_hdr + 1;
}
- if (eth_type == htons(0x0800)) {
+ if (eth_type == rte_cpu_to_be_16(0x0800)) {
ipv4_hdr = next;
if ((ipv4_hdr->dst_addr & rte_cpu_to_be_32(TEST_NETMASK)) ==
rte_cpu_to_be_32(TEST_SUBNET)) {
diff --git a/app/test/test_security_inline_macsec.c b/app/test/test_security_inline_macsec.c
index a929ff5326..43672ef237 100644
--- a/app/test/test_security_inline_macsec.c
+++ b/app/test/test_security_inline_macsec.c
@@ -8,6 +8,8 @@
#include <rte_ethdev.h>
#include <rte_malloc.h>
#include <rte_security.h>
+#include <rte_flow.h>
+#include <rte_macsec.h>
#include "test.h"
#include "test_security_inline_macsec_vectors.h"
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 0b1f7fbbab..99111e5432 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -7,6 +7,7 @@
#include <inttypes.h>
#include <rte_ethdev.h>
+#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_security.h>
--
2.53.0
next prev parent reply other threads:[~2026-08-04 15:46 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 16:51 [PATCH v2 00/22] ethdev: clean up legacy flow director Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 01/22] drivers/net: remove unused include in dpaa Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 02/22] ethdev: use DPDK byte order conversion Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 03/22] net/ixgbe: remove experimental FDIR API Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 04/22] net/i40e: " Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 05/22] app/testpmd: remove support for flow director Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 06/22] net/gve: include IP, UDP and TCP headers Stephen Hemminger
2026-08-03 18:04 ` Joshua Washington
2026-08-03 16:51 ` [PATCH v2 07/22] crypto/dpaa_sec: include UDP header Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 08/22] net/nfp: break implicit dependency on rte_eth_ctrl.h Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 09/22] net/mana: include used network headers Stephen Hemminger
2026-08-03 17:09 ` [EXTERNAL] " Long Li
2026-08-03 16:51 ` [PATCH v2 10/22] gro: include headers directly Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 11/22] app/test: " Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 12/22] node: get UDP header Stephen Hemminger
2026-08-03 16:51 ` [PATCH v2 13/22] net/rnp: include network headers Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 14/22] net/r8169: get " Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 15/22] net/ngbe: include network protocol headers Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 16/22] examples: include network headers Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 17/22] net/mlx5: include rte_flow as needed Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 18/22] net/sfc: include rte_flow Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 19/22] net/intel/common: include network headers Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 20/22] net/enetfec: add missing sys/types.h include Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 21/22] ethdev, drivers: isolate flow director Stephen Hemminger
2026-08-03 16:52 ` [PATCH v2 22/22] doc: add release note about rte_ethdev changes Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 00/23] ethdev: isolate legacy flow director Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 01/23] drivers/net: remove unused include in dpaa Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 02/23] ethdev: use DPDK byte order conversion Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 03/23] net/ixgbe: remove experimental FDIR API Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 04/23] net/i40e: " Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 05/23] app/testpmd: remove support for flow director Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 06/23] app/testpmd: move str_to_flowtype to i40e Stephen Hemminger
2026-08-04 15:44 ` Stephen Hemminger [this message]
2026-08-04 15:53 ` [PATCH v3 07/23] app/test: include headers directly Marat Khalili
2026-08-04 15:44 ` [PATCH v3 08/23] gro: " Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 09/23] crypto/dpaa_sec: include UDP header Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 10/23] net/gve: include UDP, SCTP and TCP headers Stephen Hemminger
2026-08-04 15:44 ` [PATCH v3 11/23] net/nfp: break implicit dependency on rte_eth_ctrl.h Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 12/23] net/mana: include used network headers Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 13/23] node: get UDP header Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 14/23] net/rnp: include network headers Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 15/23] net/r8169: get " Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 16/23] net/ngbe: include network protocol headers Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 17/23] examples: include network headers Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 18/23] net/mlx5: include rte_flow as needed Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 19/23] net/sfc: include rte_flow Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 20/23] net/intel/common: include network headers Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 21/23] net/enetfec: add missing sys/types.h include Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 22/23] ethdev, drivers: isolate flow director Stephen Hemminger
2026-08-04 15:45 ` [PATCH v3 23/23] doc: add release note about rte_ethdev changes Stephen Hemminger
2026-08-06 5:08 ` [PATCH v4 00/23] ethdev: refactor remaining uses of flow director Stephen Hemminger
2026-08-06 5:08 ` [PATCH v4 01/23] drivers/net: remove unused include in dpaa and dpaa2 Stephen Hemminger
2026-08-06 6:13 ` Hemant Agrawal
2026-08-06 5:08 ` [PATCH v4 02/23] ethdev: use DPDK byte order conversion Stephen Hemminger
2026-08-06 5:08 ` [PATCH v4 03/23] net/ixgbe: remove experimental FDIR API Stephen Hemminger
2026-08-06 5:08 ` [PATCH v4 04/23] net/i40e: " Stephen Hemminger
2026-08-06 5:08 ` [PATCH v4 05/23] app/testpmd: remove support for flow director Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 06/23] app/testpmd: move str_to_flowtype to i40e Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 07/23] app/test: include headers directly Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 08/23] gro: " Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 09/23] crypto/dpaa_sec: include UDP header Stephen Hemminger
2026-08-06 6:12 ` Hemant Agrawal
2026-08-06 5:09 ` [PATCH v4 10/23] net/gve: include UDP, SCTP and TCP headers Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 11/23] net/nfp: break implicit dependency on rte_eth_ctrl.h Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 12/23] net/mana: include used network headers Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 13/23] node: get UDP header Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 14/23] net/rnp: include network headers Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 15/23] net/r8169: get " Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 16/23] net/ngbe: include network protocol headers Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 17/23] examples: include network headers Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 18/23] net/mlx5: include rte_flow as needed Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 19/23] net/sfc: include rte_flow Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 20/23] net/intel/common: include network headers Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 21/23] net/enetfec: add missing sys/types.h include Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 22/23] ethdev, drivers: isolate flow director Stephen Hemminger
2026-08-06 5:09 ` [PATCH v4 23/23] doc: add release note about rte_ethdev changes Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804154549.148691-8-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=konstantin.ananyev@huawei.com \
--cc=marat.khalili@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox