All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	Shreyansh Jain <shreyansh.jain@nxp.com>,
	Nipun Gupta <nipun.gupta@nxp.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: [PATCH v2 3/7] raw/dpaa2_qdma: fix to support multiprocess execution
Date: Thu, 4 Apr 2019 11:04:22 +0000	[thread overview]
Message-ID: <20190404110215.14410-3-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20190404110215.14410-1-hemant.agrawal@nxp.com>

From: Shreyansh Jain <shreyansh.jain@nxp.com>

Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
Cc: nipun.gupta@nxp.com
Cc: stable@dpdk.org

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 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/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 <string.h>
@@ -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];
-- 
2.17.1

  parent reply	other threads:[~2019-04-04 11:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 12:18 [PATCH 1/5] raw/dpaa2_qdma: remove experimental tag from APIs Hemant Agrawal
2019-03-26 12:18 ` [PATCH 2/5] raw/dpaa2_qdma: fix to support multiprocess execution Hemant Agrawal
2019-03-26 12:18 ` [PATCH 3/5] raw/dpaa2_qdma: add burst mode support Hemant Agrawal
2019-03-26 12:18 ` [PATCH 4/5] raw/dpaa2_qdma: add rbp " Hemant Agrawal
2019-03-29 13:53   ` Thomas Monjalon
2019-03-26 12:18 ` [PATCH 5/5] raw/dpaa2x: remove rte logs from data path Hemant Agrawal
2019-03-29 13:53 ` [PATCH 1/5] raw/dpaa2_qdma: remove experimental tag from APIs Thomas Monjalon
2019-04-01 14:14   ` Hemant Agrawal
2019-04-04 11:04 ` [PATCH v2 1/7] config: increase the num of rawdev to be 64 Hemant Agrawal
2019-04-04 11:04   ` [PATCH v2 2/7] raw/dpaa2_qdma: remove experimental tag from APIs Hemant Agrawal
2019-04-04 11:04   ` Hemant Agrawal [this message]
2019-04-04 11:04   ` [PATCH v2 4/7] raw/dpaa2_qdma: add burst mode support Hemant Agrawal
2019-04-04 11:04   ` [PATCH v2 5/7] raw/dpaa2_qdma: add rbp " Hemant Agrawal
2019-04-04 11:04   ` [PATCH v2 6/7] raw/dpaa2x: remove rte logs from data path Hemant Agrawal
2019-04-04 11:04   ` [PATCH v2 7/7] raw/dpaa2_qdma: add support for non prefetch mode Hemant Agrawal
2019-04-04 11:07   ` [PATCH v2 1/7] config: increase the num of rawdev to be 64 Richardson, Bruce
2019-04-04 11:52     ` Hemant Agrawal
2019-04-04 11:50   ` [PATCH v3 " Hemant Agrawal
2019-04-04 11:50     ` [PATCH v3 2/7] raw/dpaa2_qdma: remove experimental tag from APIs Hemant Agrawal
2019-04-04 11:50     ` [PATCH v3 3/7] raw/dpaa2_qdma: fix to support multiprocess execution Hemant Agrawal
2019-04-04 11:50     ` [PATCH v3 4/7] raw/dpaa2_qdma: add burst mode support Hemant Agrawal
2019-04-04 11:50     ` [PATCH v3 5/7] raw/dpaa2_qdma: add rbp " Hemant Agrawal
2019-04-04 11:50     ` [PATCH v3 6/7] raw/dpaa2x: remove rte logs from data path Hemant Agrawal
2019-04-04 11:50     ` [PATCH v3 7/7] raw/dpaa2_qdma: add support for non prefetch mode Hemant Agrawal
2019-04-04 13:04     ` [PATCH v3 1/7] config: increase the num of rawdev to be 64 Bruce Richardson
2019-04-04 23:07       ` [dpdk-dev] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404110215.14410-3-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=nipun.gupta@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.