From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4E2C43255; Tue, 31 Oct 2023 19:55:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6095F40294; Tue, 31 Oct 2023 19:55:36 +0100 (CET) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id 0EE6C40285 for ; Tue, 31 Oct 2023 19:55:35 +0100 (CET) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso4760899a12.3 for ; Tue, 31 Oct 2023 11:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1698778534; x=1699383334; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=g9EK0LJBrvBUzz5SPp+EQhCc2uHkpT818cceMORWjng=; b=Zh7HTqnSoKrQwrofajSzcMbfjdo4/3iKklh21S2zMjYj3/n9HrpEJxvaPaPeR9p6Ap IsKHggFCYh/5MWvifuyx7XNgfWjqYUtUJe06MrhiPv1Q7ZiSaAZHd71NZZeQQw0rib5T xHUMbhLi1hVG4LuJ6ReBSWjCGkNAcjrQMvM0RnsuFhyKuod6o7HtgcatgB7/pzJOyI7L uiZdQt19NsIZrjtrr8q1en2jg7aptc0lTpIhpPOxjAgYpfrAesI0o/ieAGB8Jj417PN4 fNHKsb6K60eb1B+BIeDzenTKt9zOmq2uoxjrZFKButxHa3DKoRxqTPZOk5mzHIqj905/ gM5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698778534; x=1699383334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g9EK0LJBrvBUzz5SPp+EQhCc2uHkpT818cceMORWjng=; b=AxlS3Q2Be6iB0Ihm9mb+Q6ID0PW0Sy6JfhQxg2KXaDXlA/TOTJVnUCtuw0w+DtWiD0 93zzkwlFYgmE43d/6B31AFtegcZ4wY/a+BjvBGnOgpK5XOkZMFrs5gEA/OhvHQeMpkjD FYwxOo86Ukenof91IosC9ZlgVi6hWRDxuKUeMAO/2nhJEGKXBIRpIMqtu5aEm5oEXIV6 w+QPGIkkc3c2znyLBW73b1Hvf5JXbLJMSj+vqiSQ3zgS9ib0aI2uZt+c7orUHUn+Xyn1 50++1udNxQ3ZDyIqIwQiMO5dfAL3r5MYz9ddcLkHIxQmF2pNMhikpTcJguG1F8gpksEk hm8g== X-Gm-Message-State: AOJu0YylB+Rq5SAJQuRzfGOAFu4LHMGDqhMDc1Pd8uVmgehwc2DRayyo qDZ8uP42cnpdTkGhcnp5oBFaItDOZkCH4Tw6vTc2YjW9 X-Google-Smtp-Source: AGHT+IFDyjSvxbOzm1oC1sXW5Hj1kGD41COdAh9cB8+dYdYIMtS+oBtZeoXrADNLfNB4fAwYpapjqA== X-Received: by 2002:a05:6a21:99a9:b0:180:def9:20d4 with SMTP id ve41-20020a056a2199a900b00180def920d4mr3474906pzb.62.1698778533958; Tue, 31 Oct 2023 11:55:33 -0700 (PDT) Received: from fedora ([38.142.2.14]) by smtp.gmail.com with ESMTPSA id fa23-20020a056a002d1700b0069309cbc220sm1551825pfb.121.2023.10.31.11.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 11:55:33 -0700 (PDT) Date: Tue, 31 Oct 2023 11:55:30 -0700 From: Stephen Hemminger To: "jiangheng (G)" Cc: "dev@dpdk.org" Subject: Re: [PATCH] TCP data length is incorrectly calculated in the gro_tcp4_reassemble function. Message-ID: <20231031115530.018231cc@fedora> In-Reply-To: <1c1df455cdb640c9889d359186d38637@huawei.com> References: <1c1df455cdb640c9889d359186d38637@huawei.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, 28 Sep 2022 14:10:52 +0000 "jiangheng (G)" 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?