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 E8516A04A6; Thu, 27 Jan 2022 13:33:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6879842786; Thu, 27 Jan 2022 13:33:56 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 91CC94067C; Thu, 27 Jan 2022 13:33:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643286835; x=1674822835; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=0DOf+RvM5NEtPk/PtU4IBZhGpQXxoNbmRLhsFH5Z0oM=; b=YPwfdnX5kq9Z+wE3zIvPigQEC4tzxhmSt/CDpLuHP42u9Hgkq+MnN7o/ ik3WCT1K/pYvIQXZwaVC+I2GmDhXguGjgMn6AtFa0lhZvAbkEHbW2Ux/Z 0jTpZ7nWchmkJfTmh+wM8VRS3upw3c7EhhnS0TaMwDe77rAVMh1fM/MZ/ AK+FkmFXEczQL5yImR1qGGZLX51IvJwpJVSfs6wkK04aArw9qmTBJ1igb 1F1inJEupU8kzbzQfd80V7MMDSIdpPeijyIyYeExj5/ArD8rOuVz/gxkx rHZ0XWZHMthiKnwaQMjJqbtCXEaKG0maKolMiso+j+DShYUAVvFAR+lCT A==; X-IronPort-AV: E=McAfee;i="6200,9189,10239"; a="227508539" X-IronPort-AV: E=Sophos;i="5.88,320,1635231600"; d="scan'208";a="227508539" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2022 04:33:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,320,1635231600"; d="scan'208";a="618313367" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by FMSMGA003.fm.intel.com with ESMTP; 27 Jan 2022 04:33:52 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 27 Jan 2022 04:33:51 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 27 Jan 2022 04:33:51 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 27 Jan 2022 04:33:51 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) 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; Thu, 27 Jan 2022 04:33:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hQyzq6peFvuoUCO8GFIMsjX6JQDampU1UbxZiIVbZMFeKo6KXZa2D2A0+nPjbnehgAz6Uh7eoGMuWCoIjYKplX1GB16zWAv8ByvtOSohTjqkyymuX/f9u7ixXssrY6Hu6oHCtx8klI38SCRrMSAtQyqsewwgqAUvCK5s4EPxkGL7xlOQ1izs3pkSpAMW0fB48ZD2849wqvSL5sK2QEG7DgCbmJWWjMRb6Nb5mKcRq7MQfzoypQOeS1I00rMGWOmEwG01SVHchuTiWKngtdB1sTy6t+a+HoeMUtdwDJpJdMoZVBcAVtQG+f9D2rWW9bJTe4EGWFp2LSHd5h4i76g+Pg== 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=bLMfcD+oh2Ya5krxzXSLH6K3vDkLQGCXgC/uV6sXbjg=; b=Qp9/UBtEVUa6TS0vvIrGsoMYW02JLZJ0VV2yL2y6cNIoC8t5urY8xWxFlEgU3N9FFtGTKoZVevxvjkAnyyl3eO8fASNR2hpH1F2cXdifpCEB4Z6txdCUOrGLlOslhA5ix2iEAPQErpwUl91xwWMjd9q83T+8thtx4ZnIxY9dE24tL6jJ2qfYfnfKadyBnrzFTT5TxPWwuSET4TmdrRf4hDLOtbuCanDaSDBqvnqsZtb785u5KWtoRDfIqOGMY0ndpo7aX/lLYGs4mqVfUq9wJK2mY+FjvrfslTExWo8PsavmdDhxlUPUjWlJ25yGud2R/blkFxaXG0AizlJvxOFEfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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 CY4PR1101MB2326.namprd11.prod.outlook.com (2603:10b6:903:b3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Thu, 27 Jan 2022 12:33:45 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4930.017; Thu, 27 Jan 2022 12:33:44 +0000 Message-ID: Date: Thu, 27 Jan 2022 12:33:38 +0000 Subject: Re: [PATCH v1] raw/ifpga: fix ifpga devices cleanup function Content-Language: en-US To: "Huang, Wei" , "dev@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" , "Nipun Gupta" , Hemant Agrawal CC: "stable@dpdk.org" , "Zhang, Tianfei" References: <20220126032953.24695-1-wei.huang@intel.com> <26fd3861-0f61-9ea9-e3a9-1172cddc5e60@intel.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB7PR05CA0017.eurprd05.prod.outlook.com (2603:10a6:10:36::30) 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: 0c2edbcb-4db3-4c49-3f3c-08d9e1914229 X-MS-TrafficTypeDiagnostic: CY4PR1101MB2326:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +VpaVJO+IoFq5u+HaLAULJIEP8jlchPtzRYSvQqcr4uPz+uOxv5oScepbn2CWDSyqPOIkdOqwomAOfSMxy8G1jxplB/jLSAE2JzBtJuOFdxO/+5nlBgaptcOocAiYFDJwJnZ971GhXoZtP8m0TgK0Gwz6hQVuXDZR7LTO3mKVXShZcD+8vVdVgLvLcU6I2My/412xwI9PlQTpHoykHgrV60KeRpUf0jJ0HT1IeUBIGZGmyVSqGMprNwvRIUidnip/Z5qi5HwfDfKaJQb9CPf0occ7E1PT97yU2Pmi/GQSflFINUjaOPjEHx13IeKlMLrXCpr1qduJwIUfeDn7nAXIPYmdDrBjVmirhH/umqmdUP/iQMBITxtsCr54frUpd+I+JTYswxKjIx3aESdXIerwQo7vUG/vVPBXepZj3OBCsNMQCSDE50mPY8SaGglqzGObj0kFYhvrG+UNib/IzjBufHHWQjNB92wo3IeIqdeF4zQ5vX0aHyrDZkwyXyGYuQKe/BG75H3T/a7AOeIxxOUMS+hYFwCddTKh9/oBpaT3NfaXTuseMB5Bo4MbrAYDNiKByc+zqGCYxHhno70BSB2pOjLC9iL8R3FLwbligIY7OT+hIMTP4PRb95tsq5IPItZnupVtrA4kn5wqqc9Q0/vVyE0Y0d3SN08akVWq8wB4zPfG8sTcaYbwX5gcl7myi3ox4XitPKC4YCCXBSjFstJHw== 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)(53546011)(6506007)(38100700002)(5660300002)(54906003)(44832011)(2906002)(86362001)(6486002)(508600001)(31686004)(82960400001)(2616005)(107886003)(6512007)(6666004)(83380400001)(26005)(186003)(66946007)(8936002)(8676002)(66556008)(66476007)(4326008)(110136005)(316002)(31696002)(36756003)(45980500001)(20210929001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cmNqenQzUkFxQUFudGw5NHMzelF3SEVJc0pvNFVyMW10Y0krNVRZMzgyaFlR?= =?utf-8?B?bVRvaEorcXBFeEVyV3Z6S0NWbHAvRDcrNVFpVTJmR3IwazBPeGRoRG8vTUhy?= =?utf-8?B?WmU5M2dMM2d0OVVWWS9TQ3VXeU9tSXRDS3lFOGpZcCtKR3hIYlhaSHVzSTVN?= =?utf-8?B?ejlaMUpERnpBTHhLUGJyQTluOFIyZ1VaQmtsbFlYSVNsMmhIakxoclFGc1l2?= =?utf-8?B?b2tEWnZHT2JMQ2E2SHFxYStlN3NTUlY0Rk1FSkltZWV4MVR0eVdrUnczL1V0?= =?utf-8?B?TGZBVTdDUHV1UThwRWZm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iVGIzTGRIT29q?= =?utf-8?B?ZFlQRE1OL3hhZTErWnJ0RFNKUExXODY5OFFiMmJhbE84RmtSYkdpYWQyMXUv?= =?utf-8?Q?wg3gy7HVVfMR6frebjLx2Mw=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0c2edbcb-4db3-4c49-3f3c-08d9e1914229 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 12:33:44.8642 (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: yuDlTN/z6H2KEDJ9Uf2y1igns2KqGe20uZqi77GaZ4yhz/T76nzrWVywRZwl0gm1vmdLcC353jBmT+pn7Mgobw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1101MB2326 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 1/27/2022 8:57 AM, Huang, Wei wrote: > Hi, > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Wednesday, January 26, 2022 21:25 >> To: Huang, Wei ; dev@dpdk.org; Xu, Rosen >> ; Zhang, Qi Z ; Nipun Gupta >> ; Hemant Agrawal >> Cc: stable@dpdk.org; Zhang, Tianfei >> Subject: Re: [PATCH v1] raw/ifpga: fix ifpga devices cleanup function >> >> On 1/26/2022 3:29 AM, Wei Huang wrote: >>> Use rte_dev_remove() to replace rte_rawdev_pmd_release() in >>> ifpga_rawdev_cleanup(), resources occupied by ifpga raw devices such >>> as threads can be released correctly. >>> >> >> As far as I understand you are fixing an issue that not all resources are >> released, is this correct? >> What are these not released resources? >> >> And 'rte_rawdev_pmd_release()' rawdev API seems intended to do the >> cleanup, is it expected that some resources are not freed after this call, or >> should we fix that API? >> If the device remove API needs to be used, what is the point of >> 'rte_rawdev_pmd_release()' API? >> >> cc'ed rawdev maintainers for comment. > > Yes, this patch is to release all the resources of ifpga_rawdev after testpmd exit, the not released resources are interrupt and thread. > > rte_rawdev_pmd_release implemented in ifpga_rawdev only release memory allocated by ifpga driver, that's the expected behavior. > > I think it's a simple and safe way to release resources completely by calling rte_dev_remove. > If device hot remove is better option, why 'rte_rawdev_pmd_release()' API exists? >> >>> Fixes: f724a802 ("raw/ifpga: add miscellaneous APIs") >>> >>> Signed-off-by: Wei Huang >>> --- >>> drivers/raw/ifpga/ifpga_rawdev.c | 4 +++- >>> 1 file changed, 3 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c >>> b/drivers/raw/ifpga/ifpga_rawdev.c >>> index fdf3c23..88c38aa 100644 >>> --- a/drivers/raw/ifpga/ifpga_rawdev.c >>> +++ b/drivers/raw/ifpga/ifpga_rawdev.c >>> @@ -1787,12 +1787,14 @@ int ifpga_rawdev_partial_reconfigure(struct >> rte_rawdev *dev, int port, >>> void ifpga_rawdev_cleanup(void) >>> { >>> struct ifpga_rawdev *dev; >>> + struct rte_rawdev *rdev; >>> unsigned int i; >>> >>> for (i = 0; i < IFPGA_RAWDEV_NUM; i++) { >>> dev = &ifpga_rawdevices[i]; >>> if (dev->rawdev) { >>> - rte_rawdev_pmd_release(dev->rawdev); >>> + rdev = dev->rawdev; >>> + rte_dev_remove(rdev->device); >>> dev->rawdev = NULL; >>> } >>> } >