From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00061.outbound.protection.outlook.com [40.107.0.61]) by dpdk.org (Postfix) with ESMTP id B9ABD1B29A; Thu, 4 Apr 2019 13:50:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q1JJ6Wnp31xCdPBI3Iqsw7yQxYF7nYUBScc9tdSGTSc=; b=mPIhUM2iv4+IOc2ESnJNifVXvv1uLbuONFXNa58zcbygppZPja9KP88pZS9miXDsrjRGCH1CIiKkYwUPNeA1CMcnRGxmT5zNI6C1zoyt+wZjuEpVr/6Zmxys6HpavRk3r0B5qEjsm6Yi2vW5sdq1GxDtjLDl5YePccHgc0WE4Os= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB1965.eurprd04.prod.outlook.com (10.166.140.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Thu, 4 Apr 2019 11:50:21 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::18e3:39b6:c61d:3f18]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::18e3:39b6:c61d:3f18%12]) with mapi id 15.20.1750.017; Thu, 4 Apr 2019 11:50:21 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "thomas@monjalon.net" , Shreyansh Jain , Nipun Gupta , "stable@dpdk.org" Thread-Topic: [PATCH v3 3/7] raw/dpaa2_qdma: fix to support multiprocess execution Thread-Index: AQHU6tyVv3cV0L83GUGXZG4ACkSJXQ== Date: Thu, 4 Apr 2019 11:50:21 +0000 Message-ID: <20190404114818.21286-3-hemant.agrawal@nxp.com> References: <20190404110215.14410-1-hemant.agrawal@nxp.com> <20190404114818.21286-1-hemant.agrawal@nxp.com> In-Reply-To: <20190404114818.21286-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [92.120.1.72] x-mailer: git-send-email 2.17.1 x-clientproxiedby: LO2P265CA0082.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::22) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d78105af-670b-4eba-a542-08d6b8f3b75d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VI1PR0401MB1965; x-ms-traffictypediagnostic: VI1PR0401MB1965: x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(199004)(189003)(44832011)(8936002)(71190400001)(25786009)(305945005)(6512007)(52116002)(478600001)(68736007)(105586002)(4326008)(7736002)(486006)(53936002)(2906002)(1076003)(5660300002)(102836004)(5640700003)(76176011)(446003)(186003)(476003)(386003)(66066001)(11346002)(26005)(316002)(106356001)(2616005)(6916009)(2501003)(14454004)(3846002)(81166006)(6486002)(71200400001)(6436002)(99286004)(6116002)(6506007)(81156014)(8676002)(97736004)(50226002)(54906003)(1730700003)(86362001)(256004)(14444005)(36756003)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB1965; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: GrNRy1Gcg6pgBq3TX5IuSVlzMFAqK3Dl7q4eUaMPYbknhisBl91oR5rkYK4AywPIjcduX7aVeACO4BxgpB6eg44ZTlQY36W9sq5Ueew2gOPdEgXojjpZkznemVkWEnXLarn+YfT264xE2kajC3AvOYIni0TfLYxGecpG5LqRdM1wrWNUp0Yp4IBQ5HJIZ3bJ8TI9ngwmH6GUDVSuzZ39SvIuv6+NUbDLQazf89/OAGQZtqlurGDyWZQwyOpw/eE7nBoHLG78mW1Cz+fS0FgkM0ZfF8OY9alImnfWAO8Y62+MopAR7lgmuiD1SOe9HGW/RC6LxV5JSzON/MkyBRaqSa9qJwfpvb1wokE/vBQmEphUnNh7ta7aAvA8mdyBpatlEgyTIF6G0zoKHKz/9EVMpqgbecwD71u6NtYpZoEWxkQ= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d78105af-670b-4eba-a542-08d6b8f3b75d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 11:50:21.6528 (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-Transport-CrossTenantHeadersStamped: VI1PR0401MB1965 Subject: [dpdk-dev] [PATCH v3 3/7] raw/dpaa2_qdma: fix to support multiprocess execution 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: , X-List-Received-Date: Thu, 04 Apr 2019 11:50:23 -0000 From: Shreyansh Jain Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs") Cc: nipun.gupta@nxp.com Cc: stable@dpdk.org Signed-off-by: Shreyansh Jain --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/d= paa2_qdma.c index afa5e5a3d..88c11a3d2 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include @@ -219,6 +219,7 @@ int rte_qdma_configure(struct rte_qdma_config *qdma_config) { int ret; + char fle_pool_name[32]; /* RTE_MEMZONE_NAMESIZE =3D 32 */ =20 DPAA2_QDMA_FUNC_TRACE(); =20 @@ -258,8 +259,12 @@ rte_qdma_configure(struct rte_qdma_config *qdma_config= ) } qdma_dev.max_vqs =3D qdma_config->max_vqs; =20 - /* Allocate FLE pool */ - qdma_dev.fle_pool =3D rte_mempool_create("qdma_fle_pool", + /* Allocate FLE pool; just append PID so that in case of + * multiprocess, the pool's don't collide. + */ + snprintf(fle_pool_name, sizeof(fle_pool_name), "qdma_fle_pool%u", + getpid()); + qdma_dev.fle_pool =3D rte_mempool_create(fle_pool_name, qdma_config->fle_pool_count, QDMA_FLE_POOL_SIZE, QDMA_FLE_CACHE_SIZE(qdma_config->fle_pool_count), 0, NULL, NULL, NULL, NULL, SOCKET_ID_ANY, 0); @@ -303,6 +308,7 @@ rte_qdma_vq_create(uint32_t lcore_id, uint32_t flags) /* Return in case no VQ is free */ if (i =3D=3D qdma_dev.max_vqs) { rte_spinlock_unlock(&qdma_dev.lock); + DPAA2_QDMA_ERR("Unable to get lock on QDMA device"); return -ENODEV; } =20 @@ -793,9 +799,6 @@ dpaa2_dpdmai_dev_uninit(struct rte_rawdev *rawdev) =20 DPAA2_QDMA_FUNC_TRACE(); =20 - if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) - return 0; - /* Remove HW queues from global list */ remove_hw_queues_from_list(dpdmai_dev); =20 @@ -834,10 +837,6 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int d= pdmai_id) =20 DPAA2_QDMA_FUNC_TRACE(); =20 - /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) - return 0; - /* Open DPDMAI device */ dpdmai_dev->dpdmai_id =3D dpdmai_id; dpdmai_dev->dpdmai.regs =3D rte_mcp_ptr_list[MC_PORTAL_INDEX]; --=20 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2328AA0679 for ; Thu, 4 Apr 2019 13:50:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A7DF1B3A5; Thu, 4 Apr 2019 13:50:29 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00061.outbound.protection.outlook.com [40.107.0.61]) by dpdk.org (Postfix) with ESMTP id B9ABD1B29A; Thu, 4 Apr 2019 13:50:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q1JJ6Wnp31xCdPBI3Iqsw7yQxYF7nYUBScc9tdSGTSc=; b=mPIhUM2iv4+IOc2ESnJNifVXvv1uLbuONFXNa58zcbygppZPja9KP88pZS9miXDsrjRGCH1CIiKkYwUPNeA1CMcnRGxmT5zNI6C1zoyt+wZjuEpVr/6Zmxys6HpavRk3r0B5qEjsm6Yi2vW5sdq1GxDtjLDl5YePccHgc0WE4Os= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB1965.eurprd04.prod.outlook.com (10.166.140.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Thu, 4 Apr 2019 11:50:21 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::18e3:39b6:c61d:3f18]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::18e3:39b6:c61d:3f18%12]) with mapi id 15.20.1750.017; Thu, 4 Apr 2019 11:50:21 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "thomas@monjalon.net" , Shreyansh Jain , Nipun Gupta , "stable@dpdk.org" Thread-Topic: [PATCH v3 3/7] raw/dpaa2_qdma: fix to support multiprocess execution Thread-Index: AQHU6tyVv3cV0L83GUGXZG4ACkSJXQ== Date: Thu, 4 Apr 2019 11:50:21 +0000 Message-ID: <20190404114818.21286-3-hemant.agrawal@nxp.com> References: <20190404110215.14410-1-hemant.agrawal@nxp.com> <20190404114818.21286-1-hemant.agrawal@nxp.com> In-Reply-To: <20190404114818.21286-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [92.120.1.72] x-mailer: git-send-email 2.17.1 x-clientproxiedby: LO2P265CA0082.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::22) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d78105af-670b-4eba-a542-08d6b8f3b75d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VI1PR0401MB1965; x-ms-traffictypediagnostic: VI1PR0401MB1965: x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(199004)(189003)(44832011)(8936002)(71190400001)(25786009)(305945005)(6512007)(52116002)(478600001)(68736007)(105586002)(4326008)(7736002)(486006)(53936002)(2906002)(1076003)(5660300002)(102836004)(5640700003)(76176011)(446003)(186003)(476003)(386003)(66066001)(11346002)(26005)(316002)(106356001)(2616005)(6916009)(2501003)(14454004)(3846002)(81166006)(6486002)(71200400001)(6436002)(99286004)(6116002)(6506007)(81156014)(8676002)(97736004)(50226002)(54906003)(1730700003)(86362001)(256004)(14444005)(36756003)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB1965; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: GrNRy1Gcg6pgBq3TX5IuSVlzMFAqK3Dl7q4eUaMPYbknhisBl91oR5rkYK4AywPIjcduX7aVeACO4BxgpB6eg44ZTlQY36W9sq5Ueew2gOPdEgXojjpZkznemVkWEnXLarn+YfT264xE2kajC3AvOYIni0TfLYxGecpG5LqRdM1wrWNUp0Yp4IBQ5HJIZ3bJ8TI9ngwmH6GUDVSuzZ39SvIuv6+NUbDLQazf89/OAGQZtqlurGDyWZQwyOpw/eE7nBoHLG78mW1Cz+fS0FgkM0ZfF8OY9alImnfWAO8Y62+MopAR7lgmuiD1SOe9HGW/RC6LxV5JSzON/MkyBRaqSa9qJwfpvb1wokE/vBQmEphUnNh7ta7aAvA8mdyBpatlEgyTIF6G0zoKHKz/9EVMpqgbecwD71u6NtYpZoEWxkQ= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d78105af-670b-4eba-a542-08d6b8f3b75d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 11:50:21.6528 (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-Transport-CrossTenantHeadersStamped: VI1PR0401MB1965 Subject: [dpdk-dev] [PATCH v3 3/7] raw/dpaa2_qdma: fix to support multiprocess execution 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" Message-ID: <20190404115021.2pMIMbI30uOpBtGVOpO2Q_5EvrG5sYv8jt2-DO99yGk@z> From: Shreyansh Jain Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs") Cc: nipun.gupta@nxp.com Cc: stable@dpdk.org Signed-off-by: Shreyansh Jain --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/d= paa2_qdma.c index afa5e5a3d..88c11a3d2 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include @@ -219,6 +219,7 @@ int rte_qdma_configure(struct rte_qdma_config *qdma_config) { int ret; + char fle_pool_name[32]; /* RTE_MEMZONE_NAMESIZE =3D 32 */ =20 DPAA2_QDMA_FUNC_TRACE(); =20 @@ -258,8 +259,12 @@ rte_qdma_configure(struct rte_qdma_config *qdma_config= ) } qdma_dev.max_vqs =3D qdma_config->max_vqs; =20 - /* Allocate FLE pool */ - qdma_dev.fle_pool =3D rte_mempool_create("qdma_fle_pool", + /* Allocate FLE pool; just append PID so that in case of + * multiprocess, the pool's don't collide. + */ + snprintf(fle_pool_name, sizeof(fle_pool_name), "qdma_fle_pool%u", + getpid()); + qdma_dev.fle_pool =3D rte_mempool_create(fle_pool_name, qdma_config->fle_pool_count, QDMA_FLE_POOL_SIZE, QDMA_FLE_CACHE_SIZE(qdma_config->fle_pool_count), 0, NULL, NULL, NULL, NULL, SOCKET_ID_ANY, 0); @@ -303,6 +308,7 @@ rte_qdma_vq_create(uint32_t lcore_id, uint32_t flags) /* Return in case no VQ is free */ if (i =3D=3D qdma_dev.max_vqs) { rte_spinlock_unlock(&qdma_dev.lock); + DPAA2_QDMA_ERR("Unable to get lock on QDMA device"); return -ENODEV; } =20 @@ -793,9 +799,6 @@ dpaa2_dpdmai_dev_uninit(struct rte_rawdev *rawdev) =20 DPAA2_QDMA_FUNC_TRACE(); =20 - if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) - return 0; - /* Remove HW queues from global list */ remove_hw_queues_from_list(dpdmai_dev); =20 @@ -834,10 +837,6 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int d= pdmai_id) =20 DPAA2_QDMA_FUNC_TRACE(); =20 - /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) - return 0; - /* Open DPDMAI device */ dpdmai_dev->dpdmai_id =3D dpdmai_id; dpdmai_dev->dpdmai.regs =3D rte_mcp_ptr_list[MC_PORTAL_INDEX]; --=20 2.17.1