DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "jiangheng (G)" <jiangheng14@huawei.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH] TCP data length is incorrectly calculated in the gro_tcp4_reassemble function.
Date: Tue, 31 Oct 2023 11:55:30 -0700	[thread overview]
Message-ID: <20231031115530.018231cc@fedora> (raw)
In-Reply-To: <1c1df455cdb640c9889d359186d38637@huawei.com>

On Wed, 28 Sep 2022 14:10:52 +0000
"jiangheng (G)" <jiangheng14@huawei.com> wrote:

> Hello:
> In gro_tcp4_reassemble function, tcp data len is calculated:
> tcp_dl = pkt->pkt_len - hdr_len;
> https://github.com/DPDK/dpdk/blob/v22.07/lib/gro/gro_tcp4.c#L232
> 
> if packets < 60 bytes, pkt_len will contain padding bytes, tcp_dl is incorrectly calculated. this will result the wrong data length after gro.
> 
> diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c
> index 7498c66141..cbba9fed5e 100644
> --- a/lib/gro/gro_tcp4.c
> +++ b/lib/gro/gro_tcp4.c
> @@ -229,7 +229,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
>          * Don't process the packet whose payload length is less than or
>          * equal to 0.
>          */
> -       tcp_dl = pkt->pkt_len - hdr_len;
> +       tcp_dl = rte_be_to_cpu_16(ipv4_hdr->total_length) - hdr_len;
>         if (tcp_dl <= 0)
>                 return -1;

Yes, this patch looks correct. But it is not formatted correctly as reported
by checkpatch.
	1. DPDK uses tab character for indent
	2. Commit messages are supposed to be wrapped and not long lines

Could you resubmit?

  reply	other threads:[~2023-10-31 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 14:10 jiangheng (G)
2023-10-31 18:55 ` Stephen Hemminger [this message]
2023-11-01  1:12   ` 答复: " jiangheng (G)

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=20231031115530.018231cc@fedora \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=jiangheng14@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;
as well as URLs for NNTP newsgroup(s).