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 95305A04B1; Thu, 5 Nov 2020 02:41:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C490A2C2E; Thu, 5 Nov 2020 02:41:24 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DE0702C2A for ; Thu, 5 Nov 2020 02:41:22 +0100 (CET) IronPort-SDR: 3rEh76KByxEntcW03JECPmA4QXIJHhLfx0w3I1lBeDbmbQ9uhxb2+dEC13HR+A50rLl7dlXPqb 5MbyeGv41dHQ== X-IronPort-AV: E=McAfee;i="6000,8403,9795"; a="187182544" X-IronPort-AV: E=Sophos;i="5.77,451,1596524400"; d="scan'208";a="187182544" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2020 17:41:16 -0800 IronPort-SDR: sUNAiY5Qhq/cPoMkfNdWwhvoqGX0ElFRCs/YUdygakFUQK3dGHwzUn/NuZPiqoR7AuVx0chFmC TEETSNpdOBGg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,451,1596524400"; d="scan'208";a="358267088" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga002.fm.intel.com with ESMTP; 04 Nov 2020 17:41:16 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 4 Nov 2020 17:41:16 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 5 Nov 2020 09:41:14 +0800 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, 5 Nov 2020 09:41:14 +0800 From: "Hu, Jiayu" To: "yang_y_yi@163.com" , "dev@dpdk.org" CC: "Ananyev, Konstantin" , "thomas@monjalon.net" , "yangyi01@inspur.com" Thread-Topic: [PATCH] gro: fix an error when packet is IPv6 Thread-Index: AQHWsmItuPWxj8/Fz0Sz74Mf8n6aBKm4tmJg Date: Thu, 5 Nov 2020 01:41:13 +0000 Message-ID: <2b25bc48b7d64d7ca0906fc95e753e5a@intel.com> References: <20201104042236.125888-1-yang_y_yi@163.com> In-Reply-To: <20201104042236.125888-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] gro: fix an error when packet is IPv6 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" Hi Yi, > -----Original Message----- > From: yang_y_yi@163.com > Sent: Wednesday, November 4, 2020 12:23 PM > To: dev@dpdk.org > Cc: Hu, Jiayu ; Ananyev, Konstantin > ; thomas@monjalon.net; > yangyi01@inspur.com; yang_y_yi@163.com > Subject: [PATCH] gro: fix an error when packet is IPv6 >=20 > From: Yi Yang >=20 > Current code will think IPv6 packet as IPv4 packet > if inner header is IPv6 and outer header is IPv4, > the result is rte_gro_reassemble() will handle it > as if inner header also is IPv4, so IPv6 can't > be handled correctly as one of unprocess_pkts. Good catch. If the input is a VxLAN pkt whose inner L3 is IPv6, inner L4 is TCP or UDP, and outer L3 is IPv4, the value of IS_IPV4_VXLAN_TCP4/UDP4_PKT is true. Thus, GRO will mistakenly reassemble it. But for IS_IPV4_UDP/TCP_PKT, I think it's better to use "RTE_ETH_IS_TUNNEL_PKT(ptype) =3D=3D 0", rather than "((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D 0". BTW, the commit log is not easy to understand what bug the patch tries to fix. Thanks, Jiayu >=20 > Fixes: e2d811063673 ("gro: support VXLAN UDP/IPv4") > Fixes: 1ca5e6740852 ("gro: support UDP/IPv4") > Fixes: 9e0b9d2ec0f4 ("gro: support VxLAN GRO") > Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4") > Signed-off-by: Yi Yang > --- > lib/librte_gro/rte_gro.c | 34 ++++++++++++++++++++-------------- > 1 file changed, 20 insertions(+), 14 deletions(-) >=20 > diff --git a/lib/librte_gro/rte_gro.c b/lib/librte_gro/rte_gro.c > index e56bd20..4347267 100644 > --- a/lib/librte_gro/rte_gro.c > +++ b/lib/librte_gro/rte_gro.c > @@ -32,32 +32,38 @@ > NULL}; >=20 > #define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > - ((ptype & RTE_PTYPE_L4_TCP) =3D=3D RTE_PTYPE_L4_TCP)) > + ((ptype & RTE_PTYPE_L4_TCP) =3D=3D RTE_PTYPE_L4_TCP) && \ > + ((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D 0)) >=20 > #define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ > - ((ptype & RTE_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP)) > + ((ptype & RTE_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \ > + ((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D 0)) >=20 > #define IS_IPV4_VXLAN_TCP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) > && \ > ((ptype & RTE_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \ > ((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D \ > RTE_PTYPE_TUNNEL_VXLAN) && \ > - ((ptype & RTE_PTYPE_INNER_L4_TCP) =3D=3D \ > - RTE_PTYPE_INNER_L4_TCP) && \ > - (((ptype & RTE_PTYPE_INNER_L3_MASK) & \ > - (RTE_PTYPE_INNER_L3_IPV4 | \ > - RTE_PTYPE_INNER_L3_IPV4_EXT | \ > - RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN)) !=3D 0)) > + ((ptype & RTE_PTYPE_INNER_L4_TCP) =3D=3D \ > + RTE_PTYPE_INNER_L4_TCP) && \ > + (((ptype & RTE_PTYPE_INNER_L3_MASK) =3D=3D \ > + RTE_PTYPE_INNER_L3_IPV4) || \ > + ((ptype & RTE_PTYPE_INNER_L3_MASK) =3D=3D \ > + RTE_PTYPE_INNER_L3_IPV4_EXT) || \ > + ((ptype & RTE_PTYPE_INNER_L3_MASK) =3D=3D \ > + RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN))) >=20 > #define IS_IPV4_VXLAN_UDP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) > && \ > ((ptype & RTE_PTYPE_L4_UDP) =3D=3D RTE_PTYPE_L4_UDP) && \ > ((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D \ > RTE_PTYPE_TUNNEL_VXLAN) && \ > - ((ptype & RTE_PTYPE_INNER_L4_UDP) =3D=3D \ > - RTE_PTYPE_INNER_L4_UDP) && \ > - (((ptype & RTE_PTYPE_INNER_L3_MASK) & \ > - (RTE_PTYPE_INNER_L3_IPV4 | \ > - RTE_PTYPE_INNER_L3_IPV4_EXT | \ > - RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN)) !=3D 0)) > + ((ptype & RTE_PTYPE_INNER_L4_UDP) =3D=3D \ > + RTE_PTYPE_INNER_L4_UDP) && \ > + (((ptype & RTE_PTYPE_INNER_L3_MASK) =3D=3D \ > + RTE_PTYPE_INNER_L3_IPV4) || \ > + ((ptype & RTE_PTYPE_INNER_L3_MASK) =3D=3D \ > + RTE_PTYPE_INNER_L3_IPV4_EXT) || \ > + ((ptype & RTE_PTYPE_INNER_L3_MASK) =3D=3D \ > + RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN))) >=20 > /* > * GRO context structure. It keeps the table structures, which are > -- > 1.8.3.1