DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: <skori@marvell.com>
Cc: Aman Singh <aman.deep.singh@intel.com>, <dev@dpdk.org>
Subject: Re: [PATCH 2/2] app/testpmd: clear stale internal len information
Date: Tue, 20 May 2025 14:17:11 -0700	[thread overview]
Message-ID: <20250520141711.0b9d481f@hermes.local> (raw)
In-Reply-To: <20250519160711.4024414-2-skori@marvell.com>

On Mon, 19 May 2025 21:36:56 +0530
<skori@marvell.com> wrote:

> From: Sunil Kumar Kori <skori@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@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 $ 

  reply	other threads:[~2025-05-20 21:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 16:06 [PATCH 1/2] net: fix offset calculation for GENEVE packet skori
2025-05-19 16:06 ` [PATCH 2/2] app/testpmd: clear stale internal len information skori
2025-05-20 21:17   ` Stephen Hemminger [this message]
2025-05-21  5:01     ` [EXTERNAL] " Sunil Kumar Kori
2025-05-21  5:11   ` [PATCH v2 1/2] net: fix offset calculation for GENEVE packet skori
2025-05-21  5:11     ` [PATCH v2 2/2] app/testpmd: clear stale internal len information skori
2025-05-20 21:21 ` [PATCH 1/2] net: fix offset calculation for GENEVE packet Stephen Hemminger
2025-05-21  4:57   ` [EXTERNAL] " Sunil Kumar Kori

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=20250520141711.0b9d481f@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=skori@marvell.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;
as well as URLs for NNTP newsgroup(s).