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 5F4E242E46; Tue, 11 Jul 2023 15:37:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB38540A7D; Tue, 11 Jul 2023 15:37:47 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2045.outbound.protection.outlook.com [40.107.212.45]) by mails.dpdk.org (Postfix) with ESMTP id 65B8A4003C for ; Tue, 11 Jul 2023 15:37:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+0DlrpxdnwbBf/c74fAkAjv1w6Vg450vXnYxgMfta0EzCcM1DDLsnRfshSkKGs22tIEIRsuWb2Gao3oWIhpAIP+/iDUwdVpBkC6EJyromHVcyftRsLUXe00IpmHFrqZ3SBKR4RkSzw57ATSUGr8O670GWbFt/Q5zHcOV9NG3tdtJ9Oboqw6TzaUcZY1s+CJ/92XYgcmsofHK3EtyL3EQ1E63i6tsEqeuwoeF50+IeQW7scAReckL99mgoPCpSdvjRdg4qUZNXNPXeEPWfcUuDzRxltaBzAcAQzGXAFoY/tpkNs6Q1x66IbHWUd6luE1cDw7Ea0Kj5BBcE3dYEujMg== 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=0cd7tbEDo6lpTfp9HXtC3pnvDxK9q/Of8U5eHZ+wZUI=; b=nivc0WvxUyku9odSQ8VhlZ0xspfuUYaUiOLP2QF2nANEa5eBq1Ak5oPeCmNHyVnhia0eORnIyNxEkG//OqoN8dyE8b2rL0XvBxFzjDeR2DJ6CF7NRQiUXDhm0le64kigC8wCCCC8U1pHoUG3BNvdNZbGglCoIPEsZLP6Q7At+N6B88zQPEsjVaMU/dSEgoG6OkAZycO3JYBMirJRerRePmgfYvrKu06TWDHPv7/dtVL5NHWj7u5VVvpKzWD8hTOPq83/aUwY4/3gggrqDtCnxOUtEYPJ3FTf6VaatRuawHq0h89NWmdv52J3UWbkknkutxhKDspX3tuISbmbkWS+rw== 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=0cd7tbEDo6lpTfp9HXtC3pnvDxK9q/Of8U5eHZ+wZUI=; b=zr90wfy8gxjLFFXkliurTHH+dwUv2c5+djBPidNh6Sdzf2W0zO2oz4paSEOAslND+BN1fJsjw3TexHbgf4AlCYQiBciYf/IDDAiPEK4mfOALDpOuwJ6/M4L3YA0JhtSHCR+awylafSTB7I6Vi6kRApkrNaxk1E8O+vzICAnaOnE= 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 SN7PR12MB8148.namprd12.prod.outlook.com (2603:10b6:806:351::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Tue, 11 Jul 2023 13:37:43 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::369d:5f05:aaba:ebd8]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::369d:5f05:aaba:ebd8%3]) with mapi id 15.20.6565.028; Tue, 11 Jul 2023 13:37:43 +0000 Message-ID: <4bebf81e-11e5-aa86-4140-8e4f8c667d52@amd.com> Date: Tue, 11 Jul 2023 14:37:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] lib/ethdev: sanity check on callback before resource allocation Content-Language: en-US To: fengchengwen , Kaiyu Zhang , thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org References: <20230711011809.96677-1-squirrel.prog@gmail.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0190.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:311::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB8148:EE_ X-MS-Office365-Filtering-Correlation-Id: 47f5e708-2f35-4ed6-2be5-08db82140113 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0j9uZgKHnvTDHJSfgEpCaYg1DDCdgX0+aK7jvSmCvTWqF7Hf9Cb+C3E8MLeZgfyTeS+zpBqT1UhRiLxJAbetaPcNMRjAa9A0pEhK5RzNUKGR/AI5dKrhgrfHlUksSqXMnk4r2nXNMnztVCnpiXFY4F38guh73bvdBt0tR3yflGph3VORJLEuUc3+vZrzCgKrhOGESLugY+5msuPn4UjmGBxIKeaelzZTVzq4NaE7uPG5defkRl9UHED86F8J4zPGe/7dK3hsd1ByvFmnpW9lEYq6ZwpQi/kzD1Y43bfflTcMWXuFQHBYowR2ZnUptLfYG28et/rMSXycyV3KDMr07yIoUIIFnukLJu91lyqO4zK0p7ocBBbR6hLDZjGA/Q78QUuHGkbyMg3B1CreVTTVsDtUuXcJhrXHmYqWDm5fqXz4j5tvlnJZkVzIHYuCfP9vA3/SbflnCj6Jd8qeKSTZhQU/gE3WuHP8Lp5/gbNXCzj5veDl3omzdayB/rU4niTQjDX65lCbofbbIHoPughqBx6urxNEPnCPJCOzMevEmbbv2c7amALDg+NeNmqkkOWx0xbstbZUdjofdRI2IoeBlxJQJQTepgzQUQLNOTq63wg2SKWVLK4p7OgtEr4wE8Kf6j7R/44izBlegCQzpZ6Deg== 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:(13230028)(4636009)(396003)(346002)(366004)(39860400002)(376002)(136003)(451199021)(38100700002)(86362001)(31696002)(31686004)(36756003)(6666004)(110136005)(6486002)(26005)(6506007)(186003)(6512007)(53546011)(478600001)(2616005)(2906002)(316002)(66556008)(5660300002)(66946007)(66476007)(8936002)(8676002)(4744005)(44832011)(4326008)(41300700001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eDdNazlnQ3VNWU85eThhUkIxMzVIZ0plUUVabFhQdUd0enE0Q3JjclJEVk5L?= =?utf-8?B?anRaeEhpVVhROUt5aldMWVdoUytlS2QwMEF1UHJLcytVTXV6UFNnVmEyanV5?= =?utf-8?B?Yk1aa1dxenR3TVp6QnBnTmdoaTVGSUZudFQyNFQ5NU5mdHlBNU9lUTlkY1VJ?= =?utf-8?B?WnU0aHhjOTJjYThNOW9qVkR5QTFVaE5Yc1VvLzdIZXpWSDFzSFVYcXorelAz?= =?utf-8?B?M0E0TCt0MUYzSWI1Q25RcHpYYkF5d1lVZTlJWWxBNE9rTUhqTmxYSk9sS3dM?= =?utf-8?B?QXpQSlZmaHFOSWRqQ3BjWVZNNGJYM3h6R2dSVTlqcXF1RUp0VEZxcDNnWWdx?= =?utf-8?B?bWFZVkd2UUdlazJQb1NMaUJob2xoelZvaFROQ21jRVF3THNxM0dSbzFXbTY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ange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2023 13:37:43.4350 (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: N46j6asaGWElQCqc+tMYRmsh02bz1ZiidS7FszzJnIpnOzZCwfjcHtGBUWrBjAsP X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8148 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 7/11/2023 2:48 AM, fengchengwen wrote: > On 2023/7/11 9:18, Kaiyu Zhang wrote: >> sanity check is performed after a rte_eth_dev object is allocated. >> The object is not freed if the check fails, though in the current >> reality this never happens, but it's better programming paradigm >> to move the quick check up front to the start of >> rte_eth_dev_pci_generic_probe. >> >> Signed-off-by: Kaiyu Zhang >> > > Reviewed-by: Chengwen Feng > Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers") Cc: stable@dpdk.org Reviewed-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.