[PATCH] TCP data length is incorrectly calculated in the gro_tcp4_reassemble function.
Stephen Hemminger
stephen at networkplumber.org
Tue Oct 31 19:55:30 CET 2023
On Wed, 28 Sep 2022 14:10:52 +0000
"jiangheng (G)" <jiangheng14 at 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?
More information about the dev
mailing list