All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei-Niculae Petre <p31andrei@gmail.com>
To: konstantin.ananyev@huawei.com
Cc: dev@dpdk.org, Andrei-Niculae Petre <p31andrei@gmail.com>,
	stable@dpdk.org, sean.morrissey@intel.com
Subject: [PATCH] examples/l3fwd: fix compilation when DP debug on
Date: Tue, 14 Apr 2026 05:51:37 +0300	[thread overview]
Message-ID: <20260414025137.91776-1-p31andrei@gmail.com> (raw)

Previously, l3fwd example app would fail to compile ([1]) if one would
put RTE_LOG_DP_LEVEL=RTE_LOG_DEBUG in config/rte_config.h and try to
compile dpdk; this path was not enabled via compiling debug build
(--buildtype=debug) alone, but needed the data path to be at debug
level.

[1] https://bugs.dpdk.org/show_bug.cgi?id=1318

Bugzilla ID: 1318
Fixes: 6de0ea50e9b9 ("examples/l3fwd: merge l3fwd-acl example")
Cc: stable@dpdk.org
Cc: sean.morrissey@intel.com

Signed-off-by: Andrei-Niculae Petre <p31andrei@gmail.com>
---
 .mailmap                   |  1 +
 MAINTAINERS                |  2 ++
 examples/l3fwd/l3fwd_acl.c | 27 ++++++++++++++-------------
 examples/l3fwd/l3fwd_acl.h |  6 ------
 4 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/.mailmap b/.mailmap
index cdaa471715..df999d00d8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -106,6 +106,7 @@ Andre Muezerie <andremue@linux.microsoft.com> <andremue@microsoft.com>
 Andre Richter <andre.o.richter@gmail.com>
 Andrea Arcangeli <aarcange@redhat.com>
 Andrea Grandi <andrea.grandi@intel.com>
+Andrei-Niculae Petre <p31andrei@gmail.com>
 Andrew Bailey <abailey@iol.unh.edu>
 Andrew Boyer <andrew.boyer@amd.com> <aboyer@pensando.io>
 Andrew Harvey <agh@cisco.com>
diff --git a/MAINTAINERS b/MAINTAINERS
index 5683b87e4a..501f312ba1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1740,6 +1740,8 @@ F: lib/acl/
 F: doc/guides/prog_guide/packet_classif_access_ctrl.rst
 F: app/test-acl/
 F: app/test/test_acl.*
+F: examples/l3fwd/l3fwd_acl*
+F: doc/guides/sample_app_ug/l3_forward.rst
 
 EFD
 M: Byron Marohn <byron.marohn@intel.com>
diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c
index a1275e18bc..8e24f1c599 100644
--- a/examples/l3fwd/l3fwd_acl.c
+++ b/examples/l3fwd/l3fwd_acl.c
@@ -235,6 +235,9 @@ enum {
 RTE_ACL_RULE_DEF(acl4_rule, RTE_DIM(ipv4_defs));
 RTE_ACL_RULE_DEF(acl6_rule, RTE_DIM(ipv6_defs));
 
+/* Must be included before acl_config definition to enable L3FWDACL_DEBUG */
+#include "l3fwd_acl.h"
+
 static struct {
 	struct rte_acl_ctx *acx_ipv4[NB_SOCKETS];
 	struct rte_acl_ctx *acx_ipv6[NB_SOCKETS];
@@ -251,8 +254,6 @@ static struct rte_acl_rule *acl_base_ipv4, *route_base_ipv4,
 static unsigned int acl_num_ipv4, route_num_ipv4,
 		acl_num_ipv6, route_num_ipv6;
 
-#include "l3fwd_acl.h"
-
 #include "l3fwd_acl_scalar.h"
 
 /*
@@ -773,7 +774,7 @@ read_config_files_acl(void)
 	}
 }
 
-void
+static void
 print_one_ipv4_rule(struct acl4_rule *rule, int extra)
 {
 	char abuf[INET6_ADDRSTRLEN];
@@ -800,7 +801,7 @@ print_one_ipv4_rule(struct acl4_rule *rule, int extra)
 			rule->data.userdata);
 }
 
-void
+static void
 print_one_ipv6_rule(struct acl6_rule *rule, int extra)
 {
 	unsigned char a, b, c, d;
@@ -855,17 +856,17 @@ print_one_ipv6_rule(struct acl6_rule *rule, int extra)
 
 #ifdef L3FWDACL_DEBUG
 static inline void
-dump_acl4_rule(struct rte_mbuf *m, uint32_t sig)
+dump_acl4_rule(const struct rte_mbuf *m, uint32_t sig)
 {
-	char abuf[INET6_ADDRSTRLEN];
+	char abuf[INET_ADDRSTRLEN];
 	uint32_t offset = sig & ~ACL_DENY_SIGNATURE;
 	struct rte_ipv4_hdr *ipv4_hdr =
 		rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
 					sizeof(struct rte_ether_hdr));
 
-	printf("Packet Src:%s ", inet_ntop(AF_INET, ipv4_hdr->src_addr,
+	printf("Packet Src:%s ", inet_ntop(AF_INET, &ipv4_hdr->src_addr,
 		abuf, sizeof(abuf)));
-	printf("Dst:%s ", inet_ntop(AF_INET, ipv4_hdr->dst_addr,
+	printf("Dst:%s ", inet_ntop(AF_INET, &ipv4_hdr->dst_addr,
 		abuf, sizeof(abuf)));
 
 	printf("Src port:%hu,Dst port:%hu ",
@@ -879,7 +880,7 @@ dump_acl4_rule(struct rte_mbuf *m, uint32_t sig)
 }
 
 static inline void
-dump_acl6_rule(struct rte_mbuf *m, uint32_t sig)
+dump_acl6_rule(const struct rte_mbuf *m, uint32_t sig)
 {
 	char abuf[INET6_ADDRSTRLEN];
 	uint32_t offset = sig & ~ACL_DENY_SIGNATURE;
@@ -888,10 +889,10 @@ dump_acl6_rule(struct rte_mbuf *m, uint32_t sig)
 					sizeof(struct rte_ether_hdr));
 
 	printf("Packet Src");
-	printf("%s", inet_ntop(AF_INET6, ipv6_hdr->src_addr,
+	printf("%s", inet_ntop(AF_INET6, &ipv6_hdr->src_addr,
 		abuf, sizeof(abuf)));
 	printf("\nDst");
-	printf("%s", inet_ntop(AF_INET6, ipv6_hdr->dst_addr,
+	printf("%s", inet_ntop(AF_INET6, &ipv6_hdr->dst_addr,
 		abuf, sizeof(abuf)));
 
 	printf("\nSrc port:%hu,Dst port:%hu ",
@@ -984,8 +985,8 @@ dump_denied_pkt(const struct rte_mbuf *pkt, uint32_t res)
 	if ((res & ACL_DENY_SIGNATURE) != 0) {
 		if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type))
 			dump_acl4_rule(pkt, res);
-		else if (RTE_ETH_IS_IPV6_HDR(pkt[i]->packet_type))
-			dump_acl6_rule(pkt[i], res[i]);
+		else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type))
+			dump_acl6_rule(pkt, res);
 	}
 #else
 	RTE_SET_USED(pkt);
diff --git a/examples/l3fwd/l3fwd_acl.h b/examples/l3fwd/l3fwd_acl.h
index 05af62fe10..a34a08eb7f 100644
--- a/examples/l3fwd/l3fwd_acl.h
+++ b/examples/l3fwd/l3fwd_acl.h
@@ -48,10 +48,4 @@
  */
 #define FWD_PORT_SHIFT 1
 
-void
-print_one_ipv4_rule(struct acl4_rule *rule, int extra);
-
-void
-print_one_ipv6_rule(struct acl6_rule *rule, int extra);
-
 #endif /* L3FWD_ACL_H */
-- 
2.39.5


             reply	other threads:[~2026-04-14  2:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14  2:51 Andrei-Niculae Petre [this message]
2026-07-31 13:37 ` [PATCH v2] examples/l3fwd: fix compilation when DP debug on Andrei-Niculae Petre
2026-09-08 18:10   ` Stephen Hemminger
2026-09-08 19:16     ` Andrei Petre

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=20260414025137.91776-1-p31andrei@gmail.com \
    --to=p31andrei@gmail.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=sean.morrissey@intel.com \
    --cc=stable@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.