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 7345B427DE; Mon, 20 Mar 2023 07:45:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1B5B427E9; Mon, 20 Mar 2023 07:45:12 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A1AB3406BC; Mon, 20 Mar 2023 07:45:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679294710; x=1710830710; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gv9uPQ0VFbxv4tFepUQ5m5Tq6Vya+OK6i376E+Zea7c=; b=UkcpHHBHESGTAOV1WSdknWYmlLNKFQ9Gs5huUCA8YF0YWh0S0jCOhucK WX1QV7G0iHXuNczZMvhb414987qoD9HN9MflLRpR1YpIVhxGnMGaNI95O PqFBkV/twi/Ya8XbkutXXYC7bDaCWRHoRg5RretTdLqsIpwRqAJ/bIVxq gIuw3qazPsykw0mGqy5pRO3VCWehjk+MdRZuCGDyIijP/tDzhVYLfGiGi yOrIoqyu1P95cBgbHioFK0wG0TngzjF8pI8RI3xkakV89sUfdRX+kx5EV ORcDtBuYsY11zELil5r8g7nmE02WjqILIkufBVMWwAh9Gg6nYG+RPeAfe Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="366303295" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="366303295" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 23:45:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="1010354058" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="1010354058" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 19 Mar 2023 23:45:09 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sun, 19 Mar 2023 23:45:08 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Sun, 19 Mar 2023 23:45:08 -0700 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.2507.21; Sun, 19 Mar 2023 23:45:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FxUeGZv1f5U/e1U0Cysr/omphQrB8gL6f1+fAuidgFIGRDRhobfNDdlZf2ygOZgOuh6yi4yYq9U6L5uhuHhkpfbLG1Ora/99bG4Kcu/0lbBf5cs/i24ttlGwx8PFBFAmia6GJ+1r5VwbciG1MdTQKAAYP845TOtb8+E+Ou2/2d2DdXOtyFnWA6aNR31ERmGYimCXnzai7zNBvr92nzO14LI4RKyM0azABX8TqB0tK3mDa0iMchAuiLJod+M/7YB8lCba90o1GZvCMRs46Dh8oRp9Hyf1mBjmBPShz056MtyN76ed3iRoneqOgmXVbyecRkmAX5H8EdUl/t4Ptz9KTg== 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=6DJ303PciFF+AuTKmJbM9+bYWuBZ/vU0+yAC3RhaW5c=; b=EsUFxfTik6RKVuZbhIcLmzPyoNWK93+M8kpVNqqS8jekv4/HRiIrTvSFRVG/8/9irhbVIwu+Mfa3DohKU9eGYgYpupfYPa486EfFNTLbI3KleACTcXXDj1oeGQ4G57vJkFccZ51Wo1SFkQ0MRLJY41Pvjup9kF4bWb0GrXp+zwufmCV1nKi+kr3LfVrJbMrq//mtvMv2LeHg2MVeaaiDvK00hrN4UEdR6/aLVZjCq+aDdya8wdtNr5OYf/0HhwilrQibRFq/Da2XDTdGRA7aPtod13wECYEacOsAF00KJTSuymBjwdKCLxjEE5+wJp69ei29ltSg+kVsjqGB0LilCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by BL3PR11MB6436.namprd11.prod.outlook.com (2603:10b6:208:3bc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Mon, 20 Mar 2023 06:45:03 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e%7]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 06:45:06 +0000 From: "Xu, Rosen" To: "Huang, Wei" , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "stable@dpdk.org" , "Zhang, Tianfei" , "Zhang, Qi Z" Subject: RE: [PATCH v1] bus/ifpga: add fpga bus cleanup Thread-Topic: [PATCH v1] bus/ifpga: add fpga bus cleanup Thread-Index: AQHZWHHmrPAxxI9fBU+6kYg0jGDE9a8DPd8Q Date: Mon, 20 Mar 2023 06:45:06 +0000 Message-ID: References: <20230316204434.360283-1-wei.huang@intel.com> In-Reply-To: <20230316204434.360283-1-wei.huang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4252:EE_|BL3PR11MB6436:EE_ x-ms-office365-filtering-correlation-id: cd0b86b5-b9c6-4188-afe8-08db290ea451 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vpp6omyclXNn+81Q4axNoN2ttZ2qKcaFBpZgEZ4UHPXNMXl2fkE6W7onJjVHfGtrPPqWcNaL9gZsqTba0/gYilMkSOysd7B6kSehUnSnHBcIRvcF2r2qlVley1JiGcYgcLOU2gOvL1tb0fiQ+OpuIufB/sMiUZ1K2ZZozfs2asFwtuESfoBVujzLupLW7tnlqLiLXCNzkKPRKHOCWN1NHYud1H3EHSWHxM5wskxxC53rYGveZ66+tsA5TqBTUXutrZmO56JRN70O8pjbKcTWBIa1gqRTaL9OS62TpNlZ5c0FERSheWEimrHuBvXd1TRLy21Euw4u7lg4zlPUHZ0BPnIHSiSCuvLmDge8MnzaxGhb4pXbOnrYN5A3yf/g3j90Pp7XpoeLe8KEccHrvTlGobF6/0ZKNCylq2kjSqsjUQJ+f8XFTnDML9WkingiGdO5ZPw8xnuaw6zfJ0wYiWAUJoKB04lR/A/HUJCqahss7ab9B3gCMuEBK8B8etxKoVVzd+Oud7cwq1VCPlolobUzEPCSw81yuOQ2LP7FMIJt4s+wJD8tMK/QH3rtOhazeXrFuubfKGXCw5NCux5OYuowIM+qgvkSLaC6dSX59Pn8N3VKcvXvS4z22OAv5Fe8gp4yQtmMAVc3QDxriC17laeOvj4t6O+i1u/eLZ3oSdsX7QyfwH4Pc3JwjnFCWRyYsV9NoEHoXeB7mbkFPi1HVl/NWA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(396003)(346002)(366004)(39860400002)(136003)(451199018)(5660300002)(8936002)(66476007)(2906002)(8676002)(66556008)(66446008)(76116006)(4326008)(52536014)(66946007)(316002)(110136005)(54906003)(64756008)(478600001)(7696005)(71200400001)(107886003)(26005)(6506007)(41300700001)(53546011)(33656002)(186003)(83380400001)(86362001)(55016003)(38070700005)(82960400001)(122000001)(9686003)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ar0mG+iMoeYp8hHpXZZ2QVbSL6gtGRobpboCVhdTgL6o+11BmUDy8nIu2tcP?= =?us-ascii?Q?NRRd54Itx5YuUxMYIPTGgZRw4BT2UT77aUJUk22k0fZ2fwITCQKRfhDc61s7?= =?us-ascii?Q?VkHacjaTWHmIzzke6BNneej9sFGrfuEF/wsFVnBVhpucVvKtGqpAjgCl16Jq?= =?us-ascii?Q?UDkmCw0kUfBmtflmTPubZheC2GcCcMRKj36Xhn2nMgkV1UwECUMeIHj5U2q5?= =?us-ascii?Q?79XghvEOacXKInGeDK6RpGsMFqrnHCpozOGew/lxEsvdskspUz4lFsYrW12/?= =?us-ascii?Q?d1/sQJWlWLgZRmsq4amJZvJ7YNrOR2XUM1OYYLfoz3PSKs+4yGxMTqyr4J8C?= =?us-ascii?Q?YPoPjVkt91l6PB1nOZpG2ctl1IlWBPdbBxWBnBqEnqjmdmwm65nsGWtoEuoe?= =?us-ascii?Q?DkkYrBken7meNP3NBazjzFtBQvy8ny5MW0qVa1Vc/jPiMJcigx4gRlw5VSOE?= =?us-ascii?Q?ubrvzlpKVjqNiSFr8xoFHTYGloGZM7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ascii?Q?/YeeMRmnK+VD7gCITbcrWt/rBUZHqCf1Qn5H24ta6HfRJPMx23PKk2RUDRw8?= =?us-ascii?Q?EJ+i407qJn0lJ+bBHrF0k1/WX3C6KcfHN+waj0Az7y7unaRyYmAnEhUSAOJF?= =?us-ascii?Q?YtKxDhUG/QiEWVY1KT1VIaFb9W8mlP975xQccZhQGnShbWegr2KcMi2TUTY5?= =?us-ascii?Q?Dk03cAUHxfw41d2f1z1JlYBmRH/xm6sRFvBm5/av?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd0b86b5-b9c6-4188-afe8-08db290ea451 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2023 06:45:06.5530 (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: sSSMH9ELwQMcyJbYKdKEw1sHPgMmYxrQlkODIFCpbymmWuzUTdIpuICUcdxlO+a6wzGm5SHElTYqdi1WTNRghA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6436 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 Hi, > -----Original Message----- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:45 AM > To: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com > Cc: stable@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] bus/ifpga: add fpga bus cleanup >=20 > In this patch, cleanup method is implemented for FPGA bus which will be > called during eal_bus_cleanup(). >=20 > Signed-off-by: Wei Huang > --- > drivers/bus/ifpga/ifpga_bus.c | 36 > ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) >=20 > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.= c > index 07e316b..ffb0c61 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -360,6 +360,41 @@ struct rte_afu_device * > return ret; > } >=20 > +/* > + * Cleanup the content of the Intel FPGA bus, and call the remove() > +function > + * for all registered devices. > + */ > +static int > +ifpga_cleanup(void) > +{ > + struct rte_afu_device *afu_dev, *tmp_dev; > + int error =3D 0; > + > + RTE_TAILQ_FOREACH_SAFE(afu_dev, &ifpga_afu_dev_list, next, > tmp_dev) { > + struct rte_afu_driver *drv =3D afu_dev->driver; > + int ret =3D 0; > + > + if (drv =3D=3D NULL || drv->remove =3D=3D NULL) > + goto free; > + > + ret =3D drv->remove(afu_dev); > + if (ret < 0) { > + rte_errno =3D errno; > + error =3D -1; > + } > + afu_dev->driver =3D NULL; > + afu_dev->device.driver =3D NULL; > + > +free: > + TAILQ_REMOVE(&ifpga_afu_dev_list, afu_dev, next); > + rte_devargs_remove(afu_dev->device.devargs); > + rte_intr_instance_free(afu_dev->intr_handle); > + free(afu_dev); > + } > + > + return error; > +} > + > static int > ifpga_plug(struct rte_device *dev) > { > @@ -470,6 +505,7 @@ struct rte_afu_device * static struct rte_bus > rte_ifpga_bus =3D { > .scan =3D ifpga_scan, > .probe =3D ifpga_probe, > + .cleanup =3D ifpga_cleanup, > .find_device =3D ifpga_find_device, > .plug =3D ifpga_plug, > .unplug =3D ifpga_unplug, > -- > 1.8.3.1 Acked-by: Rosen Xu