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 90859A0547 for ; Wed, 29 Jun 2022 08:57:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A4D840A79; Wed, 29 Jun 2022 08:57:23 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 8C77140042; Wed, 29 Jun 2022 08:57:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656485841; x=1688021841; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2bkASS2p1QqWMSlCd6T45+NQdzJAWgBBwPaPH0v0AJQ=; b=NpIzYbdPX1XFdndPgJfVYCe908Sg+3xxJMNfI/1gsDcrLFRLxB2MjDma BNtDCyGrmZurjAAKOnNRAUmkpTynQA32j6wkSL4+jz9WWNHcty2kPcLwK 49PXVptFPR9MR9Ac3CuXAPEy259QXObdvP88yfMtsfdiXtQQ2zlTIk7jR uHA1DRkl2rdPUgWLJyA84O7Xf1L0QsFZDnbCc3MZEqUdJkEAtABYPbXqp LsPv9fEXYfUSYFsuEHLkCbHUyzOIDyMiknE1xUMFGgfG5YsP9/EnGdFQy phAf12x4irJ02uoQctJ9TdfbCrWPIFRkAj0QYR1FzfqdF/ToJ6rr0uc8X g==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="270707767" X-IronPort-AV: E=Sophos;i="5.92,230,1650956400"; d="scan'208";a="270707767" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 23:57:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,230,1650956400"; d="scan'208";a="647255797" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 28 Jun 2022 23:57:20 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 28 Jun 2022 23:57:19 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 28 Jun 2022 23:57:19 -0700 Received: from fmsmsx612.amr.corp.intel.com ([10.18.126.92]) by fmsmsx612.amr.corp.intel.com ([10.18.126.92]) with mapi id 15.01.2308.027; Tue, 28 Jun 2022 23:57:19 -0700 From: "Hu, Jiayu" To: Kumara Parameshwaran CC: "dev@dpdk.org" , "stable@dpdk.org" Subject: RE: [PATCH v5] gro: bug fix in identifying fragmented packets Thread-Topic: [PATCH v5] gro: bug fix in identifying fragmented packets Thread-Index: AQHYihENoyU8hq2feU+G5dsTW05/wq1l9rYA Date: Wed, 29 Jun 2022 06:57:19 +0000 Message-ID: <962006acc1164a068d8cb727516c5816@intel.com> References: <20220320101232.34438-1-kumaraparamesh92@gmail.com> <20220627103114.94924-1-kumaraparmesh92@gmail.com> In-Reply-To: <20220627103114.94924-1-kumaraparmesh92@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 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 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Reviewed-by: Jiayu Hu Thanks, Jiayu > -----Original Message----- > From: Kumara Parameshwaran > Sent: Monday, June 27, 2022 6:31 PM > To: Hu, Jiayu > Cc: dev@dpdk.org; Kumara Parameshwaran > ; stable@dpdk.org > Subject: [PATCH v5] gro: bug fix in identifying fragmented packets >=20 > From: Kumara Parameshwaran >=20 > A packet with RTE_PTYPE_L4_FRAG(0x300) contains both RTE_PTYPE_L4_TCP > (0x100) & RTE_PTYPE_L4_UDP (0x200). A fragmented packet as defined in > rte_mbuf_ptype.h cannot be recognized as other L4 types and hence the > GRO layer should not use IS_IPV4_TCP_PKT or IS_IPV4_UDP_PKT for > RTE_PTYPE_L4_FRAG. Hence, if the packet type is RTE_PTYPE_L4_FRAG the ip > header should be parsed to recognize the appropriate IP type and invoke t= he > respective gro handler. >=20 > Fixes: 1ca5e6740852 ("gro: support UDP/IPv4") > Cc: stable@dpdk.org > Signed-off-by: Kumara Parameshwaran > --- > v1: > * Introduce IS_IPV4_FRAGMENT macro to check if fragmented packet and > if true extract the IP header to identify the protocol type and > invoke the appropriate gro handler. This is done for both > rte_gro_reassemble and rte_gro_reassemble_burst APIs. > v2,v3,v4: > * Fix extra whitespace and column limit warnings > v5 > * Use RTE_PTYPE_L4_FRAG to identify the fragmented packets in > IS_IPV4_TCP_PKT and IS_IPV4_VXLAN_TCP4_PKT >=20 > lib/gro/rte_gro.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c index > 6f7dd4d709..e35399fd42 100644 > --- a/lib/gro/rte_gro.c > +++ b/lib/gro/rte_gro.c > @@ -32,6 +32,7 @@ static gro_tbl_pkt_count_fn > tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] =3D { >=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_FRAG) !=3D RTE_PTYPE_L4_FRAG) && > \ > (RTE_ETH_IS_TUNNEL_PKT(ptype) =3D=3D 0)) >=20 > #define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \ @@ - > 40,6 +41,7 @@ static gro_tbl_pkt_count_fn > tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] =3D { >=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_L4_FRAG) !=3D RTE_PTYPE_L4_FRAG) && > \ > ((ptype & RTE_PTYPE_TUNNEL_VXLAN) =3D=3D \ > RTE_PTYPE_TUNNEL_VXLAN) && \ > ((ptype & RTE_PTYPE_INNER_L4_TCP) =3D=3D \ > -- > 2.25.1