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 AD235A00C3; Tue, 18 Jan 2022 13:28:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31FEB42711; Tue, 18 Jan 2022 13:28:32 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 21E934068E; Tue, 18 Jan 2022 13:28:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642508910; x=1674044910; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=ESvn61P2y4++oQAMksA+0YNg09tdUiJ68rkk8Nr4i9Y=; b=RDHuJ/GtPFH3c1mmn2VEBeFcOJZiG4eYjZZUqqeDgNPSrkm9MtqslFDe YvtuCwU1ueVifkACRZyHIOUqV9xVTrKhjLyDtUr8lOxEAtsAWoV3G9oSc C61jTQkyfojD+TxCDYE7M3fOTF630QdqRQrFHRtbdqhQROSI5wAmfqpGE Yu3JRQ1sYkGRxMk3cwvgfb1xpwvDcazUM+ST71RNHd7r5yHCY/j6JI+lc IzlW96Wcm42nBwscXz548Sr7lktC2W0HFpLwyhs2mUtxUCh9UPNEvPqyi 2m7aIVqbZ9i7C/u2UmJIOs6sGDvP+45v2qkenkFjmVxJG66c3tKjn0noK g==; X-IronPort-AV: E=McAfee;i="6200,9189,10230"; a="224782927" X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="224782927" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2022 04:28:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,297,1635231600"; d="scan'208";a="517751890" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga007.jf.intel.com with ESMTP; 18 Jan 2022 04:28:11 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 18 Jan 2022 04:28:11 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 18 Jan 2022 04:28:11 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.104) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 18 Jan 2022 04:28:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/iKL7n7wEETRrA5IyyP2nLCGdmEKFRGc7sRqWsEpdMQMpjcY+/YRFNxEImbuzTLIwcmSBpd+Sjou343DmSuw7YdYdITWb58IQz+M0fV50k6WxksD2bBeDs00XSM/I4d1xoz1Qh+ikzoHAlCypVc4WYZFNKDp+RNjhY5cpGD+grNQy0U5PU4vgkTvYtZazOopYS2656TiDoNXbqV0tk4eSdAEUdat3p1ukX0PZlmP1hw2p6ZnplppkY3qR/tEcsTPeIcOuGdtncSLReBH6qcCugNUsBCRAfeiqi/TZy48OWaUCc70Cv9NOyLnMHvWJc225Tj3L9cpQqo2V+TUw/kBQ== 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=XP5aYF/LjeXb28SUwfrrcPr2Uzu0gP3z0C58NJCEzgg=; b=kAR2k89O33cwEPZLwXABwZ6LiwEu7JKNcMklp7jNlGujMbiWHZJWEQAA2n63uBVhMvR4qyfAqfOaME3DlUgn9r9q4R3xotr+QV0D92B6uqpqFDaK1AMlwf2zNfl3eLL8nbIhfvOUHna3I8iDFuQrK/qo36f4SG40alKEI0jp2Dj5T8FKiPSRAVyDDWzKR6V9t9kByhe4Uk5HECbxi4tXx3KrHzpOTh7A4iCfiG6XrKStxb/AUrbG0gTQ8DEkrtB7RmkeY/JkYRizjlnJ0ex5rpxO/RkJeDNveOYY50ausj4mN9cngH4nZDZLMlmR1k0Qiip85HhJGHujOS+nUrWYrA== 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 PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by MN2PR11MB3629.namprd11.prod.outlook.com (2603:10b6:208:f0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10; Tue, 18 Jan 2022 12:28:09 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4888.014; Tue, 18 Jan 2022 12:28:09 +0000 Message-ID: <6b4a6388-92b7-eeb5-f218-b007199e3ddf@intel.com> Date: Tue, 18 Jan 2022 12:28:03 +0000 Content-Language: en-US To: Matan Azrad , Raja Zidane , "dev@dpdk.org" CC: "stable@dpdk.org" References: <20211205034450.7888-1-rzidane@nvidia.com> <4787802c-cefe-6d15-817f-6b906451ded8@intel.com> From: Ferruh Yigit Subject: Re: [PATCH] app/testpmd: fix GENEVE parsing in csum forward mode X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0154.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::22) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2ddd934-4014-44ad-3cb5-08d9da7dfc3a X-MS-TrafficTypeDiagnostic: MN2PR11MB3629:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MKzIkxDTWvUcoZc/srt7dmeh5/cvJeRtYOWnyksLIUsRaxQXOr2CmGnhbY3sst1Ikca9JImAABby1jfQeHfUBIUzodLdf7myYuwPL81slot70uEUWwHq5l9rDPg9eXKRevGns50fLEMhQ5CA7bFYwTcxFxlWrBKJakfY7ZQXDEI+0TBR1ePIc4TAMGy86iWgS0aLe4Vw4/JV4ZQ1O/rgaw4NzSbA5ecQRHgtqFjF59auzHdF2qqGHNra+8DAPM+6gY0nYymYph/BJ3sdHg9hmvE+utOE89o/wmXomFh1UZL0WyNPmnzfhkgwCwx60mtYS3QfnNrryVwpepu3wcTZnhjP9ZMHCHfH/vuBdZpAEcEwHJF0set3eM3uMYt3f5OFDZXq0hp75Tbf1Z0F2+mfBJxkp58JUddDd4RvWyNNfbva2iKMOH9gOC5q4rAQLz3Et1mlQOU1Jl22a6z3YXsoTo/l0GI2pGG8j9NuSWXkVynGPqWGNT8lt9hJuf5/35cJ8A13ZoPEQhaYrGjRUEnaAFvsMa0djWIPOzjc+f5lSjiyjEghdE9A2xevi7HCCMz9RGOr//ic/1G7clObCgXokpyNOLTfuAYjtr3pflJlJeKSzE8ZsSZD2WO8fof/+HCQn3WpJkC0EtHeHuu3NrI3rzScW6doXPm/8tjnuMP3N42csLkHYIPt3gU1hXVllHrHmWJkd3bpSvCW/yL2XZr0kA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(31696002)(66476007)(66946007)(4326008)(53546011)(66556008)(82960400001)(2906002)(8676002)(26005)(38100700002)(2616005)(5660300002)(316002)(6506007)(86362001)(6486002)(110136005)(8936002)(31686004)(6666004)(186003)(508600001)(83380400001)(36756003)(44832011)(6512007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eXBRckpQZk9nRUlGRkk0ZUg3RGc5NjNiem9uS3k4cjViZHVWV1J3ZExpSlI1?= =?utf-8?B?ZGxKQURMMzZIZFNBV1QzRFlGR0dFMHNnRm16ZGdSbnNkZXlUZVdHK285ZitB?= =?utf-8?B?V2p2bThId05ybGtTNFlZVkc3bjVYUXdPVVZmM1BRUWtweTFpdWNHTDFMbkkx?= =?utf-8?B?dVRrdEJ3cFJSWmJLUmUyM1Qvdmw3bnpGcGRCNHVuVU9XRGg2bkM3Q1huSVhp?= =?utf-8?B?YlJXODFCTGNocGdHTVRwWXNudGI3ZW4wMFdQY1RiSlQ0dFFKbW0rRW9JQjEw?= =?utf-8?B?N3diZWhzc29ibGlwNFVDN3VVZzFRWG1Xc2hiNFoxVjlZRmFzMjRpK2taZVZQ?= =?utf-8?B?ZnN4bWgrNk0yQkd0QlJ2RXlyODQ5Yjh1UmRhV2VEcnRwaC9iV2h2QzJsaGYz?= =?utf-8?B?WGtZV09wVC9qeUl0T1k4ODVCOGJMQm5BVEJRUTZlWnJGYXZsd2M3VXVySGVZ?= =?utf-8?B?UVNPNlBI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ource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2022 12:28:08.9421 (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: U8PHDDNx7m2laFvqwQBGVaQN0OFql6k1+92j6HhhRdLNK63KPAW0VhO7pDN6MsAnYwVg5NrJEARlEzA401I1BQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3629 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 1/18/2022 11:27 AM, Matan Azrad wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Tuesday, January 18, 2022 11:52 AM >> To: Raja Zidane ; dev@dpdk.org >> Cc: Matan Azrad ; stable@dpdk.org >> Subject: Re: [PATCH] app/testpmd: fix GENEVE parsing in csum forward mode >> >> External email: Use caution opening links or attachments >> >> >> On 12/5/2021 3:44 AM, Raja Zidane wrote: >>> The csum FWD mode parses any received packet to set mbuf offloads for >>> the transmitting burst, mainly in the checksum/TSO areas. >>> In the case of a tunnel header, the csum FWD tries to detect known >>> tunnels by the standard definition using the header'sdata and fallback >>> to check the packet type in the mbuf to see if the Rx port driver >>> already sign the packet as a tunnel. >>> In the fallback case, the csum assumes the tunnel is VXLAN and parses >>> the tunnel as VXLAN. >> >> As far as I can see there is a VXLAN port check in 'parse_vxlan()', why it is not >> helping? >> > > The problem is not the vxlan check but the tunnel type in mbuf that caused the packet to be detected as vxlan(default) before checking GENEVE tunnel case. > Check is as following: if (udp_hdr->dst_port != _htons(RTE_VXLAN_DEFAULT_PORT) && RTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0) return; Do you what is the intention for the "RTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0" check? Why vxlan parsing doesn't stop when it is not default port? >>> When the GENEVE tunnel was added to the known tunnels in csum, its >>> parsing trial was wrongly located after the pkt type detection, >>> causing the csum to parse the GENEVE header as VXLAN when the Rx port >>> set the tunnel packet type. >>> >>> Locate the GENEVE parsing trial before the packet type detection. >>> >>> Fixes: ea0e711b8ae0 ("app/testpmd: add GENEVE parsing") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Raja Zidane >>> --- >>> Acked-by: Matan Azrad >> >> Ack should be before '---' to be part of the commit log, otherwise it is dropped >> when applied as comment. >> >>> app/test-pmd/csumonly.c | 16 ++++++++++------ >>> 1 file changed, 10 insertions(+), 6 deletions(-) >>> >>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index >>> 2aeea243b6..fe810fecdd 100644 >>> --- a/app/test-pmd/csumonly.c >>> +++ b/app/test-pmd/csumonly.c >>> @@ -254,7 +254,10 @@ parse_gtp(struct rte_udp_hdr *udp_hdr, >>> info->l2_len += RTE_ETHER_GTP_HLEN; >>> } >>> >>> -/* Parse a vxlan header */ >>> +/* >>> + * Parse a vxlan header. >>> + * If a tunnel is detected in 'pkt_type' it will be parsed by default as vxlan. >>> + */ >>> static void >>> parse_vxlan(struct rte_udp_hdr *udp_hdr, >>> struct testpmd_offload_info *info, @@ -912,17 +915,18 @@ >>> pkt_burst_checksum_forward(struct fwd_stream *fs) >>> RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE; >>> goto tunnel_update; >>> } >>> - parse_vxlan(udp_hdr, &info, >>> - m->packet_type); >>> + parse_geneve(udp_hdr, &info); >>> if (info.is_tunnel) { >>> tx_ol_flags |= >>> - RTE_MBUF_F_TX_TUNNEL_VXLAN; >>> + >>> + RTE_MBUF_F_TX_TUNNEL_GENEVE; >>> goto tunnel_update; >>> } >>> - parse_geneve(udp_hdr, &info); >>> + /* Always keep last. */ >>> + parse_vxlan(udp_hdr, &info, >>> + m->packet_type); >>> if (info.is_tunnel) { >>> tx_ol_flags |= >>> - RTE_MBUF_F_TX_TUNNEL_GENEVE; >>> + >>> + RTE_MBUF_F_TX_TUNNEL_VXLAN; >>> goto tunnel_update; >>> } >>> } else if (info.l4_proto == IPPROTO_GRE) { >