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 A03B8A034C for ; Fri, 11 Mar 2022 14:35:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89586410E3; Fri, 11 Mar 2022 14:35:08 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 8EE4840042; Fri, 11 Mar 2022 14:35:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647005705; x=1678541705; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=9Nr/US2sWhUfxQKElx7zGKftILiWuUGPlNHmWsycocw=; b=IY23zU5e31vB2KMwS+QbO6DwGdhQh3i33PZSZI93lwcliuF0UQb3iUEz maWzamnsYzunM79GSPXyeCTO07e/6bTyY3BiGkolk+aa6//9W+5w06JFS gMaMBXASu/THPBy+87AgLzl6iR4BKIACf9w6oYaSEHdYP/rXyHCZ6z+dj YDkE9mYFPVSpbAa3DH/thbQHZAVgf/u80EkJJBRYW3QwfEpwtC/jz1DOS zrmZfpkqGKPZwJQOXhxy/Z37azpttaZSpvF/mkLGoHJuYHV9m2r3A/69O SuscmYukQhOmRUfjAMkRBRFOtooZ7x/SUv4HNQtbyxMNglobH22qeiL6f w==; X-IronPort-AV: E=McAfee;i="6200,9189,10282"; a="237744507" X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208,217";a="237744507" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2022 05:35:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,173,1643702400"; d="scan'208,217";a="579286913" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga001.jf.intel.com with ESMTP; 11 Mar 2022 05:35:04 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) 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.2308.21; Fri, 11 Mar 2022 05:35:03 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Fri, 11 Mar 2022 05:35:03 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.177) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Fri, 11 Mar 2022 05:35:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5jBjUo7iDafwoX8fezIomGxy8kNrEYKUH+Dm/Zw3QXomoHtfX9bnycHYYvZokR7ACzAaXgGV/1BDmxAU6Z59f1DPKhiZFQkfhfyp4pQYnL8RxUrSDFd0tDdnXTapyhvHTM4aKF62ME9eYz7Z87S+kDQ8N+Pzb26dcAhVmw6jkhwWdzOT8y0hp82h5ghXCuBT3lkAAAbPaKKeZH96+tcZArzCCux4OColnLslaTA42jBgmYJM9PDmVYZP/dGZ8iYzYVfgndfe5gV+193DXw6gXWAEd8odaEygycNnM3Nb4T4Atr5iar3Hg5vjqScefHC23iA5NtxuVSSRUsnEPBh/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XYu5HV5Jq8oegiJ0k748P0oWp3nzSzb4BPcCAJaUMDc=; b=W2b9UtE1gU+uHh4FXqAA3tJf4U4XPLuHyVjopDSrmScpEPFYQnp8Q1L3gENFdzsMZTq0sgQSullKxGFqrgb6CHoSB038Q0JvM3ZfKpPQo8DM6Zcb1S+EA3rqp1lCdN9RblL+oftYmlIs74KXl/hjkaSeQjicWfspEDb4SMkuw/b38fJn0FioHkn0m9a+yhSNMkuRamTprVcEsZCsUrsK/LZ1Q88MqkkHoFR/eoZ4AiGP95ogu6A1yKkPKv/bmoJqtTqMYSYkFcV2er7uW6Mr9iip9VVTziMqeBQcngG/LpE5zpcfvgWLEYhzPZCeWOEZg1Fk5d4jDcF6WChqYAklew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by BL1PR11MB5365.namprd11.prod.outlook.com (2603:10b6:208:308::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.21; Fri, 11 Mar 2022 13:35:01 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::bcb3:2b8:38c7:1567]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::bcb3:2b8:38c7:1567%3]) with mapi id 15.20.5061.024; Fri, 11 Mar 2022 13:35:01 +0000 Content-Type: multipart/alternative; boundary="------------QQ0ZHS4MqnxibOzFnbtT6f00" Message-ID: Date: Fri, 11 Mar 2022 19:04:52 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] app/testpmd: fix GTP header parsing in csum FWD engine Content-Language: en-US To: Gregory Etelson , CC: , , , Xiaoyun Li , Yuying Zhang , Ting Xu , Ferruh Yigit References: <20220310142019.13398-1-getelson@nvidia.com> From: "Singh, Aman Deep" In-Reply-To: <20220310142019.13398-1-getelson@nvidia.com> X-ClientProxiedBy: BMXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::16) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ef973c6-014a-461f-d79e-08da0363f150 X-MS-TrafficTypeDiagnostic: BL1PR11MB5365:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qta0kmUu8i9Fe1YLJu2kRatXmtoPt1n4er01kFfeRdNfXETMlQip44i8yhzcCdKjuJO4/5THVJlVQ5du+nEOHGwIlts+oOWxwEuC1YM0TyPSVyT/SwTywwaJxCPV7z6mh6zkEA1jCQawGPSBg+K1iauqmVnyg9hgrIpL9sTtkJEM2kI8RuviVyKUFz08PqIFFy19vWVcR4KDNSuFKg9De01V8lHzQSJqsseTxIbF6D0x/0Gc/zQQBoZ3R0bRVpaZqrDg9UrKnUcPDxyhAaRZ7PgRS6KIg+Yq0J5CiXPM2k6mh91rAZCoHutirKShzcYs15gIX9l2/lMAVrfTcu2fuusm6U4FhL0Zmk1EdtCnV8Ywb+REeA0pA6bS6tNxSZAKMfLH//mShXDqR/I7wGKiU5peVgSi56n4B9ZvFp7wlgWMIzyQNnM/qFYvASFUqN1F6Elpny2ZBP3gJls3PdjGXhik1jlsg/aQuzYeUNaA5hxmLAqK8/WreVgWV81GSONaQHPvkB1ugMzF+5C1E25K8vaP9XUZhGKnH2gkAubTzj5IYmYZwkXqLpOEmEG0C9/hc6fIgJsTNv+PQB188+zRHkPl6ZwPpY3ziWJNGWbjNTYv78Gy9rJRiPkgLbRWef4KAov5nuFNfzoYQixe09YExSPUJgrqC80/tgMf4dxy9wTAjVhq4aS4CD9vu4g08FBT7t0/kZHTVadYpNuolPMsnunvsxymvPsrgoNRaj846oIwG+JxgEzQtzlKwWeeze8N X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(31686004)(8936002)(2616005)(83380400001)(6666004)(6506007)(31696002)(6512007)(82960400001)(508600001)(86362001)(316002)(33964004)(53546011)(54906003)(5660300002)(186003)(38100700002)(26005)(2906002)(6486002)(107886003)(66946007)(66556008)(66476007)(36756003)(8676002)(4326008)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N3FLa3YrUjZjelVYVUxYMkZWYzhtK3pvUWQrMVljblp1MERXTy9xUVFZOWdG?= =?utf-8?B?ZHVNc1RTWU9LMGVzU0RpZVBZb2FWZkJCVzA3bFJPQ3AwU3NMUXZGYUZyZW9x?= =?utf-8?B?TSt1b2trd0E3Y045a21JUUFWNXI4ekRNRkljeS9WdHJkditCV0F6dVZibUln?= =?utf-8?B?OWhONm5yVXhnclZEaFVTc1RTbWptTG9oV1FSUlU3MFJYV2hrRHBQYkRuMmdF?= =?utf-8?B?bTR2SVlYTmVhVlVqTnluWFVwRmJ2cFFQUFNhNXlCODZiVUdLYUVrbitwOEk1?= =?utf-8?B?MGZkd2FnZlV2N0h5QjRldml5bU42Tmc5aXNCNEpuVGVKekEzSHpzSWg2b1RK?= =?utf-8?B?bHFWb0RoNEd5Rk02dUo1Y3h4WjA5d0w4R3Q5a0Y1QzNQNEFHR1I3aXE1R1p5?= =?utf-8?B?RHRIWXRlT2NnbVE3QTFrNjNvUjhqS041WjZqaDNXaGZid1lGVVFs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VNXT1RidFYzeXI0WTJOb0xB?= =?utf-8?B?VWVZb284eEhUVDU3VXkrOXJZQXpJb0xDaitsTXdjK2FPOWRuN0pOZWRmOE9C?= =?utf-8?B?WWg5U3plOVlRcGZGYlpJSDVXcDhoZTc0MTlEd2RuTThjM3RML2VNdDhNKzFJ?= =?utf-8?B?OEQzMUt5UHlkZHc0VmJkbDF6TFlOTnlNV01jaE9iZU9OYWxGc1JScFBZSSt5?= =?utf-8?B?RkRoYTVHT0x2anRlbVVQVklJd2ttN1lQa2licHY1QlpjWExldmE4aXA0S3lC?= =?utf-8?B?VWNVZFdCSnhXUDVzbWtUem0rZHF1OGRPQlhKMTJYdEFlbk5VV3pZT2piMzY1?= =?utf-8?B?UUdRSGFzTGNkVWdPUHhoSU1pZFY1ejBTNGJOMG5oZ3pQMFk2aktUenhlUmMy?= =?utf-8?B?eGJKZ01ib0N5RlFMVy9ZQnJrL2dKTS9RM0ErVG90M1JDZEdXK2p2TFNWSmhW?= =?utf-8?B?TlFVd2REaGdBWEs0QURNOEtVeHpCdm5jelQ2Qnl3TVoyS0swSG5uTGExQmEr?= =?utf-8?B?REdBeEhCNWpGVWo4aEEzTDlmQlVSOFA5K050eEErOVpUd2k3aWlac01vVG9N?= =?utf-8?B?RElwUEpvd3g1SVBwVGdjai9Fc0VFNDdiWVNtNWNUYUNnT1JHU2l4Q3RNa1Ur?= =?utf-8?B?d2kvdnAxKzVnPT0=?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6ef973c6-014a-461f-d79e-08da0363f150 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 13:35:01.5973 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +kvI6iTpPuS+061C6DlM15zoYZGCaCUrBvFsZV6Ph/as8Vn/4LauH2RdcFOTAXq+tcpOtBz2Dw5HMX8iPtvvCVOZY3Hy24WD90VTEE0DxTs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5365 X-OriginatorOrg: intel.com 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 --------------QQ0ZHS4MqnxibOzFnbtT6f00 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Looks good to me. On 3/10/2022 7:50 PM, Gregory Etelson wrote: > GTP header can be followed by an optional 32 bits extension. > GTP notifies about the extension presence through the E, S or PN > header bits. > > Csum GTP header parser did not check the extension bits value. > > The patch updates GTP header length if header extension bits are set. Can we rephrase above line "if at-least one of the extension bit is set." To make it more clear. > > Cc:stable@dpdk.org > > Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload") > Signed-off-by: Gregory Etelson Acked-by: Aman Singh > --- > app/test-pmd/csumonly.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c > index 5274d498ee..f8abcded2b 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -223,15 +223,14 @@ parse_gtp(struct rte_udp_hdr *udp_hdr, > > gtp_hdr = (struct rte_gtp_hdr *)((char *)udp_hdr + > sizeof(struct rte_udp_hdr)); > - > + if (gtp_hdr->e || gtp_hdr->s || gtp_hdr->pn) > + gtp_len += sizeof(struct rte_gtp_hdr_ext_word); > /* > * Check message type. If message type is 0xff, it is > * a GTP data packet. If not, it is a GTP control packet > */ > if (gtp_hdr->msg_type == 0xff) { > - ip_ver = *(uint8_t *)((char *)udp_hdr + > - sizeof(struct rte_udp_hdr) + > - sizeof(struct rte_gtp_hdr)); > + ip_ver = *(uint8_t *)((char *)gtp_hdr + gtp_len); > ip_ver = (ip_ver) & 0xf0; > > if (ip_ver == RTE_GTP_TYPE_IPV4) { --------------QQ0ZHS4MqnxibOzFnbtT6f00 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit

Looks good to me.

On 3/10/2022 7:50 PM, Gregory Etelson wrote:
GTP header can be followed by an optional 32 bits extension.
GTP notifies about the extension presence through the E, S or PN
header bits.

Csum GTP header parser did not check the extension bits value.

The patch updates GTP header length if header extension bits are set.
Can we rephrase above line "if at-least one of the extension bit is set."
To make it more clear.


Cc: stable@dpdk.org

Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
---
 app/test-pmd/csumonly.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 5274d498ee..f8abcded2b 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -223,15 +223,14 @@ parse_gtp(struct rte_udp_hdr *udp_hdr,
 
 	gtp_hdr = (struct rte_gtp_hdr *)((char *)udp_hdr +
 		  sizeof(struct rte_udp_hdr));
-
+	if (gtp_hdr->e || gtp_hdr->s || gtp_hdr->pn)
+		gtp_len += sizeof(struct rte_gtp_hdr_ext_word);
 	/*
 	 * Check message type. If message type is 0xff, it is
 	 * a GTP data packet. If not, it is a GTP control packet
 	 */
 	if (gtp_hdr->msg_type == 0xff) {
-		ip_ver = *(uint8_t *)((char *)udp_hdr +
-			 sizeof(struct rte_udp_hdr) +
-			 sizeof(struct rte_gtp_hdr));
+		ip_ver = *(uint8_t *)((char *)gtp_hdr + gtp_len);
 		ip_ver = (ip_ver) & 0xf0;
 
 		if (ip_ver == RTE_GTP_TYPE_IPV4) {
--------------QQ0ZHS4MqnxibOzFnbtT6f00--