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 2030243CED for ; Tue, 19 Mar 2024 15:21:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 182DF40298; Tue, 19 Mar 2024 15:21:01 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2120.outbound.protection.outlook.com [40.107.223.120]) by mails.dpdk.org (Postfix) with ESMTP id 7E57C40041; Tue, 19 Mar 2024 15:20:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GAM6Hi75g6pGlv4+DJll6bkw7aAdLuB9k2ynLZWNTz63s7aa8BjvVSPO9Me0QrxRBUo9+KtV8nbOK5bMEtWDS5RDLUWCg1OnxXQaFttmFs4AcVn55lt7OhdYgKzwEVfExvKJlG3xUwfAbjUSn0yZXTWIsPLq6SMFHnfYsH+qcA6kkYJ5335yfaxMQ6QJLUgVapwCklyrDNaIExAz6948Jwv2SVpLFYVOLI5V5IdKi0I94N8nQKhvBrUqOxX0qGGXLESn1y1ooMUiu0avix4Q1B0G5aj+bAnN5lTQkgNytEKIFF+XEUVdCVIxQz+TXI29kiYcqkYoFol+vy8pvHSizg== 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=2B7J9h8KsZEDDQl3H2u4bsWkuFVOYR7nIzv75YBwOY0=; b=An92HwUH/HI++iq6Ux3qpxHVv9Fc8EfwdC2XzKk6/jHuDVQ5HrJph5K4A2AjvE7CogMWsYfDH2Jw6Hw2ZUDUwpPBA9Lf5jC3z/XWqrsdcPQYqvidi3bJ+zo6pdAIAYk+WGgPQYu2bYBjR1zXOi+Ju4fJEEUX91Z9Hcw0l3L6aWvWlLGQq9vg46EclzHwHqIwTtzgqWnbYuouKXCVEBr0kZbkiDTuZTAO5Y7q5BZMTwjmNVOTQhyu90JWU5ci+2rjZg2z7optSFUP5oP/oMUANEq7UW1z6S3Qrio2DNCLnT9VbNSTKtOGBr/zZM+3O/fPg1tUdNFPUDNoUfsQfZtLFA== 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=2B7J9h8KsZEDDQl3H2u4bsWkuFVOYR7nIzv75YBwOY0=; b=ThjI25suH3bc8yOuS/nK9BhEyLoRDDAhosa15bwSnV1L75DMACzDEKxwBHFn9UlHGQoxoe+yH/ImX+9j6LhTunAHB1JxeR1/pkJ5Twnv+OQv+T3PfenS+uigu4jaZfcS1SIur8EUN+y+wP+2xQYGLuFijKQkXP3GDIk4N9bsoHU= Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM3PR12MB9413.namprd12.prod.outlook.com (2603:10b6:8:1af::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.30; Tue, 19 Mar 2024 14:20:56 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529%5]) with mapi id 15.20.7386.025; Tue, 19 Mar 2024 14:20:56 +0000 Message-ID: Date: Tue, 19 Mar 2024 14:20:51 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/testpmd: fix releasing action handle flush memory Content-Language: en-US To: Bing Zhao , dmitry.kozliuk@gmail.com, dev@dpdk.org Cc: aman.deep.singh@intel.com, yuying.zhang@intel.com, matan@nvidia.com, stable@dpdk.org, Dariusz Sosnowski References: <20240319093249.307606-1-bingz@nvidia.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp49aIUhkR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In-Reply-To: <20240319093249.307606-1-bingz@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0090.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::23) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM3PR12MB9413:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yJIwjGfMzbVfftYX45DlaDQMbnjs3lGsKXzqTJgnKe9WW8LmqmPwzYhGpG2u6DU5+u5NP+Uwus0R5IbPwr4yKDAMZEJIqx3LyzHwFDSwpirTIgdDzvQKslWncY7WIqPk1su+BOYTGFJq+5Z0w/a0HIj5eD1GLjH6FfWlMWxYUQnDqsc86knuFrYID0+lUl+yx/N+AuoWv/IcanYkej5OxskKoPZZtqsKiD6fZMcYwlz/8XUdR8yy8aRIKAK4Xat80nIOyhYFU4NoGsZXFk08d97ATvbqWApiJlqKot+scpgEA68gBTKFQSkYteTxwmOeLZST/B+Py9bsnJgc0UZamPHbmoKm5OgCWne2KIjksPzckb415YrS1MACy9DRnTpfH0v5No1re+2Lwi+oHLB0LW/AtHXqHDHIalj8o5i1Thbnhsb2weTZx1dci2E/6zto65a/aexrYXHOsqlB1UBCI+6dYJ68rXZNf/ptD9esxiKXN/jP08TY9BJigL2gWwjHTpBdQ7kkJ1AJv28UUhxWFky8qf01DzenDT17op2mQPP7a/5lfIa7ZY1K9APbdMeVftjf6VcESe1F1FKg+kptGcMgdTpc/rfsnpRirt6ytQsV3dBZw7XY6LM3RGyN+VuZa5CUvrY8lPqYN42+t5D6ikXCc0T9ytRh/osQbsCYlUg= 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:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cmk2Z1dHbjRmaGhiejdDTGxqQzhlRFl1MGVFSmRVTUtvajV4RmZ3TUhtUDlN?= =?utf-8?B?MU1SaDMwYzdzZlFySlp4akFZeDV0eVhkTEhVT2RJTzAxY2tDZDlIZU1jbW9G?= =?utf-8?B?bVJxb1FyaG16SFdmNzRUZjM2VWFwYStraWRtVXpLNytORVpzN1NvODFCUFgr?= =?utf-8?B?UWlaYTQwQjIvTi9BbnF4b1REZy9ENTdnTDFPWDE0cnVRVWNuS0p3MFVzTWRv?= =?utf-8?B?RXBuYjBtRytmbFk3TmVHQmtwRzBTb0Z5Tk5rUlpsNmR2RFJ3ZHF2Z0U4YVJm?= =?utf-8?B?UWJ0ZE9GS210bi9ZeW9sQmF1dTRMUHpKaE1LZ3cybHF1dURkN3dsSXlDK1l6?= =?utf-8?B?T3BGNUZvRkRYZ3BsdElLZU5pdUxqMHM3enNGQXR1ZHA5OEtvbU9neFRXWVM5?= =?utf-8?B?YU1FTm9LSW9PYWhYaVRGb2N5TmFXRU1LWEVPUnppZnlramhRMVMyK2RUM0VB?= =?utf-8?B?NEpwUGh4RjJneml3OUJCUjBIUTFEVURJb0hmTzhqV0NENGh5S1Uybm90aERR?= =?utf-8?B?UWlTcGNiNDZBdHBncmpRZEJlNmVZdFJPQUFnWGg2VGFNKzAxSEtPOGJONWMx?= =?utf-8?B?akRmOS9nRzJweVJiUTd6ZlFER2ZYMm95SEpPN1FQamV6TTZrT0ZFTlhkZjZn?= =?utf-8?B?aDhOTWE5QnNDc01rdFYyelBWOThxQjFlZy9nbHB1SDlkd2IvVkJ5VVl3aDhw?= =?utf-8?B?UG1wMDI1WkdZejFwMHVBdHdYTzcyVkJlY1dFTnVEMElwQlJw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FNzcWRma2lZZ05EWTVOWTVEcWFIWSs5Zk1LSTBHZi9PSUlCMWIz?= =?utf-8?B?Vko4M1BBbUFCU0hNL2o5S09meHJyYzFseEJaVW9KZXY3TkRJaW5EM2pBdjBj?= =?utf-8?B?ck5uU3UyWFZvUDdONWkvbzRFRUJ3bEVESG5wSUxvOU5rUTZ3V3lWM3FvYjhn?= =?utf-8?B?QUVPZUJkdFExSWZrUjQ4d3FKa29xZEF3bDQyRS9LUTh2Q21kRTZidkVNWFU3?= =?utf-8?B?cU5BNjJoVTQ1aWg4bnhtTHhuU1VIWFczdXc4YURIRTFmalQzZ1dHMmY4bXo5?= =?utf-8?B?NC9QK0VHZmVRTnd6cHYzdDFvM2lLalo2MXA2WTUzbHN1Vjkvb21PM2tidFI1?= =?utf-8?B?N3dXeVNGYVB4UEtsanRZekpMN3ZLUll1b0dRZlIyYVB6NlFIRERQQ1BYRDZQ?= =?utf-8?B?VzJPSjNOaG9QT1N4blN4YTd5VS8ybndWWnRaVWVIYTR2SDQvODRSWkVCNFVh?= =?utf-8?Q?tABsE+n+olpp45vwO+s/vP6Cj?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e52f3db8-db87-41d9-63da-08dc481fcaaf X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 14:20:56.4164 (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: e8vGL4r4Lwgp5RfTAqnJ6AC/1xnozAUKKqgoV4PX1MLu1fljYl4DlsUMXDjR20rc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9413 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 On 3/19/2024 9:32 AM, Bing Zhao wrote: > The memory of the indirect action handles should be freed after > being destroyed in the flush. The behavior needs to be consistent > with the single handle destroy. > > Or else, there will be some unexpected error when the action handle > is destroyed for the 2nd time, for example, the port needs to be > closed again. > Ports can be closed only once, so above reasoning is not valid, but I assume the purpose of this patch is to prevent memory leak, can you please clarify the problem and impact of the patch in commit log? Also what is "single handle destroy" mentioned above? The fixed commit is from a few release ago, so this is not something introduced in this release, do you think can this wait next release instead of merging for -rc4 which is more risky? > Fixes: f7352c176bbf ("app/testpmd: fix use of indirect action after port close") > Cc: dmitry.kozliuk@gmail.com > Cc: stable@dpdk.org > > Signed-off-by: Bing Zhao > Reviewed-by: Dariusz Sosnowski > --- > app/test-pmd/config.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index ba1007ace6..f62ba90c87 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -1918,8 +1918,7 @@ port_action_handle_flush(portid_t port_id) > /* Poisoning to make sure PMDs update it in case of error. */ > memset(&error, 0x44, sizeof(error)); > if (pia->handle != NULL) { > - ret = pia->type == > - RTE_FLOW_ACTION_TYPE_INDIRECT_LIST ? > + ret = pia->type == RTE_FLOW_ACTION_TYPE_INDIRECT_LIST ? > rte_flow_action_list_handle_destroy > (port_id, pia->list_handle, &error) : > rte_flow_action_handle_destroy > @@ -1929,11 +1928,9 @@ port_action_handle_flush(portid_t port_id) > pia->id); > ret = port_flow_complain(&error); > } > - tmp = &pia->next; > - } else { > - *tmp = pia->next; > - free(pia); > } > + *tmp = pia->next; > + free(pia); > } > return ret; > }