From patchwork Tue Mar 26 12:18:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 161214 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp5143338jan; Tue, 26 Mar 2019 05:18:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc4U5i1PlwDfnly9vKYuRGGC+4Y51zyXBpR7gfq1vWmycbsl+5qXdmim8MaavU28pXi+Kr X-Received: by 2002:a17:906:3c5:: with SMTP id c5mr17166637eja.24.1553602694136; Tue, 26 Mar 2019 05:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553602694; cv=none; d=google.com; s=arc-20160816; b=Td3LNvviFZz7RTDNIkNFfm7Sc+4kbAnvaf8YtJJfDB3RjR38GladUqYBJfjTYOxcCy FlF1rLfxBGQldqS9jRyNw5+RGc534tJnh3/IeAj5u0Safzfl1pMge5L3wwJhy0bsjGiR dQZxeoUmxU2ck08NQ1MSHV1+tk5ztnKi5Ep+wjY9ORtn2dtAQy55qkwknFUQA6dL2Qxs 6GpzplcPQXl0iC6aKN2cuS67o2qd6ET/Sh2E/DY/ZPGZ9mKrM44zb/zDHiEsUvPLDTIJ hxKwC4HAjUv/LHghNRqKODihBQPPnvh9dZe3ZJ+rtz/HAtlRib+wNOpAa17B7E91km+3 Zlnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic:cc :to:from:dkim-signature; bh=596q+1mJmT16s4rOJ9Tx4wQIKEH4dkbqQVA+SO33fII=; b=c2258Nh54LFqZB/1tDAGqLzTLbWBAuDm/DG9vUqIRAxu6HzjRJryD8a/Oe4MpNjKQk iq15CdNUia77vjGsKZ70p3/EnJfSHewuvWQlRBEwpBOPUBBGV7sJaTbrQ3bTDMKxJo7e jFeO7Nu2Y7fIQ+kEWcweWJf2QG3qc4cUcEUL5MW8n4Jimodrp2T63NGEz3fnHqP+d8mK RvmBll6uB2eaBW3d/4+JMrhq8htDtUEccOM+Hp1d149Y//QWTw/VaoT2h59FIfWAPWdD ItKoYR6OgmoM5ZBNvfS7Q1XG/p109fTM7k48la3B14VOYbvkRrBr4YzD1MZa8eapt2Z4 Ouew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=kgDRRKAe; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k12si886931edr.443.2019.03.26.05.18.13; Tue, 26 Mar 2019 05:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=kgDRRKAe; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C9E74C93; Tue, 26 Mar 2019 13:18:08 +0100 (CET) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80051.outbound.protection.outlook.com [40.107.8.51]) by dpdk.org (Postfix) with ESMTP id E01632BD3; Tue, 26 Mar 2019 13:18:05 +0100 (CET) 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=596q+1mJmT16s4rOJ9Tx4wQIKEH4dkbqQVA+SO33fII=; b=kgDRRKAebeewHzs9/mlzzdbzYeAQh3HnmpMp8P4EuzCMHetfuGDDYvg2lZdlhYni2IMlF0Ptnqm5cWwFDS6nLbxRyaiEF6mMtyplHO0Q3WIUqvgGakAXdMj1U7QlLjbuMVpUYmoCP4WvPOKcYm7PgF2s3M/RBeNl4j6O53XlrW4= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2575.eurprd04.prod.outlook.com (10.168.65.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Tue, 26 Mar 2019 12:18:04 +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.1730.019; Tue, 26 Mar 2019 12:18:04 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: Shreyansh Jain , Nipun Gupta , "stable@dpdk.org" Thread-Topic: [PATCH 2/5] raw/dpaa2_qdma: fix to support multiprocess execution Thread-Index: AQHU4832ZgGhawRt3Eu+uUatmr4ovQ== Date: Tue, 26 Mar 2019 12:18:04 +0000 Message-ID: <20190326121610.28024-2-hemant.agrawal@nxp.com> References: <20190326121610.28024-1-hemant.agrawal@nxp.com> In-Reply-To: <20190326121610.28024-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: BM1PR0101CA0069.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::31) 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: b0cc8e21-7c86-4941-81f5-08d6b1e518d0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2575; x-ms-traffictypediagnostic: VI1PR0401MB2575: x-microsoft-antispam-prvs: x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(136003)(346002)(39860400002)(376002)(199004)(189003)(186003)(36756003)(44832011)(53936002)(4326008)(76176011)(71190400001)(11346002)(71200400001)(476003)(6436002)(2616005)(5640700003)(486006)(2501003)(446003)(6486002)(14444005)(25786009)(14454004)(99286004)(256004)(2351001)(450100002)(2906002)(105586002)(86362001)(5660300002)(106356001)(81166006)(7736002)(1730700003)(1076003)(3846002)(97736004)(81156014)(52116002)(54906003)(66066001)(6116002)(68736007)(6506007)(386003)(478600001)(26005)(316002)(6916009)(6512007)(50226002)(8936002)(8676002)(102836004)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2575; 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: oghjt7v00YS1yYO53w+ouNz12x8LIG+WIPNtSQcas2twkb7zbpu52TdgNbKvN/XiqpPg5HyLeq+Ex8Wr/1nZkKY9qzxG2hK6dPv/Xw5UmrOrwqGRsGEqULODMssmBBR12yCXfBE72z0P7jLzvKzRsCzezPK6wo5oEt6kTT1OQZn8c67n+HLyvj3BmmsCDiC6seW5Ne9soeCDaih7ZvXEl2YfrVXo17S5PwoWKH4w7i3Yk+VhGXhfso2EMYRKI18TSVNQqIKHs/yIiRuGVasjL4VD8dnC0u9zA35KnCGZ5Jfsrg0CYD2SSaIa8PhmosU2whxuHa0EbwMqhTYouchT+gSy2gVPQ09yjD7y08W9ps/t+H3o0lpzB6r95fGqMUD2L0QMLbY2St70dfASF5MEPVQPIe/SsJ2hePJxn1nFcqc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0cc8e21-7c86-4941-81f5-08d6b1e518d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 12:18:04.4811 (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: VI1PR0401MB2575 Subject: [dpdk-dev] [PATCH 2/5] 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" 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 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index afa5e5a3d..a3f0f7fdd 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -219,6 +219,7 @@ int rte_qdma_configure(struct rte_qdma_config *qdma_config) { int ret; + char fle_pool_name[32]; /* RTE_MEMZONE_NAMESIZE = 32 */ DPAA2_QDMA_FUNC_TRACE(); @@ -258,8 +259,12 @@ rte_qdma_configure(struct rte_qdma_config *qdma_config) } qdma_dev.max_vqs = qdma_config->max_vqs; - /* Allocate FLE pool */ - qdma_dev.fle_pool = 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 = 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 == qdma_dev.max_vqs) { rte_spinlock_unlock(&qdma_dev.lock); + DPAA2_QDMA_ERR("Unable to get lock on QDMA device"); return -ENODEV; } @@ -793,9 +799,6 @@ dpaa2_dpdmai_dev_uninit(struct rte_rawdev *rawdev) DPAA2_QDMA_FUNC_TRACE(); - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return 0; - /* Remove HW queues from global list */ remove_hw_queues_from_list(dpdmai_dev); @@ -834,10 +837,6 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) DPAA2_QDMA_FUNC_TRACE(); - /* For secondary processes, the primary has done all the work */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) - return 0; - /* Open DPDMAI device */ dpdmai_dev->dpdmai_id = dpdmai_id; dpdmai_dev->dpdmai.regs = rte_mcp_ptr_list[MC_PORTAL_INDEX];