From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8142CA04BC; Fri, 9 Oct 2020 06:53:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D28D81BF19; Fri, 9 Oct 2020 06:53:12 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60086.outbound.protection.outlook.com [40.107.6.86]) by dpdk.org (Postfix) with ESMTP id 3F8C11BF16 for ; Fri, 9 Oct 2020 06:53:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O003pvLW//LtcyOgtyBhBj+74WY7Q/lWgy3w4hYnzXo2r3oAvG2I/EY1txlxtptwFY8iwTViZhYMIu9OrVnJIiFAO2lGuwjJtvRtJe0vpCmWliHGZmBa0INdVLtVUuWRIQ+dBPnGNOKg8yH4EqjYLYwMg/yizGrFb7TGbSjpqX87M0M29vL7FlOmeCZGbTh2RiWPzEBSv2pj+kqewmYBquKXaFFuT67lyultBfuzIkJ329VweoBI3tprT4YRoowOVQzuzSBBElI3iEX8y1I3P41bqLKUyE+VSqAT2Ihstf1G6isFXa97LuwYFAVfVucoZCAUol1x9KUONkBNPEgwrw== 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-SenderADCheck; bh=Yl7sbJXF3Tjo6a3ZiqeBIUb/0hS2zIUQeHmG+4bwvq0=; b=hAuzxlH75en8DX9EQjgqcRQw1oXj8zfi76r802v5jluliylDc7iI0HjKmwUXufcWuYeJ97aWX4BicGntpKOUMLzegleUh50zCeT2tuBGJaFlnq7X2logPEvFeu/ky5tC1cOq217ucebeBDT89a6l/Eddn322M3e55tA9va96HtsPl8/FyWUwpaQn4dzAsJWMgqeNt99b5pAHFZQuEUX0qJsGqXc+AAspwYuFa2VoIravR9X4Nva1xcSVLpkV0Ebh05afO2k24pvQDONWL7u6DapexaiRGtZoC7AdPOQ/sQJWRpSBJuxYQj9QjHqNuVkUInL40knhYdTBmAJnDpFjKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; 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=Yl7sbJXF3Tjo6a3ZiqeBIUb/0hS2zIUQeHmG+4bwvq0=; b=U3LGFciRnn0lEbW4xyE2yYQ69JE8wzGge1GSrFIPmHfgEG9pMgDd/Eg+aXG1blvXQhQ4+0JlfynoYIDmI1rsEurdtl/meujDz4W1gaHL7NXmpCH63c1lDkZpFSnjGItbEh/SM16AvzrzPRSz5UL/P7ba8Jg+ScKla2upL1qlIVE= Received: from VI1PR04MB7136.eurprd04.prod.outlook.com (2603:10a6:800:122::19) by VI1PR04MB4336.eurprd04.prod.outlook.com (2603:10a6:803:4c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Fri, 9 Oct 2020 04:53:08 +0000 Received: from VI1PR04MB7136.eurprd04.prod.outlook.com ([fe80::281d:6eaa:f5df:5aa]) by VI1PR04MB7136.eurprd04.prod.outlook.com ([fe80::281d:6eaa:f5df:5aa%7]) with mapi id 15.20.3455.023; Fri, 9 Oct 2020 04:53:08 +0000 From: Rohit Raj To: Ferruh Yigit , Ray Kinsella , Neil Horman CC: "dev@dpdk.org" Thread-Topic: [EXT] Re: [dpdk-dev] [PATCH v3 1/3] eal: add API for bus close Thread-Index: AQHWe20daBgMYFV8Yk2atB0R0aVnoqmBSNyAgAzfagCAAND87g== Date: Fri, 9 Oct 2020 04:53:07 +0000 Message-ID: References: <20200824082414.30535-1-rohit.raj@nxp.com> <20200826055233.26075-1-rohit.raj@nxp.com> <23bd31be-06a2-af9a-2b54-8e44cf9b2c79@intel.com>, <9561d2ed-8392-602b-5c98-d189e1bccbd9@intel.com> In-Reply-To: <9561d2ed-8392-602b-5c98-d189e1bccbd9@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [110.235.216.117] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0fe139b6-a6dc-4939-b894-08d86c0f374a x-ms-traffictypediagnostic: VI1PR04MB4336: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 84nZ9rydhot1iHH5DOCMpODNy5cnMoI/yqztSi7Gto7yF1DcRQfePtmRQjDabzm23Ibd7V8YN1HbK/cFrzBJf1S8hDWH4/QbNiAImA+uFpDnxieFtxScDIfv8jOtpo0+8IkfhbSCuYB1OMfH5+ZvBx/HCxN4EJBvKZRHVGCfvPfizT+h13RbWLmgjiuM6f7o37UOBSihomGHGR2y8IgxU1DFmAInPUXcM/YBwkSU/oAQfZDVewXGnia6dSd+tPAoeFzoPMBnPa+vcodFjlc0xhYGqCFDxZn5bU2AsobMw1UCxMq7rHfvYa9v0Bv9BNHhO3Q0/Iylkp9OFgnSu+2MJA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB7136.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(366004)(376002)(346002)(8936002)(64756008)(6506007)(53546011)(66556008)(66946007)(66446008)(44832011)(478600001)(2906002)(66476007)(186003)(45080400002)(110136005)(316002)(86362001)(26005)(8676002)(9686003)(5660300002)(76116006)(33656002)(52536014)(71200400001)(55016002)(91956017)(4326008)(83380400001)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: co92t7lAoHRPVh5YWuDPSLIe9IkZQUi70RLE4FXPBC+hGKyLIknXF3nOEu92bSKDfHOayJ8rIy/gEYo27oVS4o5lscUK51GNVO645VUjgHn3PCzcM2yS8HiUJAzdaH+b0qOnAoyjWQMdPky10RZW3E8x8kbVkYdK0LaGOx4VBEQhOStYUPqE/FCylvVGMzDuem45Mbj31SXV9eNm+y3jF3UJ2OFIwK9rXMn+hbliw9cQOeiGm5sMxPopHUnQIqB1oKu5q03aa9NB4+eg92QYC0RAiN5vRrx0YfMKVuU9DXTXBv1/p39ULQJz3ewemAY3TRdQgSQd+JFLAzdMKgsnoQrIFde9PcGxaxd4MBuBnvOa9putMKHU8g+VdWECju/BgdefodjS+WwtzL8KZjPnN0eK1Vuf0RhKiCCslgKFI/0P8hB2DOOHoOOpH8k42GfW4gobehxm19NVe9CfEhjxggsRI64ziZ6KbWqdJeBP1aKz32K8kBZ51vL2xg2JL5LDhqSBnqq6XEB9oV7SxbDvFoPg+RUBUWnEaWH5LaqB7vvMT5EF+GD3SBmVDqorN4NKB74sgyuzcy7yeFwWqVVee0g2sM7qHd/C9cZfZxc92R7d9QihYZC92EbdYPfdtB/HCOc11WyOQr69vep0ppiQVw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB7136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fe139b6-a6dc-4939-b894-08d86c0f374a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2020 04:53:07.9534 (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: PqQSCWurrnOZSPXK7/gK/9kQKB+TmuO2iG2uXCC/62MNrL/xZ7vHqnQj44+Ni685P4Kl8kKnDdqmf+3a99HMJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4336 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v3 1/3] eal: add API for bus close X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh, Sorry, I missed you comment last time. I will send an updated patch series = after taking care of your suggested changes. Regards, Rohit Raj Software Engineer | NXP India Private Limited Sent from Outlook Mobile ________________________________ From: Ferruh Yigit Sent: Thursday, October 8, 2020 9:54:58 PM To: Rohit Raj ; Ray Kinsella ; Neil Horma= n Cc: dev@dpdk.org Subject: [EXT] Re: [dpdk-dev] [PATCH v3 1/3] eal: add API for bus close Caution: EXT Email On 9/30/2020 12:50 PM, Ferruh Yigit wrote: > On 8/26/2020 6:52 AM, rohit.raj@nxp.com wrote: >> 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. >> >> Signed-off-by: Rohit Raj >> --- >> >> v3: >> * nit: combined nested if statements >> >> v2: >> * Moved rte_bus_close call to rte_eal_cleanup path. >> >> lib/librte_eal/common/eal_common_bus.c | 32 +++++++++++++++++++++++++- >> lib/librte_eal/include/rte_bus.h | 25 +++++++++++++++++++- >> lib/librte_eal/linux/eal.c | 1 + >> lib/librte_eal/rte_eal_version.map | 3 +++ >> 4 files changed, 59 insertions(+), 2 deletions(-) >> >> diff --git a/lib/librte_eal/common/eal_common_bus.c >> b/lib/librte_eal/common/eal_common_bus.c >> index baa5b532a..5fd7cf6c5 100644 >> --- a/lib/librte_eal/common/eal_common_bus.c >> +++ b/lib/librte_eal/common/eal_common_bus.c >> @@ -1,5 +1,5 @@ >> /* SPDX-License-Identifier: BSD-3-Clause >> - * Copyright 2016 NXP >> + * Copyright 2016,2020 NXP >> */ >> #include >> @@ -56,6 +56,36 @@ rte_bus_scan(void) >> return 0; >> } >> +int >> +rte_bus_close(void) >> +{ >> + int ret; >> + struct rte_bus *bus, *vbus =3D NULL; >> + >> + TAILQ_FOREACH(bus, &rte_bus_list, next) { >> + if (!strcmp(bus->name, "vdev")) { >> + vbus =3D bus; >> + continue; >> + } > > This special treatment for 'vdev' bus is done in probe to be sure physica= lly > device port ids start from '0', I guess we don't need to do this for 'cl= ose'. > >> + >> + if (bus->close) { >> + ret =3D bus->close(); >> + if (ret) >> + RTE_LOG(ERR, EAL, "Bus (%s) close failed.\n", >> + bus->name); >> + } >> + } >> + >> + if (vbus && vbus->close) { >> + ret =3D vbus->close(); >> + if (ret) >> + RTE_LOG(ERR, EAL, "Bus (%s) close failed.\n", >> + vbus->name); >> + } >> + >> + return 0; >> +} >> + >> /* Probe all devices of all buses */ >> int >> rte_bus_probe(void) >> diff --git a/lib/librte_eal/include/rte_bus.h b/lib/librte_eal/include/r= te_bus.h >> index d3034d0ed..af4787b18 100644 >> --- a/lib/librte_eal/include/rte_bus.h >> +++ b/lib/librte_eal/include/rte_bus.h >> @@ -1,5 +1,5 @@ >> /* SPDX-License-Identifier: BSD-3-Clause >> - * Copyright 2016 NXP >> + * Copyright 2016,2020 NXP >> */ >> #ifndef _RTE_BUS_H_ >> @@ -67,6 +67,18 @@ typedef int (*rte_bus_scan_t)(void); >> */ >> typedef int (*rte_bus_probe_t)(void); >> +/** >> + * Implementation specific close function which is responsible for clos= ing >> + * devices on that bus. >> + * >> + * This is called while iterating over each registered bus. >> + * >> + * @return >> + * 0 for successful close >> + * !0 for any error while closing >> + */ >> +typedef int (*rte_bus_close_t)(void); >> + > > As I checked the 'rte_fslmc_bus->close()' ops, it iterates on all devices= in the > bus instead of doing a bus level close, in that case > instead of adding a new 'close' bus operations, will it work if existing > 'bus->unplug(dev)' used? > Whatever done in the 'rte_fslmc_bus->close()' per device, can it be done = under > the 'fslmc_bus_unplug()'? > > And in that case a 'rte_bus_remove()' API can be added which can call > 'bus->unplug(dev)' for all buses and it will be beneficial for all buses,= and it > can fit well into the 'rte_eal_cleanup()'. > > What do you think? Hi Rohit, I have seen new version has been sent today, I want to remind above questio= n, can you please check it?