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 7280EA04B1; Thu, 5 Nov 2020 07:08:31 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 95ECC5937; Thu, 5 Nov 2020 07:08:29 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 78D6A592C for ; Thu, 5 Nov 2020 07:08:27 +0100 (CET) IronPort-SDR: vsU5lMqRypqaRVy08gdnMGQLPpCquR0wpf/PxmUtKJBT1vtgMAXh1hOIfJ/wN8SzZ8uXApoFqV MEqB5VYQ/NoA== X-IronPort-AV: E=McAfee;i="6000,8403,9795"; a="166743955" X-IronPort-AV: E=Sophos;i="5.77,452,1596524400"; d="scan'208";a="166743955" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2020 22:08:20 -0800 IronPort-SDR: R2jAbeD9WOst1GuV4eU10KsGHgjuDVZ1ncgqou8WQvbG19R5DVTmRPDSgWIEVtwiloBTXPk6kv 375sipZQmn1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,452,1596524400"; d="scan'208";a="426893834" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga001.fm.intel.com with ESMTP; 04 Nov 2020 22:08:20 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 22:08:19 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) 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 14:08:17 +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 14:08:17 +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 v2] gro: fix an error when packet is IPv6 Thread-Index: AQHWsx8SpQ4iFQg9u0uOuUihm+AWNKm5DUgw Date: Thu, 5 Nov 2020 06:08:17 +0000 Message-ID: References: <20201104042236.125888-1-yang_y_yi@163.com> <20201105025444.140140-1-yang_y_yi@163.com> In-Reply-To: <20201105025444.140140-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] 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" Acked-by: Jiayu Hu > -----Original Message----- > From: yang_y_yi@163.com > Sent: Thursday, November 5, 2020 10:55 AM > To: dev@dpdk.org > Cc: Hu, Jiayu ; Ananyev, Konstantin > ; thomas@monjalon.net; > yangyi01@inspur.com; yang_y_yi@163.com > Subject: [PATCH v2] gro: fix an error when packet is IPv6 >=20 > From: Yi Yang >=20 > For VxLAN packets, GRO will mistakenly reassemble them > if inner L3 is IPv6, inner L4 is TCP or UDP, and outer L3 > is IPv4 because the value of IS_IPV4_VXLAN_TCP4/UDP4_PKT > is true for them. >=20 > This fix makes sure IS_IPV4_TCP_PKT, IS_IPV4_UDP_PKT, > IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_VXLAN_UDP4_PKT can make > decision precisely. >=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..8ca4da6 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) && \ > + (RTE_ETH_IS_TUNNEL_PKT(ptype) =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) && \ > + (RTE_ETH_IS_TUNNEL_PKT(ptype) =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