DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] raw/ioat: add secondary process support
@ 2020-11-21  2:09 Kumar Amber
  2021-01-04 13:31 ` [dpdk-dev] [PATCH v2] " Kumar Amber
  0 siblings, 1 reply; 15+ messages in thread
From: Kumar Amber @ 2020-11-21  2:09 UTC (permalink / raw)
  To: dev

add the secondart process support in dsa
and ioat for cbdma

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
---
 drivers/raw/ioat/ioat_common.c | 18 +++++++++++++++---
 drivers/raw/ioat/ioat_rawdev.c | 19 +++++++++++++++----
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c
index 142e171bc9..e5a0bac8ab 100644
--- a/drivers/raw/ioat/ioat_common.c
+++ b/drivers/raw/ioat/ioat_common.c
@@ -215,11 +215,23 @@ idxd_rawdev_create(const char *name, struct rte_device *dev,
 		goto cleanup;
 	}
 
+	/*
+	* Check for primary than allocate memory
+	* else return the memory from primary
+	* memzone.
+	*/
 	snprintf(mz_name, sizeof(mz_name), "rawdev%u_private", rawdev->dev_id);
-	mz = rte_memzone_reserve(mz_name, sizeof(struct idxd_rawdev),
-			dev->numa_node, RTE_MEMZONE_IOVA_CONTIG);
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		mz = rte_memzone_lookup(mz_name);
+		rawdev->dev_private = mz->addr;
+		return 0;
+	}
+	mz = rte_memzone_reserve(mz_name,
+			sizeof(struct rte_ioat_rawdev),
+			dev->numa_node,
+			RTE_MEMZONE_IOVA_CONTIG);
 	if (mz == NULL) {
-		IOAT_PMD_ERR("Unable to reserve memzone for private data\n");
+		IOAT_PMD_ERR("Unable to reserve memzone\n");
 		ret = -ENOMEM;
 		goto cleanup;
 	}
diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
index 2c88b4369f..0fd9ebc60d 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -165,15 +165,26 @@ ioat_rawdev_create(const char *name, struct rte_pci_device *dev)
 		goto cleanup;
 	}
 
+	/*
+	* Check for primary than allocate memory
+	* else return the memory from primary
+	* memzone.
+	*/
 	snprintf(mz_name, sizeof(mz_name), "rawdev%u_private", rawdev->dev_id);
-	mz = rte_memzone_reserve(mz_name, sizeof(struct rte_ioat_rawdev),
-			dev->device.numa_node, RTE_MEMZONE_IOVA_CONTIG);
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+		mz = rte_memzone_lookup(mz_name);
+		rawdev->dev_private = mz->addr;
+		return 0;
+	}
+	mz = rte_memzone_reserve(mz_name,
+			sizeof(struct rte_ioat_rawdev),
+			dev->device.numa_node,
+			RTE_MEMZONE_IOVA_CONTIG);
 	if (mz == NULL) {
-		IOAT_PMD_ERR("Unable to reserve memzone for private data\n");
+		IOAT_PMD_ERR("Unable to reserve memzone\n");
 		ret = -ENOMEM;
 		goto cleanup;
 	}
-
 	rawdev->dev_private = mz->addr;
 	rawdev->dev_ops = &ioat_rawdev_ops;
 	rawdev->device = &dev->device;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-01-17 21:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-21  2:09 [dpdk-dev] [PATCH v1] raw/ioat: add secondary process support Kumar Amber
2021-01-04 13:31 ` [dpdk-dev] [PATCH v2] " Kumar Amber
2021-01-04 16:28   ` [dpdk-dev] [PATCH v3] " Kumar Amber
2021-01-04 16:30     ` [dpdk-dev] [PATCH v4] " Kumar Amber
2021-01-06 14:07       ` Bruce Richardson
2021-01-07  4:00       ` [dpdk-dev] [PATCH v5] " Kumar Amber
2021-01-07  5:05         ` [dpdk-dev] [PATCH v6] " Kumar Amber
2021-01-07 12:23           ` [dpdk-dev] [PATCH v7] " Kumar Amber
2021-01-07 12:37             ` Bruce Richardson
2021-01-08 13:44             ` [dpdk-dev] [PATCH v8] " Kumar Amber
2021-01-08 14:03               ` Bruce Richardson
2021-01-08 16:08               ` [dpdk-dev] [PATCH v9] " Kumar Amber
2021-01-08 16:52                 ` Kumar Amber
2021-01-08 17:05                   ` Bruce Richardson
2021-01-17 21:53                     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).