From patchwork Thu Apr 4 11:04:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 161770 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1450724jan; Thu, 4 Apr 2019 04:04:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgybSck9Ff4eLggoTqCfmF3YRod8ILtLC0qQny/2HIzmagXxL5qa7nMc4vN43bxBjcsZpd X-Received: by 2002:a17:906:e5a:: with SMTP id q26mr3219286eji.50.1554375881337; Thu, 04 Apr 2019 04:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554375881; cv=none; d=google.com; s=arc-20160816; b=n5OrdpbgHJ4l6Vh5znRSQ1nThOP8wgpzV+MFrxLGXhR3kVPEG0IiOCzUzy6YziPnyJ fqHbXPWI6IvVebGUcZ74mkLH0EnAFXOUwKM9fHyo1SLaADc2htB1Iyy+vBGvevGjAlun pmeNy1l8TOwT5NvT3USnI4VcXI/YeYVyYFfhGkyGxZetrqhTQ/M1ktckU5Uddep0m6No oAB8b/31ppUnmYACCKJH4Z7Qou6HZW1QEqe6eqgTJaOb7ThmLVT+VASy+oWHDOjXsP01 QG8JedBi18zuQc7r4ZmL2B5viyYTd8YMzmhDxyFyfxeZFx2zv0uCbh9B6XFa9faUS6Jt Bs6A== 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=q1JJ6Wnp31xCdPBI3Iqsw7yQxYF7nYUBScc9tdSGTSc=; b=Bndcm98gmfmk4RkPkobQbBugcaLlORDNnpT4hk/AbyixwW4B++G/HfYfSOk3QnP/Bf yFS7fJ76hcuYs4K/1gE8ufdM9rEgZG+mEef0dzTkXkuR1bnH9GozUz38wdR1VxKgZfy8 OhHYnLPjKCY8OKfdutJO/2U6oR0mej1K+afXw3wesha6nvCK9JujC+YC4JMBrJuCwMUg Njevsqm60SzItNOmXYdYVwbZe//OCEJx+cKRcYW1LihwShsVsw4H0ILjlSAUIAQh2Hf/ z7jXhwFN737GBlpaK51QqVA4kVG+fSFYX9QDY36L7+eNN14c+UAx6DW3NOCXGWzwW8Gc 93DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=HF24TYHF; 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 12si3814ejv.310.2019.04.04.04.04.41; Thu, 04 Apr 2019 04:04:41 -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=HF24TYHF; 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 3B23D1B1E8; Thu, 4 Apr 2019 13:04:28 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150078.outbound.protection.outlook.com [40.107.15.78]) by dpdk.org (Postfix) with ESMTP id 969321B144; Thu, 4 Apr 2019 13:04:23 +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=HF24TYHFwuewsXI7Hk5RLWBRKG6A+56g6a2rmZnoM8SFC9C7AMdJ+3z2+GZ2QHEk9aIgOrPES4+IzM0+Qo1J6BgUmTHOmEAV5Wy9nDS57+opiIkqWaS5N4r1EO8e2HiOypG79ie9ZYytUenTTa1D9sbREAYPKdZZWFT+W0hkwlU= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2543.eurprd04.prod.outlook.com (10.168.65.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.19; Thu, 4 Apr 2019 11:04:22 +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:04:22 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: "thomas@monjalon.net" , Shreyansh Jain , Nipun Gupta , "stable@dpdk.org" Thread-Topic: [PATCH v2 3/7] raw/dpaa2_qdma: fix to support multiprocess execution Thread-Index: AQHU6tYoXFQkoF8GtkK25ApxjIn9/w== Date: Thu, 4 Apr 2019 11:04:22 +0000 Message-ID: <20190404110215.14410-3-hemant.agrawal@nxp.com> References: <20190326121610.28024-1-hemant.agrawal@nxp.com> <20190404110215.14410-1-hemant.agrawal@nxp.com> In-Reply-To: <20190404110215.14410-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: BMXPR01CA0041.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::27) 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: 7a1c54a1-44f9-4472-385c-08d6b8ed4ab7 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:VI1PR0401MB2543; x-ms-traffictypediagnostic: VI1PR0401MB2543: x-microsoft-antispam-prvs: x-forefront-prvs: 0997523C40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(346002)(396003)(366004)(39860400002)(199004)(189003)(6916009)(6486002)(53936002)(50226002)(2906002)(8936002)(2616005)(86362001)(54906003)(7736002)(11346002)(44832011)(486006)(316002)(8676002)(6512007)(446003)(1076003)(66066001)(5640700003)(99286004)(3846002)(6116002)(478600001)(386003)(5660300002)(26005)(81166006)(25786009)(1730700003)(76176011)(68736007)(102836004)(476003)(14454004)(4326008)(71200400001)(105586002)(81156014)(97736004)(256004)(14444005)(2501003)(186003)(2351001)(106356001)(6436002)(305945005)(71190400001)(52116002)(6506007)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2543; 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: wnvdOO8q+eFOu4w6Ye63DjAtYXv//1eU40ibtg9etLc4+TJsT4gY4KPybT4LzE4/NuwwSdCBDHnRYvClnF+kjg02Ev1d4ru8eV7jW2fDkxLDrzbLGfF1dRflAnDhUPn6WRiqjTPzkBpSIDAFrmakS2Ar0ZuXJCjaMTohzTv7PBeRO7Hc4k8rdhDAXovipyoPWtZis9TpauGkxhc2YUdmrCf+FLvfXIJd4NtBtnLq4z5bj/FCLzHG+cFBoUIjOOmrCpgdpYe8zERoU4ImKMD2F2IvC0dOZx/3ggOFpKN6QsDMedfowhGaErohwZvkS46BDUpt1SJTVxKO7l7ClznI7TcXbkqBTgiwIEf81wpBElc9tgdTvRski3WCyraRVzl4Ismk0sNI30YO2sksOrhqFsBZykd1sj9yi+Ybe+bDMyU= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a1c54a1-44f9-4472-385c-08d6b8ed4ab7 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 11:04:22.4349 (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: VI1PR0401MB2543 Subject: [dpdk-dev] [PATCH v2 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" 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(-) -- 2.17.1 diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_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 */ #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 = 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];