[PATCH 2/2] app/testpmd: clear stale internal len information
Stephen Hemminger
stephen at networkplumber.org
Tue May 20 23:17:11 CEST 2025
On Mon, 19 May 2025 21:36:56 +0530
<skori at marvell.com> wrote:
> From: Sunil Kumar Kori <skori at marvell.com>
>
> hdr_lens is used to maintain header lengths after parsing packets.
> When port receives different type of packets (say first is VXLAN
> packet and second is GRE packet).
>
> For first packet, L2/L3/L4 lengths are set for inner and outer header
> alongwith tunnel_len.
>
> Now for second packet, tunnel_len is added more than its size it
> contains stale value which further leads to wrong header pointers.
>
> Hence clearing stale information before processing each packet.
>
> Signed-off-by: Sunil Kumar Kori <skori at marvell.com>
The initialization of hdr_lens then becomes redundant.
Maybe better to just move it into the loop.
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index fa0002d321..203af35cf0 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -627,7 +627,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
uint32_t rx_bad_outer_l4_csum;
uint32_t rx_bad_outer_ip_csum;
struct testpmd_offload_info info;
- struct rte_net_hdr_lens hdr_lens = {0};
uint32_t ptype;
/* receive a burst of packet */
@@ -666,6 +665,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
#endif
for (i = 0; i < nb_rx; i++) {
+ struct rte_net_hdr_lens hdr_lens = {0};
+
if (likely(i < nb_rx - 1))
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
void *));
~/DPDK/main $
More information about the dev
mailing list