patch 'examples/l3fwd: fix scalar LPM' has been queued to stable release 21.11.2

Kevin Traynor ktraynor at redhat.com
Thu Jun 9 13:35:48 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/8ce6cfe851152ad08d15dbce591ba5241e138608

Thanks.

Kevin

---
>From 8ce6cfe851152ad08d15dbce591ba5241e138608 Mon Sep 17 00:00:00 2001
From: Stanislaw Kardach <kda at semihalf.com>
Date: Wed, 11 May 2022 16:56:50 +0200
Subject: [PATCH] examples/l3fwd: fix scalar LPM

[ upstream commit a137eb2b2512c202eb01ba96bb592a24cffc72c8 ]

The lpm_process_event_pkt() can either process a packet using an
architecture specific (defined for X86/SSE, ARM/Neon and PPC64/Altivec)
path or a scalar one. The choice is however done using an ifdef
pre-processor macro. Because of that the scalar version was apparently
not widely exercised/compiled.
Due to some copy/paste errors, the scalar logic in
lpm_process_event_pkt() retained a "continue" statement where it should
utilize rfc1812_process() and return the port/BAD_PORT.

Fixes: 99fc91d18082 ("examples/l3fwd: add event lpm main loop")

Signed-off-by: Stanislaw Kardach <kda at semihalf.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 examples/l3fwd/l3fwd_lpm.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index a5b476ced3..5f5c22705c 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -29,4 +29,5 @@
 
 #include "l3fwd.h"
+#include "l3fwd_common.h"
 #include "l3fwd_event.h"
 
@@ -238,22 +239,5 @@ lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)
 	struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf,
 			struct rte_ether_hdr *);
-#ifdef DO_RFC_1812_CHECKS
-	struct rte_ipv4_hdr *ipv4_hdr;
-	if (RTE_ETH_IS_IPV4_HDR(mbuf->packet_type)) {
-		/* Handle IPv4 headers.*/
-		ipv4_hdr = rte_pktmbuf_mtod_offset(mbuf,
-				struct rte_ipv4_hdr *,
-				sizeof(struct rte_ether_hdr));
 
-		if (is_valid_ipv4_pkt(ipv4_hdr, mbuf->pkt_len)
-				< 0) {
-			mbuf->port = BAD_PORT;
-			continue;
-		}
-		/* Update time to live and header checksum */
-		--(ipv4_hdr->time_to_live);
-		++(ipv4_hdr->hdr_checksum);
-	}
-#endif
 	/* dst addr */
 	*(uint64_t *)&eth_hdr->dst_addr = dest_eth_addr[mbuf->port];
@@ -262,4 +246,8 @@ lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)
 	rte_ether_addr_copy(&ports_eth_addr[mbuf->port],
 			&eth_hdr->src_addr);
+
+	rfc1812_process(rte_pktmbuf_mtod_offset(mbuf, struct rte_ipv4_hdr *,
+						sizeof(struct rte_ether_hdr)),
+			&mbuf->port, mbuf->packet_type);
 #endif
 	return mbuf->port;
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-09 12:34:29.832557114 +0100
+++ 0001-examples-l3fwd-fix-scalar-LPM.patch	2022-06-09 12:34:29.605980402 +0100
@@ -1 +1 @@
-From a137eb2b2512c202eb01ba96bb592a24cffc72c8 Mon Sep 17 00:00:00 2001
+From 8ce6cfe851152ad08d15dbce591ba5241e138608 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a137eb2b2512c202eb01ba96bb592a24cffc72c8 ]
+
@@ -24 +26 @@
-index 501fc5db5e..d1b850dd5b 100644
+index a5b476ced3..5f5c22705c 100644



More information about the stable mailing list