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 40E64A04C9; Mon, 14 Sep 2020 12:49:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D9611BE95; Mon, 14 Sep 2020 12:49:54 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2071.outbound.protection.outlook.com [40.107.20.71]) by dpdk.org (Postfix) with ESMTP id 5605A2C36 for ; Mon, 14 Sep 2020 12:49:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aIVuZYNbAk63ITUBdZQOVV5gGSY28sFT9FQoHrfuuKl4COF9hHqCXPCxLj0yO+9BR4QCmkN3VEReEjtee67CnphREmSe3CXdmu9tJVBdwby1xKcIbtNJ1dgdMowVE8+Lds6ayntSYRV2Z8uYD9F+2begmsx4mE75bKoZBkFGn6iUBsdAsU7Dkl9w8LVDNutEYsUP/6zARTePyZqxkIQurIdamXxuC6H1XjomswBSvanw8hq8GnnI+3qByqxklDuef9r/Q+UuhVy3hUcJ4bMYf3Z/RIvJmMSqN2pqV2Lurv9ha0yjY2Wyko4wbO/WVcg22vNpCdV9H2lKYovC2YrGQw== 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=WIOCE/lqwCQuVMeUN0shY7kVT58XD6DJWF2phyD+Avo=; b=I+6+MQpYrqby2QjKeG7VV9bwTtr9RXBKA7j7d2BsPAMnpLwiQOo9IWIP7348nwUY6ABp95obKqtoqGh+dDGv8B2u0eccZlbTlWXgtp14FE6C3AV0Oqn5Q2IJMMbFnd1GKCyJjnO+imeqssv6y7HAQBKYa3UBqaZlffLlbRHealnuADxB9GdOpsZWliVQvRS288LfEj8JxDZeCMz5uXq4WBnghWRBFDETyljRSOlafFdOnvYDUOMUl6177ylnwvExGqxQmFrQsYhzZ751+73YdSVv84WmgAYZkG+oC6WTpMiKF/d5sknL9GGfRXiw9AbY0E11AT1CCar29yRB4tUPkQ== 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=WIOCE/lqwCQuVMeUN0shY7kVT58XD6DJWF2phyD+Avo=; b=h/B6trNcClTbOv6JmmbfhnwE2zqRM3zCQ0SJhrMx33KAU9j1kahmyzdNWIjIXw7cpDzO2qg2NQ5FXx+aFZ8A5JABlFfb5bTdGgF7InVrlt3hETyKdqZaQcTkphFZNo+N25oA8419m125Oy1Wb3q4zG/zcsTn9Nn70D0fGM+HQmI= Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR04MB4037.eurprd04.prod.outlook.com (2603:10a6:209:49::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Mon, 14 Sep 2020 10:49:52 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::e024:2be5:29c3:31b0]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::e024:2be5:29c3:31b0%7]) with mapi id 15.20.3370.019; Mon, 14 Sep 2020 10:49:52 +0000 From: Hemant Agrawal To: "Sachin Saxena (OSS)" , "dev@dpdk.org" , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v2 2/8] bus/fslmc: run secondary debug app without blocklist devices Thread-Index: AQHWiBaGLqMUlp+9l0OP76h/BX+pZ6ln+Lqw Date: Mon, 14 Sep 2020 10:49:52 +0000 Message-ID: References: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> <20200911083520.24020-3-sachin.saxena@oss.nxp.com> In-Reply-To: <20200911083520.24020-3-sachin.saxena@oss.nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: oss.nxp.com; dkim=none (message not signed) header.d=none;oss.nxp.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [122.176.3.89] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d7cf3fc7-d3a7-457f-69cb-08d8589be8ef x-ms-traffictypediagnostic: AM6PR04MB4037: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1bLGGc2IjzHUzxFOzDg7QIRK/mM246sJenz6MSm0YUI9JB0sseyGV1kyiTgxIxYNUs2a4jJopjRobEfGMerDV1uNB/enjjhq7l2h1EZI4H24BD6vTMkltLzwX3eYjqxqhW5PEcKsqNKmErCsmF7QxQuvJmXOJNyji4hG8AJ/TUuRjBFY2/XOB7hZOORUkr4mWAdQEyMAm3qzWoHN66YUMgr8cq7u5kS3sFf4zcQuAFkaZuau1689hDz75GVtVC/Yta8DIKC6bFtDbteXzu5xDNqSsJ067PSJ4S6yMBvUBZXwVLVtbrcBjXrcSU39u139gTHb6KDnB4yILuBwW4Kerg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(26005)(186003)(316002)(71200400001)(8676002)(52536014)(7696005)(83380400001)(86362001)(8936002)(5660300002)(9686003)(2906002)(44832011)(55016002)(110136005)(64756008)(66476007)(76116006)(6506007)(55236004)(53546011)(66446008)(66556008)(33656002)(478600001)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: mzh4YIFTLBq3normwbHZSRZJe3oeqQJhI3gCx120fSQ7g/lYp/F919CVGsHEJk4xAkRK+kB20kbiosumJO7hetId0x1IVeFwJXuOu+yAOAylLB019hZoCMJZx2UJvh+zq5FsiqZAP5bfJjwSmXCUYuXIL4Ql+kMt9lWX+N91r36hPeNV9alraX/MXOOvzcsCJgRuoIJ+uSKkoi4axM/zDWL/Y1Ym2ER/S0e550XQLdCS6twl+lMdjeC8TgoVwELSa3G4ZyXLMzbTAD/FHu2xQ2chYKy9oXvpNfbbXzjPJOQh/B9bs3zuxuiwK/psIbXYsh6RJ0+QoCiMzy3HP1ycQcCARpuT4t6aWHPlSXJ/xL0EcZsQpzObw0YflkcN/AF2wPA600QGYcMG+7z0UfLmv7smvLnEOFScMfOEM4L+WmNX3vzPOnuvslmM8+0kmWMtnVlG39eugQZtU6q83MfIjoJ0EUrMg/OQI/PTC0gHrg1Vqth0gbWoSl45ZalO9lpxqY08GSk8HXwtlMlMAf9409cWembycXzWQsSF2lwHLYRcw18vocs3l1WG2zBr0IQ5BUDbmh8rpbM4QDFh/QI98lw4UrByARSY6/u+8cNmlq3JWuEziJfbPIBVHw9EUUtxVuynrkqYsl8Myi4Gqg5S7w== 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: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7cf3fc7-d3a7-457f-69cb-08d8589be8ef X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2020 10:49:52.2475 (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: wCtgWgGVjuOJy7NnCauIBLu4PHU4fPWAG8fB9oe22erxdhP7H3ylbdE5oizrdx6LslwQUafCg0OKPDmNMLkY3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4037 Subject: Re: [dpdk-dev] [PATCH v2 2/8] bus/fslmc: run secondary debug app without blocklist devices 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, > -----Original Message----- > From: Sachin Saxena (OSS) > Sent: Friday, September 11, 2020 2:05 PM > To: dev@dpdk.org; ferruh.yigit@intel.com > Cc: Sachin Saxena (OSS) > Subject: [PATCH v2 2/8] bus/fslmc: run secondary debug app without > blocklist devices >=20 > From: Rohit Raj >=20 > dpaa2 hw impose limits on some HW access devices like DPMCP(Mnagement > control Port) and DPIO (HW portal). This causes issue in their usages in = shared > uses in case of multi-process applications. It can overcome by using > allowlist/blocklist in primary and secondary applications. > However it imposes restrictions on standard debugging apps like dpdk- > procinfo, which can be used to debug any existing application. >=20 > This patch introduces reserving extra DPMCP and DPIO to be used by > secondary process if devices are not blocked previously in primary applic= ation. > This leaves the last DPMCP and DPIO for the secondary process usages. [Hemant] It may be good to also document this behavior in the dpaa2 nic gu= ide.=20 >=20 > Signed-off-by: Rohit Raj > Reviewed-by: Sachin Saxena > --- > drivers/bus/fslmc/fslmc_vfio.c | 66 > +++++++++++++++++++++++++++++++--- > 1 file changed, 61 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfi= o.c > index 9134ec552..6dd797632 100644 > --- a/drivers/bus/fslmc/fslmc_vfio.c > +++ b/drivers/bus/fslmc/fslmc_vfio.c > @@ -802,10 +802,29 @@ fslmc_vfio_process_group(void) > int ret; > int found_mportal =3D 0; > struct rte_dpaa2_device *dev, *dev_temp; > + bool is_dpmcp_in_blocklist =3D false, is_dpio_in_blocklist =3D false; > + int dpmcp_count =3D 0, dpio_count =3D 0, current_device; > + > + TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, > dev_temp) { > + if (dev->dev_type =3D=3D DPAA2_MPORTAL) { > + dpmcp_count++; > + if (dev->device.devargs && > + dev->device.devargs->policy =3D=3D > RTE_DEV_BLACKLISTED) > + is_dpmcp_in_blocklist =3D true; > + } > + if (dev->dev_type =3D=3D DPAA2_IO) { > + dpio_count++; > + if (dev->device.devargs && > + dev->device.devargs->policy =3D=3D > RTE_DEV_BLACKLISTED) > + is_dpmcp_in_blocklist =3D true; [Hemant] This shall be is_dpio_in_blocklist > + } > + } >=20 > /* Search the MCP as that should be initialized first. */ > + current_device =3D 0; > TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, > dev_temp) { > if (dev->dev_type =3D=3D DPAA2_MPORTAL) { > + current_device++; > if (dev->device.devargs && > dev->device.devargs->policy =3D=3D > RTE_DEV_BLACKLISTED) { > DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, > skipping", @@ -815,13 +834,24 @@ fslmc_vfio_process_group(void) > continue; > } >=20 > - ret =3D fslmc_process_mcp(dev); > - if (ret) { > - DPAA2_BUS_ERR("Unable to map MC > Portal"); > - return -1; > + if (rte_eal_process_type() =3D=3D > RTE_PROC_SECONDARY && > + !is_dpmcp_in_blocklist) { > + if (dpmcp_count =3D=3D 1 || > + current_device !=3D dpmcp_count) { > + > TAILQ_REMOVE(&rte_fslmc_bus.device_list, > + dev, next); > + continue; > + } > } > - if (!found_mportal) > + > + if (!found_mportal) { > + ret =3D fslmc_process_mcp(dev); > + if (ret) { > + DPAA2_BUS_ERR("Unable to map > MC Portal"); > + return -1; > + } > found_mportal =3D 1; > + } >=20 > TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, > next); > free(dev); > @@ -838,7 +868,10 @@ fslmc_vfio_process_group(void) > return -1; > } >=20 > + current_device =3D 0; > TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, > dev_temp) { > + if (dev->dev_type =3D=3D DPAA2_IO) > + current_device++; > if (dev->device.devargs && > dev->device.devargs->policy =3D=3D RTE_DEV_BLACKLISTED) { > DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", > @@ -846,6 +879,14 @@ fslmc_vfio_process_group(void) > TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, > next); > continue; > } > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY && > + dev->dev_type !=3D DPAA2_ETH && > + dev->dev_type !=3D DPAA2_CRYPTO && > + dev->dev_type !=3D DPAA2_QDMA && > + dev->dev_type !=3D DPAA2_IO) { > + TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, > next); > + continue; > + } > switch (dev->dev_type) { > case DPAA2_ETH: > case DPAA2_CRYPTO: > @@ -882,6 +923,21 @@ fslmc_vfio_process_group(void) >=20 > break; > case DPAA2_IO: > + if (!is_dpio_in_blocklist && dpio_count > 1) { > + if (rte_eal_process_type() =3D=3D > RTE_PROC_SECONDARY > + && current_device !=3D dpio_count) { > + > TAILQ_REMOVE(&rte_fslmc_bus.device_list, > + dev, next); > + break; > + } > + if (rte_eal_process_type() =3D=3D > RTE_PROC_PRIMARY > + && current_device =3D=3D dpio_count) { > + > TAILQ_REMOVE(&rte_fslmc_bus.device_list, > + dev, next); > + break; > + } > + } > + > ret =3D fslmc_process_iodevices(dev); > if (ret) { > DPAA2_BUS_DEBUG("Dev (%s) init failed", > -- > 2.28.0