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 80ADF43B78; Thu, 22 Feb 2024 16:54:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0CCCB40281; Thu, 22 Feb 2024 16:54:12 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id C4D144027F; Thu, 22 Feb 2024 16:54:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EIpaBWw1r6JRQOxkoqUgODgmM21gDT4c/YwH8zZf22v0ZijNMnMUv1srTaz6PdzHN/hot3zRpt8/jZx8fUCjdKdGggZackF9Yu9ZhYOXoHhjNlMnCkwPhV5YIh4uKIbV0yuaVTHOhPBw9YrKVZPxCdRBlhqnEzeurzvrsLsNkjZYaN5eR0WwGpXOkhDsmoY+SrMMV/FdYXdVQKjqJh9FH+vTcmRDPVRNjiDaxbiQvLqyKyDXR1ZW+D/CbOMPJNH7wKKhFFr8j8DAYrMJpwxDBaKH2kB7La9PRYcanpWb7FOjF2KPFFbpn621/i/YnsfV0knXzzc7Mji9tS/XSkSWLw== 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=brGf5R5PX2OyYfHvLFQwY5OGxkCbM5rXTSMtTW0h154=; b=i79tLQWfkXvTM78koQnBjuMhPAWeU4Et8oi3lTbJLXeumCb2w76cUVIrTotP89iMo4ug3WZ2vkgqPWrnjd3C7wqEhVyfBJsyr0I4PwwKHQBiP+CXloHEcLB/oiokB/er4eb5kvUQsJdCPOnhCL6QaeGIXd3bh+vPY+LC1ZiwRUCOnHU4eSF1Pxj8uETg/V5V8lF0P1208alMCh6c1xk58OwN/dXVq3fEMARrr0nT2e49GcWfi1SnBYgcQ37hbWtGygsyq0ts2s9Sgjenle/0JQt08SuUIGp8uYUHv+/vdHrSa+Jv+6b2x//J9Lg5jKsD2qJWpo/F0ozMXy8W/61uYA== 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=brGf5R5PX2OyYfHvLFQwY5OGxkCbM5rXTSMtTW0h154=; b=ACWJVACC1Dc2lrEkfLa6puGHzP8pZkAbpzHwYjCVTtqzOpeAq4vDiJx9wk39KzUNsgebtnQn29GjBpTa6VjIjWNGTUyfQapV3kj6GYw+gdBYDa0TRvzj3KX54ahVyCugvtUQeB03Kp+1utdWNaV3emYPntHAj7WbrY7R2GQp2BE= 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 MW3PR12MB4571.namprd12.prod.outlook.com (2603:10b6:303:5c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.22; Thu, 22 Feb 2024 15:54:08 +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.7316.018; Thu, 22 Feb 2024 15:54:08 +0000 Message-ID: <8209b3f9-92a0-4bf4-bab3-b9e7920583d7@amd.com> Date: Thu, 22 Feb 2024 15:54:04 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] net/af_xdp: fix resources leak when xsk configure fails Content-Language: en-US To: Yunjian Wang , dev@dpdk.org Cc: ciara.loftus@intel.com, xudingke@huawei.com, stable@dpdk.org References: <1708571262-48380-1-git-send-email-wangyunjian@huawei.com> <1708608939-14440-1-git-send-email-wangyunjian@huawei.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 AQIeAQIXgAIZARYhBEm7aYjps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FCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <1708608939-14440-1-git-send-email-wangyunjian@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0582.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW3PR12MB4571:EE_ X-MS-Office365-Filtering-Correlation-Id: caa4344a-64ae-4d5c-753d-08dc33be814a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UYr14HMvNZgBS4tnM2EpcQOx58cqX5GSYHSELf5CBBd2/7ROQIHVAaCi6wvvZfu2UffNAi+yeIyneCAGJRtwIbmYKLpe9OsfcXaV1822ZuBwAeF7n72c07DiVZZdi4IPSJfqf3d8ttg+dxmzPP02sMhPBshC9vIp4B4pysx5V6pZLDB/7qjmlBXE4Zw4ie5mn9YFj4C7dTQhxIKDZwp72uuvAr2/6V4qYAwzqTN5TFkcMhDh278l2Zl5MbqGGDu0yvrWlHODOEDDvvWDRHdwqmATEFoKTl0zDKpywKUbaTvs9j8nia7hyZg5ZSLGJDBqQsphPQYh59UHWD8eXQ7N6MnKm5rFNB/qPi2tQR2DowgdaPKQAUE9e/P0BXqa9A8jDhmIzeIhVz0qJdEPLEGCFSSoYHBvctpqI6vFkKALc/fQ4gPEULkFla3TH3XK97clSCV3ao5/j5CFWOb/fbTuVPohCqbdyHW0t9D/7gAQw8uy8SYVxtbkgSxt3wWYJIak0FtoByCZC0rIWdRO/xi2jTj3FdxGI476tSvybEPMaT4= 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); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S005QlhRdkxTZ0lMTzcrbFV5Z00yRG85dWxYVFRWVUlGVG9RWTYyQ05aYTNn?= =?utf-8?B?cVcvai9Nc3JjaGgrMm8wSG9yZG01R0todld0bTdmZHpkRnRVbDJHYUx3OTQw?= =?utf-8?B?VlIweENwUVVRMk5WR21vbDJ5T2ZwcGU2dXhqbXhXdHBTcWV3Zm1URWttU0Jo?= =?utf-8?B?SWtmWHRnaXV1OG5kUktlWC84TFJla2w5UGxFMURjbDRPblR1MTFZSHRDZFM4?= =?utf-8?B?NnVadVV4bXBnRjZobitrRU95Q3JNaVM4M0lKVmlzcVhNTkhKeU54UTRIK01z?= =?utf-8?B?TjB5bkp5OXlSR1VVZXBXM3ZxRE14dHoxOWgrMEUzWUxlRlZWYkMyRXhwSDZ1?= =?utf-8?B?blBmbTFVeDVWS3RLL1l6VmF4ZWdHZTMwQjZPSnVHeEhrRytLUjVsNEUxb2Rn?= =?utf-8?B?Z0N2SWw0NEZ6dmdySnFmN0xuYVVQTmoyOUdHVnI1OEJObDV3SCtZT0U5Zis2?= =?utf-8?B?S0JCQkRpTWNmL2UzTis0R2t6VWJ2bnhwVVpvR05XNXk4dDZHREZpREJLdGxI?= =?utf-8?B?SE5JMnlqaVh1ZlZ6Q3JGdzgrZ2psNmtTcVB6cHBYVzd0MjZOaGNnRDN2Tmpp?= =?utf-8?B?OHlhazkwL09hcHZaR1JTcmtwRVBBMjJMM3pDZ1hJY0ZzM3QyWThzZ2RjLzZw?= =?utf-8?B?VzNMNEg3R0EvWXlnWXZBenhKWlg3SFdSV0RuNUk5cjd0akpUNnpxbjBFbURz?= =?utf-8?B?R21rYTJjUy9VNklMTTRQbEMzUVBzcWtyUnR2dTdRazlldTZlckh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b2FSZnpleDNvb0ZpMTMyOStjOHdC?= =?utf-8?B?SXhtTkdJdTlKOTNhRndwYjMwYXRNbU5wN1gvclAxclpxWXFDdDVoaXA5Ulgx?= =?utf-8?B?ekg1UGkvS1FEZDlyeklLV1N5eDFjaklMZWdOVDZmb2NsRjFUdjl1NWViREFp?= =?utf-8?B?aS9uNld1T2M1SFY1MjBTUThHZG5vRVpuMVF5YjE0RmRqdlBWUnpXcjFRMzdz?= =?utf-8?B?TEJSTi9uS1dDdDRNSUp1VzBBMXQ5emVIUDQwRXRMNDNxc29wdE5heTZleHNB?= =?utf-8?B?NlpKeWxjYmt4dmZ5T3pOaWlaZGRLaEtqYjhOamRIVms0dFlMQVdreFN4Yloz?= =?utf-8?B?eTdoSTZMWUVIWnJQcDJyeWhXNUU5SWZzZjN5K0xsak1yVHpKNnlsU210TitT?= =?utf-8?B?ZVJ2UndkMmg2b3hOb2k5K013aDhzeElmcFVxRkpTWTg0ZWFhbGREWEpXKzdP?= =?utf-8?Q?KLdXf0jqeidiKLXifQrJoOwxa?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: caa4344a-64ae-4d5c-753d-08dc33be814a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 15:54:08.7631 (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: ROxpV6cvP7aA6O5w5U6QC6nXHZ7yVLyFUWXHXkmqIk/vWnoDdwYkkfvwCdFT8hES X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4571 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/22/2024 1:35 PM, Yunjian Wang wrote: > In xdp_umem_configure() allocated some resources for the > xsk umem, we should delete them when xsk configure fails, > otherwise it will lead to resources leak. > > Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") > Cc: stable@dpdk.org > > Signed-off-by: Yunjian Wang > --- > v2: update code style as suggested by Maryam Tahhan > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c > index 2d151e45c7..b52513bd7e 100644 > --- a/drivers/net/af_xdp/rte_eth_af_xdp.c > +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c > @@ -960,6 +960,11 @@ remove_xdp_program(struct pmd_internals *internals) > static void > xdp_umem_destroy(struct xsk_umem_info *umem) > { > + if (umem->umem) { > + (void)xsk_umem__delete(umem->umem); > + umem->umem = NULL; > + } > + > NULL check can be eliminted, 'xsk_umem__delete()' already doing it