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 A832C4281A; Thu, 23 Mar 2023 12:10:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A9CE40E09; Thu, 23 Mar 2023 12:10:06 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2042.outbound.protection.outlook.com [40.107.100.42]) by mails.dpdk.org (Postfix) with ESMTP id AAB0C4111C; Thu, 23 Mar 2023 12:10:05 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cnhUQdqq1p1HGLe6puI+jxrCFMBXJKaGWIXfoHuT6dnGxUanG7XD0asF1wP15wiYL2XyYb6auwKzGcgWrJ93iYQRMm+BFgQUu5FHLs/SMsbqt8V/dYdbLIIIOotcJVmPTIUF2LnBdiSHgetvnrixn0iVd+O/e/U3rLdsAWdMJzG6ezVJofl7H7CaK1zVUkirOMiJSqbjeVEObnd/s6ksCAl4FOQ0Qn2L/+//9zAppyP4BlFn+0b+hHqQj+c0guPrgt7L767aoPUT3UQlzePK2+Wti4UUP22YBwQUtAqNmaK883mNeiYjHDRn6khNOdJXF3/OvXnUdzsCO36NtekkCQ== 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=W/a2EoLSEnE8U/+iqMyja98KhCgbsrw+Fb2WSftykI8=; b=T49IW6qA+SHgeq0XcrGMQkFvz0mIhbgO81T6N58D3Qyv9wSxl0FABfN4DEKEKvqyX0tOLt+MsFotWO0rJh9D5twPnIX6SO1H0ia4BainRAq0SbpwmAWRj6IR7cIqxCkCidoNBMQBACgNKeM5pVrNlkPjzgBYP3G2SjIUEPJuRfOgAqsARvxiB8ZN69AE9qRRY34JbiILNoDPGpGchrd7umozOAhKvJmhYQoWi5qCqclWa9hJOkD2M74xv5OSm4HbyybwrzObdfQVNDdRlH0Gm7dwrkU1huCv8BGzkm+ofb9ZkMVdmm/K6/QqXDzbdfRa22sxpaRYMW7hA/D+9ju3UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W/a2EoLSEnE8U/+iqMyja98KhCgbsrw+Fb2WSftykI8=; b=ULgVDcICW4mtYSGheht5zVyks8TsriPzQe0zgTG7aKHIc8D6afxCfKFK+JTfjL3dZaj6rAlK8XUiweJclKws7C663L4iwa5O/Hcjm0ddriLTdfVvrfxBZww4K9eQt6c4ZcZ4qcDQuhBN8JzCxjfgTZmaF/1aU5GRMP6fS1gOnDE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DS0PR12MB7900.namprd12.prod.outlook.com (2603:10b6:8:14e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 11:10:04 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.038; Thu, 23 Mar 2023 11:10:04 +0000 Message-ID: <56a59376-8303-e315-3ea9-e5b359416156@amd.com> Date: Thu, 23 Mar 2023 11:09:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2] app/testpmd: fix wrong encap/decap size calculation Content-Language: en-US To: Ori Kam , Michael Baum , "dev@dpdk.org" Cc: Aman Singh , Yuying Zhang , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , "stable@dpdk.org" References: <20230316171654.1827514-1-michaelba@nvidia.com> <20230316182412.1831799-1-michaelba@nvidia.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0052.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS0PR12MB7900:EE_ X-MS-Office365-Filtering-Correlation-Id: fec374c8-357b-447b-6724-08db2b8f2711 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZkE5frqaBnWXa6YlkW6vW0siOhzR/if8f1ruIgwD5o/gKN3hkVMpNekQraqUzFppAUT40YKzz0zfZ2jlKD9+YvEZsXJcdXxFWFd/EX1lamSJfwMUI1uJ1GQ2ED8zT4IwHHSF24bDUtURWGjvImGvMe8lc8MvvQ+wdXs/NnC2HDnWhzmisQmOrMvPkLGI2FhfpsF+BOb7+McFJlwxUqf2GllSYaEfoWs7wSiScdsCXTi5m2mj8tCI0U+zvVdvvmjEc2x34meYJb/xU3OINrJDdHv4PWgL6guzJ+Fin868QfRHLcku8g3o3pmMe0ZLxqEFGYoNUBOuMFDRbEnL2GW1xG1rvuL/6jMHBLQfXLNw2LQw1dvabJh69v81LvdOywYfsJggTMo36JtIxCs8tn5JXW0Io98KGZTKAzqfHCkVkRt7x3nGHKWLMmdc7rz3KiTGVv5mTUgil3W0zUOq98F0q8RMzZQTAUtModTZx2YXE9orp/ob8iD+VB8flSrr0JowJTwUnub6IgeyH/Y7DseRF4aXfpSFyvECkmw6KbmuOaA8Xxyhx64INyqchEQKTUx5I4xIH5XkoJ8dMc4XBfULEMyBSK6WMTP3OnGJIpP4BQF/ANph1h1OengCYxNfdoilzIkPwk4SZyyyiX/DIqo6aAEZIeFFxY/NZjuwvhJqevPRsRCgx042XHj2FbECmBaNG1KcOW22MJf/JrmwdFYQhsVyVgTtoI5+ccdC1u71+5U= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(396003)(136003)(39860400002)(366004)(346002)(376002)(451199018)(31686004)(38100700002)(2906002)(478600001)(83380400001)(6486002)(2616005)(186003)(36756003)(31696002)(86362001)(316002)(54906003)(110136005)(66556008)(66476007)(8676002)(66946007)(4326008)(8936002)(6666004)(26005)(53546011)(6512007)(6506007)(44832011)(5660300002)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RjhreEhONXBMaXVxcUFQUkFVeFFUNmxuRWxHY24xVTRTQjhodXhPb0NvOEw2?= =?utf-8?B?RE5sVjUveFYvYjQ1WFdNMi9mUFdIUjJzZU9FQ1NPcFVpU3RRWEszNHBFRkNu?= =?utf-8?B?NTJSUGZRcEVETnIxR0F1RFU1T2U3ZkZTai83MXN4OEd6T3NrOEZUdWpsMnJs?= =?utf-8?B?M1ppcjlDaHBqQW1pMmVhbityTCsvY0JlZFJScU42QmZ3WTg3NzUxUUVHbGlr?= =?utf-8?B?SWdqM1pGeHFjM1U4NjE4TGx5b1RQYTZxMWFsZVJlemFzVDZ2S2NrVEhsSDdT?= =?utf-8?B?V1N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f-8?Q?SO84ntkvFH4ptS6MTrptXqfe+?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: fec374c8-357b-447b-6724-08db2b8f2711 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 11:10:04.0701 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wBULkkay1lb+nR3v/sVizK08Iilo803Yf+0ad9+XkGNSKYjMzZVMbZd96eZ9U2MW X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7900 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 3/23/2023 10:34 AM, Ori Kam wrote: > Hi Michael, > >> -----Original Message----- >> From: Michael Baum >> Sent: Thursday, 16 March 2023 20:24 >> >> Testpmd app has some functions to create either encap or decap buffer >> for some special cases: >> - "l2_encap" and "l2_decap" >> - "mplsogre_encap" and "mplsogre_decap" >> - "mplsoudp_encap" and "mplsoudp_decap" >> >> The functions use both "rte_flow_item_eth" and "rte_flow_item_vlan" >> structures to represent the headers and copy them into "raw_encap" >> action. The size of either "raw_encap" or "raw_decap" is calculated as >> sum of headers size. >> >> However, the both "rte_flow_item_eth" and "rte_flow_item_vlan" contain >> more fields than original headers, so using them cause bad size >> calculation. >> >> This patch uses "rte_ether_hdr" and "rte_vlan_hdr" structures for header >> size calculation. >> >> Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation") >> Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") >> Cc: orika@nvidia.com >> Cc: stable@dpdk.org >> >> Signed-off-by: Michael Baum >> --- >> > > Acked-by: Ori Kam > Acked-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.