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 E0661A00C5; Tue, 1 Feb 2022 06:40:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BB2740691; Tue, 1 Feb 2022 06:40:06 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140073.outbound.protection.outlook.com [40.107.14.73]) by mails.dpdk.org (Postfix) with ESMTP id C10F640685 for ; Tue, 1 Feb 2022 06:40:05 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/vaLn8/QobOlze3qbVuUOIwPV2nKZfQVfmre6ut/v5krWShhhLLHHGt0iUjKCtRhTwLb+PmaHotcUF9eTPJEAYLJJJ+F4zX6uzwsUcanl/aThhGKv7E/N6u+JfLJWnDLSh75Vc85LajgdBouEeSkLt4loKGVvn8wq4ImcBhWggcRiHIlpSf1PWwBQHgobzCDN1LGZD5bkst/oE6pi9z2n+f/jD923GyeCTC/tQrNvYokEL+1qfF7Q6/xVM+He1z64JaP9LsdSsC2NMSbcB1XnrurrbNBYOlCUkXA4xB53EVNW/nmebAj9/+UkgC27AlBpWIW9LLuDH24A8RULNcZw== 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=3sncm0TLOnYMMOfN4cqcbwbqCcFX+oJxCV72xOakoSo=; b=M8GG1bLNdqHPgQQ3lsdJeqEPuondp4iflJFVfMAnQtKKsmFH5akzPg25SMi4wkyEV0KEOFZ9nkp6eKhDc5ohxCPY7aH43cUIi7VWr0lbzFAuoEti/Z6Ajw7RncFDInyja7o6sX/hGojku9aF3W6EvhV92cFQmd4mpDy0hY8qDdFbJpkxXUOLnWxlVNjRLSCL15RP3nWOvj0MWYueH+WIOlRgmchzfVtL10N2cs1zA042cifGCT0pspUDoM2229JUnIMxKbVyMAeK8VQXHDwioppvjAc4HOkBtEUTUy4nkzZqUXFugRhwQqNkcvNPGv81tHqjR9XRXs2o54IGO8Fsug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3sncm0TLOnYMMOfN4cqcbwbqCcFX+oJxCV72xOakoSo=; b=c/6o1gS5YZL8XK/na/wtojuTGpXwvlFToDJ0uRPBn5sF8NgAinRwA/ZyyP0RELT2pRLHY/Jj0h+SyrOaYbyMrEXWf47Su7EHU447xQ+Z4sMCjPXaV0LOB74ThMR3kkMZ8K7f5YNjOxJ145hiWXEkI+X2nkfEYrQ/YiI2aBwW0Jk= Received: from VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) by PA4PR04MB9488.eurprd04.prod.outlook.com (2603:10a6:102:2af::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Tue, 1 Feb 2022 05:40:04 +0000 Received: from VE1PR04MB6509.eurprd04.prod.outlook.com ([fe80::a99c:d624:6ee5:b83]) by VE1PR04MB6509.eurprd04.prod.outlook.com ([fe80::a99c:d624:6ee5:b83%5]) with mapi id 15.20.4930.021; Tue, 1 Feb 2022 05:40:04 +0000 From: Rohit Raj To: Thomas Monjalon CC: Bruce Richardson , Ray Kinsella , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , "dev@dpdk.org" , Nipun Gupta , Sachin Saxena , Hemant Agrawal , "ferruh.yigit@intel.com" , "david.marchand@redhat.com" Subject: RE: [EXT] Re: [PATCH v5 1/2] eal: add API for bus close Thread-Topic: [EXT] Re: [PATCH v5 1/2] eal: add API for bus close Thread-Index: AQHYBeKgMfxVZS1N6Ee+YCJJmZOw46xqM8mAgAHavwCAAAHuAIASPxNw Date: Tue, 1 Feb 2022 05:40:04 +0000 Message-ID: References: <20201008153048.19369-1-rohit.raj@nxp.com> <8133639.5OynTdThKG@thomas> <16764163.5WZRyvrzyv@thomas> In-Reply-To: <16764163.5WZRyvrzyv@thomas> 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=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 811b318e-9eb3-47ec-ce30-08d9e5454c2b x-ms-traffictypediagnostic: PA4PR04MB9488:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /cO6Ui44c5r6mCalukdFA4+VxLZLVfbmAtWR6ePRV+p8QAPtRuaaO2TdMKHA5TlDyuq3sZUsDVTqmd6RVP0qVgoALEoKzTh0arSSWLkLLUCojVLSDGf8Kw9GFA0kvHiERjF9ZBkIfbdudfONEtaQTrY1ij8V5z7IjUt/idUPQ6lW1pDbanYff2eYQfsdsF8yF8+35RclJV+uv8zVTxE4kWJbClvLSsly3h54EcuuR0ryyTjwih8hq87zWv5GLwis48HYxGtGmKLiaCWsjbf20b6yTBkZEuHkeINmPxCUc62xGWALP2NJXBiPg1gBmS/mn8w+2oEB3+nIOjPX1CeNOvv5Wg4agjfXWsteHauKdOxOCR7ocOqUbR21bqeq0fNBgn9vGikP4Cux97gvUY401TSZ3uw8gucn4gbJWzXuHPUvLANFyvT9Emn6W5e3Qx8MMJu+3YOnTGnwJF/l0CXAMBfUjN0HBuRnc+wgJ5pX/nQeJJFvF9jB3ry/2gbGJHKKRx2NUs/vqfzm4EZPRzlL2Dd3ceQd9fHS9U8ThIvO+vOWH84F5NdeerC5JGqFk0ARLu8HHHGhOtHqKrB48yE/+RqrPVfvSMHCQONMwk77ZFlobXWlebS/J61fLPD4tvMyZXwjfwT9gg9HiBYJq2EoDrT2teSOMombmYnSbNy9jwX7GUou00h1lE4NBiGnhpDQVOKV2eNOhQCLL+5ceKatZQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6509.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(38070700005)(316002)(71200400001)(54906003)(508600001)(83380400001)(7696005)(53546011)(9686003)(6916009)(86362001)(122000001)(6506007)(186003)(66476007)(26005)(7416002)(66946007)(5660300002)(44832011)(66556008)(33656002)(4326008)(52536014)(8936002)(55016003)(66446008)(64756008)(76116006)(2906002)(38100700002)(8676002)(20210929001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?B4TCyKn1PEhBWxOGjE2bELzrc5MAqo3VI8NLUnCEJacWx81CZJJ8fs4K4C/K?= =?us-ascii?Q?EHv3rVxiedDJ11bomnaIVkT5TsU1sfrfTTvaP40Z2MscnFEoP0Vhf6KI6lFR?= =?us-ascii?Q?jZ21qsfPNYnHpM7ArbF0xOmotux/Adw3TA0PNVVDgYwCxUC3dhDy2e8pPfsC?= =?us-ascii?Q?mfxjzP3GZjB/BwhNiHzvEl+bz1VcrOagc0OWnWiK28qXJMtilMURnHH8xGM9?= =?us-ascii?Q?phzJ3BIDsJBdOEJ9qporVTeytcOzAAT2G/VWbpLA6A3hk6B4EtJyNx6Ou3o6?= =?us-ascii?Q?fU+io8iTtuUETQqxWly66gLnG2UNBYrUyy4bAX+KzXjR5Qvyx4ODUwbHkuTI?= =?us-ascii?Q?N53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gcp?= =?us-ascii?Q?vpgl3EG9hj8dlXSQYblN8qHKsyj3dixugAy5ZFBCFvO4TqBOa6Taw/s5s07u?= =?us-ascii?Q?HLzPtgYPbmbQmJpHXjeu52kazd+7qZd9qd/LA09mWN7R7Yyxz2n+K7jt9unt?= =?us-ascii?Q?izSDE/+lMnX6yZaGtWa3bybqoa6AR1eXbGVfU7EJXCOn0UnUOWnNa7RrCsgZ?= =?us-ascii?Q?tu+SfPvcnfDGIK+FkKUIc1QWAhbIsMOaEBc+Hk6nqaHan2BOz15J0Enioadf?= =?us-ascii?Q?quCpgWJFh1SMnj00RoJZCyJHyB5VKwSO1+np7i9IY/FxPJ8q5DYIB+Psj0jh?= =?us-ascii?Q?eOcgRW0YLALWicZa37I5Rm1xwlz/MIPLdz9xIy5MhjdAiosXoFcOcSKjWXZf?= =?us-ascii?Q?WjC2ZjQptklsSM0fhjEqfDQ=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6509.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 811b318e-9eb3-47ec-ce30-08d9e5454c2b X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Feb 2022 05:40:04.1516 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XuCNDbSGRlBvF3vPXcTK412xAp27D/UkdaFKvkcb1bSuE6jDErO1lQcHR6lvaGH4YiNZ9wu/vJxtSHIcJE2e3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9488 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 > -----Original Message----- > From: Thomas Monjalon > Sent: Thursday, January 20, 2022 8:28 PM > To: Rohit Raj > Cc: Bruce Richardson ; Ray Kinsella > ; Dmitry Kozlyuk ; Narcisa Ana > Maria Vasile ; Dmitry Malloy > ; Pallavi Kadam ; > dev@dpdk.org; Nipun Gupta ; Sachin Saxena > ; Hemant Agrawal ; > ferruh.yigit@intel.com; david.marchand@redhat.com > Subject: Re: [EXT] Re: [PATCH v5 1/2] eal: add API for bus close >=20 > Caution: EXT Email >=20 > 20/01/2022 15:51, Rohit Raj: > > Hi Thomas, > > > > This "rte_bus_close" API is introduced to do the opposite of what > "rte_bus_probe" does. Just like there are plug and unplug APIs for pluggi= ng and > unplugging a single device. > > > > The API you mentioned, "rte_dev_remove" supports only rte_device. But = we > also need to close/remove private devices of dpaa and fslmc buses which a= re > not exposed directly to user (eg: mempool device). > > Note that these private devices/bus objects are not associated with a > particular rte_device but they are available as a resource to be used by = any of > the device based on these hardware specific buses. > > So, to close these devices, we need a new API which can do this for us.= That is > why "rte_bus_close" is required. >=20 > You mean some resources are associated to a bus but not to a device? > It lools very weird. A resource on a bus *is* a device. >=20 > PS: please avoid top-post FSLMC bus has hardware resources for memory pools, queues, hardware access = lock(called portal).=20 These are common resources, which can be associated with any device. So the= y don't belong to a specific device.=20 Eg: mempool resource can be used by both eth and crypto device. So, we cann= ot close mempool while closing just one of the device(It can happen in mult= iprocess applications). So, these resources should be specifically closed/f= reed with the bus instead with a device. There is no need to expose these devices to users and their usages is limit= ed to other devices on the bus. There is no reason to create yet another ty= pe of device in DPDK to expose these internal only resources. > > From: Thomas Monjalon > > > 10/01/2022 06:26, rohit.raj@nxp.com: > > > > From: Rohit Raj > > > > > > > > As per the current code we have API for bus probe, but the bus > > > > close API is missing. This breaks the multi process scenarios as > > > > objects are not cleaned while terminating the secondary processes. > > > > > > > > This patch adds a new API rte_bus_close() for cleanup of bus > > > > objects which were acquired during probe. > > > > > > I don't understand how closing all devices of a bus will help better > > > than just closing all devices. > > > > > > As Ferruh already suggested in the past, we could force closing all > > > devices in rte_eal_cleanup(). > > > And we already have the function rte_dev_remove(). >=20 >=20