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 A22C9A034E; Mon, 21 Feb 2022 13:08:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 284094068C; Mon, 21 Feb 2022 13:08:21 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id D960A4013F; Mon, 21 Feb 2022 13:08:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645445299; x=1676981299; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=Vb2oPjaFfnqPvRk32ESNyXdv2ENkH7vh/38lF2oLgLk=; b=Nx538PDvOXQBpr2bkKvcsRIRzqW63YPoUDfxXTF/NIe1OJdqf1FOiQAz ta0IshR7xVvMPCdhKRx27PWkzUvLbBZLDBt/3UcEUquQECYpn4ofsxKWp 8C2iVbmycfbPuShEQ9Ja2d+h8g2cLyWrVMEsVzk87a75cdyUqKGDn42mb KuqnTDwqQo/wGiSMUkwSlBZhD3OtESGZxJF5n1oq3l7y6q/mUvTtwRaYs tgM9XIihikb4xT6P+3x3UzGszSAQ+oKxY+xD/UZjoxyQH2zcmJ2Ch4PLz UFXM0g/u5sXYZMv/K0ifT+cA1LKmtil4W8uj7ObAulyB9S8zuRXolmpKo A==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="249076546" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="249076546" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 04:08:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="706237877" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga005.jf.intel.com with ESMTP; 21 Feb 2022 04:08:15 -0800 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 21 Feb 2022 04:08:14 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 21 Feb 2022 04:08:14 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.48) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 21 Feb 2022 04:08:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KfPzY0xXNTUny/zXWkQef6BhKxcAQH6PjUF8KtJP9WVeWABni4+4AjJCg0l10co3lJG2WB/LLyHuEPUEs9y8CqWjNlLPbDHgVsgZ2snLcuYwzvqC4q2grROL6ttc9Wp5BYLx5f0EyDsvgXxI0YLEaxbLG0yxWXgvcMY/sVJ3oy/TQ2q11N7DJ3iCEpWGoyyxIihokCPbYEP9/F0SIArLUr+HtXqM+vn3sAQpb1LAXygJwmCLDetrOF6oWv10dwWVvGy+mKUdOtx8BdTLhe2tUTmH5BIxQ0GrJHtuvTeJxhR3ijE5tE5qad7tiKwSF3zLKgTl9J0UTcAU7mmQG/eKtQ== 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=Vv39KAbujhOPIM0ky6zkIRjLdtNoZN9602IZLj75+vw=; b=YMMTZAG1uvopKZOsV8rt9kxLAalMJrY3kaoOClBAKiSx26Nzat1udwRrsFMtCSsgo86gsul7mMFCjqGQu6e5IHhD5S4CQftw1nFveqTSiUe1lo4nUjvBAbms1amoXSE6ty3GIHydAhOIzmz3yZfVbDSxTefgfVD+MxVHTIylic4S5cktAVM39phJrq2Gr+jf7UqwElknabuXZ7CgLfVG46YqpIKXDUvMcCHFQaD0qtPeLMoyBC601dn30uN5PXo0LayuQdfgOkMZzd507v0r5UjWUIJzb7uZS4wHqcBi8LvwGsKrxbEf8T1TG78LgEwPxQjEMmLR+BztG+yBrun9uw== 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 MWHPR11MB0047.namprd11.prod.outlook.com (2603:10b6:301:68::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Mon, 21 Feb 2022 12:08:11 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4995.027; Mon, 21 Feb 2022 12:08:10 +0000 Message-ID: Date: Mon, 21 Feb 2022 12:08:04 +0000 Content-Language: en-US To: Raja Zidane , CC: , References: <20220216123732.32617-1-rzidane@nvidia.com> <20220220120954.29784-1-rzidane@nvidia.com> From: Ferruh Yigit Subject: Re: [PATCH V3] app/testpmd: fix GENEVE parsing in csum forward mode X-User: ferruhy In-Reply-To: <20220220120954.29784-1-rzidane@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0173.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::17) 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: 7a6e3aa6-2cd3-4301-be41-08d9f532d409 X-MS-TrafficTypeDiagnostic: MWHPR11MB0047: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: r3m/ylZSxUoLrP4pCwveVbIX4u4K8T0Ssq37dg7qyp6vQFg3Atr/57W7EaPAIm/sSZzpuQy81lfSly/JC42w9cAvOGxDkZ3LLUYZZfh6wy5c7WsVyOfc1XrVzDxN84FG58dDrKZkt6n2WuYXJ+UXuWuOx1GizmpbX1+x+0qPT37pJTM/Ygtudp7fgwuwQ/dGoZjnGTSjfdDEEv7fM5vkGQnVdrp64Pkhu7nNSxHecOiti8nE/5cxj2qHpIWgR7eQbnlSohxrhrREaQM1/cCUAyL+Sfuhjq65xs1pWHzTa7OEwkGN1mYmv63OPvMNEcS1h5DpCufhWcnW7veerUQArFitb+0DZynaTUCPlVdAOpkGXeGN7nLZZgt+DU51wMjWtFXsAhOO71ti3b4lRRvCjpMPqygRf46edyKYPEIyxdoZBm1Pg1BKsTw2mYe7DzhycXkS6NsC2DyC0wNQJLN0t0KuUxbnTNkrCafjEwRaYllDmndGT1tbWJWSCWNAG9uYKxf6fck07pX7qWewOn5ft3ILxPth7T/98RUyeuIkaBupuXHHy1PS4qtzLyChLvZEWNm5rw4wRVLMsDTA92eHMyiJoM/sxCt+zXmPCavDP8MT/iB0lru5oVYlooV/i7Hf7qiDUykdRI7zLfkyE1rFb3PUVCfGilFNGAryYH5W2d9/sYfLuoJlXLc4+DYwcispMyS/E4JZkcOjooX43bVxJw== 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:(13230001)(366004)(82960400001)(38100700002)(186003)(26005)(83380400001)(2616005)(6486002)(2906002)(8936002)(31686004)(36756003)(44832011)(5660300002)(316002)(4326008)(66946007)(66556008)(66476007)(8676002)(6666004)(6512007)(86362001)(508600001)(31696002)(6506007)(53546011)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K005MzFWODRiSVJpdzhtSHdUdzd3Mitxa0FoK2hrRnN5OVBVSlc3eDFCNm1K?= =?utf-8?B?SG50VVc0YWpLcFhCcmRYaUV4ZFRBbGFYR3ZQbklzS1ZCRERldWRZT093T2xC?= =?utf-8?B?SzdUSzhMa1duZzVOSE13ZDFaQWcxbVNGMjcrYUg0WXp3RVh5QkY0SDhXRGQx?= =?utf-8?B?RWNsODVuMUJHUVBIYkNwMmZ6TEdjbGI3Y0VLKzFSS08yK3Z5NUlpU2dSYlFK?= =?utf-8?B?TUYrQmFjbmN6MC9LY1NUUktLQUdrQTJWVGt6cExWS2FXZEFBbTU0Q2gxRCsx?= =?utf-8?B?b1FjUGpabitpV1hoNFF1OGU1d1FCVkx1RlBMYktuazhDUHRqdHpBcDc4dmR1?= =?utf-8?B?bk1rQW84RllvRnBiYVoxOGozaWozT2NQeDRlTjV3Qmp1b3JYcUZxVEZ3c1Zz?= =?utf-8?B?TjN4RGoxSTBNbTlDNnA4c3VVd2dKYkN5UkdVS25nVmx2d2JDdU1jajJ1YTZB?= =?utf-8?B?VENTUGtaVTJLSTBOVGN4QU5Pa3dJTmtGeW1lUC82dG5WZG9ZSWs1Q2g3MTdi?= =?utf-8?B?eTFpZS9pc0F2a3djS0V6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R2UDVjb2dtaXFxYjBuMEplQngzQ3NQeDY4My9qVStFQ3Z5cVI5a04yWnR5?= =?utf-8?B?TWtScHRKalcrV1k5TzVIaUxEaVhqN0hNcWlKWDQyckpUSThnS0tWL3B4UjNZ?= =?utf-8?B?ZVFRS0ZoUmpBU291ZzlOVlZ2aVFUZ2hDYjRHazJpOWVLci9zQXhHdVVWaW9J?= =?utf-8?B?UkVDbzU2Y1RlV3JuRDdYWmQ1eDRrd0RsNFMvMm84R0pzM2JtMXRWY3JHSFcv?= =?utf-8?B?SjhsR2VONGJMNnhCd1ZzeVdjY0VmcTJaMmFNZVdJcDBNQ2dsbzl4cEl2Z2Rj?= =?utf-8?B?aVUwNzNlNU0wSDN1OHF6Z0ZFRW8wRm14UHk3WE14Z0xUSWRBNDBUa2trbUV6?= =?utf-8?B?eWVPV2diME4raXNsVjVCTFdmUjVhVGg1RXRIOGUwYytDczRNSnlIcVVuemdJ?= =?utf-8?B?akhMM1R3SDVOYlVTVVY2WGc4c1BPbW1ZazFvT243UFpMbFZ2RUNrRmpsRWxM?= =?utf-8?B?R0I4KzFYbUhHMFpNWE5GV3FzcTNoQmNzVTNkVWpDUHA5aXZja3dTWTYxMXJC?= =?utf-8?B?Mk9QeVZYSmJ3ei93VHROUlZ6QXVmT0dnUnpsR2VmYlVIV1cxbVExRUU3SW1x?= =?utf-8?B?M3ptbWFTVFRoa2tpLzB2STNWUkZvckpzU1ZqVXZ1elFWbUtZR0pDZDdVTzho?= =?utf-8?B?RG4rNERQMGlKemJxa24wWUU2WDI2dkMvQzBiNWFraUxxais5WnBURkpwbW5M?= =?utf-8?Q?bwzVy4gqP3gdh3VWCwrCoJM=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7a6e3aa6-2cd3-4301-be41-08d9f532d409 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2022 12:08:10.6713 (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: K3I02jo/hfKkLcyssHCe7kJwfygWVi1P08MNO9rTxj93r5P88lVWkIucluUQDoGzcAx29k0QIlDOenPoGlzZPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB0047 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 2/20/2022 12:09 PM, 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. > 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. > > Remove the fall back case to VxLan. > Log error of unrecognized tunnel if no tunnel was parsed successfully. > > Fixes: c10a026c3b03 ("app/testpmd: introduce vxlan parsing function in csum fwd engine") > Cc: stable@dpdk.org > > Signed-off-by: Raja Zidane > --- > V2: Log error when an unrecognized tunnel is found (unknown UDP dst port), instead of parsing it as VxLan by default. > V3: revert unneeded changes (swapping parse_geneve & parse_vxlan). > app/test-pmd/csumonly.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c > index 02bc3929c7..e9ade3b864 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -258,8 +258,7 @@ parse_gtp(struct rte_udp_hdr *udp_hdr, > /* Parse a vxlan header */ > static void > parse_vxlan(struct rte_udp_hdr *udp_hdr, > - struct testpmd_offload_info *info, > - uint32_t pkt_type) > + struct testpmd_offload_info *info) > { > struct rte_ether_hdr *eth_hdr; > > @@ -267,8 +266,7 @@ parse_vxlan(struct rte_udp_hdr *udp_hdr, > * default vxlan port (rfc7348) or that the rx offload flag is set > * (i40e only currently) > */ > - if (udp_hdr->dst_port != _htons(RTE_VXLAN_DEFAULT_PORT) && > - RTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0) > + if (udp_hdr->dst_port != _htons(RTE_VXLAN_DEFAULT_PORT)) > return; > > update_tunnel_outer(info); > @@ -922,8 +920,7 @@ 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_vxlan(udp_hdr, &info); > if (info.is_tunnel) { > tx_ol_flags |= > RTE_MBUF_F_TX_TUNNEL_VXLAN; > @@ -935,6 +932,12 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) > RTE_MBUF_F_TX_TUNNEL_GENEVE; > goto tunnel_update; > } > + /* Always keep last. */ > + if (unlikely(RTE_ETH_IS_TUNNEL_PKT( > + m->packet_type) != 0)) { > + TESTPMD_LOG(ERR, "Unknown tunnel packet. UDP dst port: %hu", > + udp_hdr->dst_port); ERR type log can in datapath cause too much log, and not sure what user can do with this error log. But I can see tunnel type set by PMD but not parsed goes through silently also not good. So what about making log type DEBUG, at least it will be visible to who wants to get more information about what is going on. > + } > } else if (info.l4_proto == IPPROTO_GRE) { > struct simple_gre_hdr *gre_hdr; >