From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C71EEA04B1; Thu, 17 Sep 2020 04:16:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F17D1D442; Thu, 17 Sep 2020 04:16:13 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id C41911D43F for ; Thu, 17 Sep 2020 04:16:11 +0200 (CEST) IronPort-SDR: IKKYfJbW4wiOKnGd2SvnPrl/70eVViwRhZ3DMr+xv2lu4GoL4raMRc/hdy5nIUTH69DAFgztuZ OcGJ0p6J/How== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="223789738" X-IronPort-AV: E=Sophos;i="5.76,434,1592895600"; d="scan'208";a="223789738" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 19:16:10 -0700 IronPort-SDR: ZZLV2qiKqOGMt0JHgkopxMP/ULn21yjKgBtfJGHPWSmFHZgyhHbofd92Z4NWYJSNHla/H6de/p XXlNys2mtd1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,434,1592895600"; d="scan'208";a="320054880" Received: from irsmsx603.ger.corp.intel.com ([163.33.146.9]) by orsmga002.jf.intel.com with ESMTP; 16 Sep 2020 19:16:09 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by irsmsx603.ger.corp.intel.com (163.33.146.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 17 Sep 2020 03:16:07 +0100 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Thu, 17 Sep 2020 10:16:05 +0800 From: "Hu, Jiayu" To: "yang_y_yi@163.com" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "yangyi01@inspur.com" , "Yigit, Ferruh" Thread-Topic: [PATCH v2] gso: fix pyld_unit_size issue for udp gso Thread-Index: AQHWjJgUq56/0uYYNUa2lL2nMCnErKlsF0Iw Date: Thu, 17 Sep 2020 02:16:05 +0000 Message-ID: References: <20200917021249.191088-1-yang_y_yi@163.com> In-Reply-To: <20200917021249.191088-1-yang_y_yi@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] gso: fix pyld_unit_size issue for udp gso X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Acked-by: Jiayu Hu > -----Original Message----- > From: yang_y_yi@163.com > Sent: Thursday, September 17, 2020 10:13 AM > To: dev@dpdk.org > Cc: Hu, Jiayu ; thomas@monjalon.net; > yangyi01@inspur.com; yang_y_yi@163.com > Subject: [PATCH v2] gso: fix pyld_unit_size issue for udp gso >=20 > From: Yi Yang >=20 > Fragment offset of IPv4 header is measured in units of > 8 bytes. Fragment offset of UDP fragments will be wrong > after GSO if pyld_unit_size isn't multiple of 8. Say > pyld_unit_size is 1500, fragment offset of the second > UDP fragment will be 187 (i.e. 1500 / 8), which means 1496, > and it will result in 4-byte data loss (1500 - 1496 =3D 4). > So UDP GRO will reassemble out a wrong packet. >=20 > Fixes: b166d4f30b66 ("gso: support UDP/IPv4 fragmentation") >=20 > Signed-off-by: Yi Yang > --- > lib/librte_gso/gso_udp4.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_gso/gso_udp4.c b/lib/librte_gso/gso_udp4.c > index 21fea09..6fa68f2 100644 > --- a/lib/librte_gso/gso_udp4.c > +++ b/lib/librte_gso/gso_udp4.c > @@ -69,7 +69,10 @@ > return 1; > } >=20 > - pyld_unit_size =3D gso_size - hdr_offset; > + /* pyld_unit_size must be a multiple of 8 because frag_off > + * uses 8 bytes as unit. > + */ > + pyld_unit_size =3D (gso_size - hdr_offset) & ~7U; >=20 > /* Segment the payload */ > ret =3D gso_do_segment(pkt, hdr_offset, pyld_unit_size, direct_pool, > -- > 1.8.3.1