DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/qat: fix qp numa node
@ 2019-03-26 14:20 Tomasz Jozwiak
  2019-03-26 14:20 ` Tomasz Jozwiak
  2019-03-28 15:00 ` Trahe, Fiona
  0 siblings, 2 replies; 6+ messages in thread
From: Tomasz Jozwiak @ 2019-03-26 14:20 UTC (permalink / raw)
  To: dev, stable, fiona.trahe, tomaszx.jozwiak

This patch assigns QAT queue pair resources to the correct NUMA nodes.
Any DMA'able memory should use NUMA node of QAT device
rather than socket_id of the initializing process.

Fixes: 98c4a35c736f ("crypto/qat: move common qat files to common dir")
Fixes: a795248d740b ("compress/qat: add configure and clear functions")
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 drivers/common/qat/qat_qp.c         | 14 ++++++++------
 drivers/compress/qat/qat_comp_pmd.c |  7 ++++---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index 4e66c58..935ec3f 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -211,16 +211,17 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	}
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc("qat PMD qp metadata",
-			sizeof(*qp), RTE_CACHE_LINE_SIZE);
+	qp = rte_zmalloc_socket("qat PMD qp metadata",
+				sizeof(*qp), RTE_CACHE_LINE_SIZE,
+				qat_qp_conf->socket_id);
 	if (qp == NULL) {
 		QAT_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
 	}
 	qp->nb_descriptors = qat_qp_conf->nb_descriptors;
-	qp->op_cookies = rte_zmalloc("qat PMD op cookie pointer",
+	qp->op_cookies = rte_zmalloc_socket("qat PMD op cookie pointer",
 			qat_qp_conf->nb_descriptors * sizeof(*qp->op_cookies),
-			RTE_CACHE_LINE_SIZE);
+			RTE_CACHE_LINE_SIZE, qat_qp_conf->socket_id);
 	if (qp->op_cookies == NULL) {
 		QAT_LOG(ERR, "Failed to alloc mem for cookie");
 		rte_free(qp);
@@ -260,7 +261,8 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 		qp->op_cookie_pool = rte_mempool_create(op_cookie_pool_name,
 				qp->nb_descriptors,
 				qat_qp_conf->cookie_size, 64, 0,
-				NULL, NULL, NULL, NULL, qat_qp_conf->socket_id,
+				NULL, NULL, NULL, NULL,
+				qat_dev->pci_dev->device.numa_node,
 				0);
 	if (!qp->op_cookie_pool) {
 		QAT_LOG(ERR, "QAT PMD Cannot create"
@@ -388,7 +390,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 		qp_conf->service_str, "qp_mem",
 		queue->hw_bundle_number, queue->hw_queue_number);
 	qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,
-			qp_conf->socket_id);
+			qat_dev->pci_dev->device.numa_node);
 	if (qp_mz == NULL) {
 		QAT_LOG(ERR, "Failed to allocate ring memzone");
 		return -ENOMEM;
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index 27c8856..1d16bc3 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -239,7 +239,8 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,
 
 static struct rte_mempool *
 qat_comp_create_xform_pool(struct qat_comp_dev_private *comp_dev,
-			      uint32_t num_elements)
+			   struct rte_compressdev_config *config,
+			   uint32_t num_elements)
 {
 	char xform_pool_name[RTE_MEMPOOL_NAMESIZE];
 	struct rte_mempool *mp;
@@ -264,7 +265,7 @@ qat_comp_create_xform_pool(struct qat_comp_dev_private *comp_dev,
 		mp = rte_mempool_create(xform_pool_name,
 				num_elements,
 				qat_comp_xform_size(), 0, 0,
-				NULL, NULL, NULL, NULL, rte_socket_id(),
+				NULL, NULL, NULL, NULL, config->socket_id,
 				0);
 	if (mp == NULL) {
 		QAT_LOG(ERR, "Err creating mempool %s w %d elements of size %d",
@@ -320,7 +321,7 @@ qat_comp_dev_config(struct rte_compressdev *dev,
 		}
 	}
 
-	comp_dev->xformpool = qat_comp_create_xform_pool(comp_dev,
+	comp_dev->xformpool = qat_comp_create_xform_pool(comp_dev, config,
 					config->max_nb_priv_xforms);
 	if (comp_dev->xformpool == NULL) {
 
-- 
2.7.4

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

* [dpdk-dev] [PATCH] drivers/qat: fix qp numa node
  2019-03-26 14:20 [dpdk-dev] [PATCH] drivers/qat: fix qp numa node Tomasz Jozwiak
@ 2019-03-26 14:20 ` Tomasz Jozwiak
  2019-03-28 15:00 ` Trahe, Fiona
  1 sibling, 0 replies; 6+ messages in thread
From: Tomasz Jozwiak @ 2019-03-26 14:20 UTC (permalink / raw)
  To: dev, stable, fiona.trahe, tomaszx.jozwiak

This patch assigns QAT queue pair resources to the correct NUMA nodes.
Any DMA'able memory should use NUMA node of QAT device
rather than socket_id of the initializing process.

Fixes: 98c4a35c736f ("crypto/qat: move common qat files to common dir")
Fixes: a795248d740b ("compress/qat: add configure and clear functions")
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 drivers/common/qat/qat_qp.c         | 14 ++++++++------
 drivers/compress/qat/qat_comp_pmd.c |  7 ++++---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index 4e66c58..935ec3f 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -211,16 +211,17 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 	}
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc("qat PMD qp metadata",
-			sizeof(*qp), RTE_CACHE_LINE_SIZE);
+	qp = rte_zmalloc_socket("qat PMD qp metadata",
+				sizeof(*qp), RTE_CACHE_LINE_SIZE,
+				qat_qp_conf->socket_id);
 	if (qp == NULL) {
 		QAT_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
 	}
 	qp->nb_descriptors = qat_qp_conf->nb_descriptors;
-	qp->op_cookies = rte_zmalloc("qat PMD op cookie pointer",
+	qp->op_cookies = rte_zmalloc_socket("qat PMD op cookie pointer",
 			qat_qp_conf->nb_descriptors * sizeof(*qp->op_cookies),
-			RTE_CACHE_LINE_SIZE);
+			RTE_CACHE_LINE_SIZE, qat_qp_conf->socket_id);
 	if (qp->op_cookies == NULL) {
 		QAT_LOG(ERR, "Failed to alloc mem for cookie");
 		rte_free(qp);
@@ -260,7 +261,8 @@ int qat_qp_setup(struct qat_pci_device *qat_dev,
 		qp->op_cookie_pool = rte_mempool_create(op_cookie_pool_name,
 				qp->nb_descriptors,
 				qat_qp_conf->cookie_size, 64, 0,
-				NULL, NULL, NULL, NULL, qat_qp_conf->socket_id,
+				NULL, NULL, NULL, NULL,
+				qat_dev->pci_dev->device.numa_node,
 				0);
 	if (!qp->op_cookie_pool) {
 		QAT_LOG(ERR, "QAT PMD Cannot create"
@@ -388,7 +390,7 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,
 		qp_conf->service_str, "qp_mem",
 		queue->hw_bundle_number, queue->hw_queue_number);
 	qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes,
-			qp_conf->socket_id);
+			qat_dev->pci_dev->device.numa_node);
 	if (qp_mz == NULL) {
 		QAT_LOG(ERR, "Failed to allocate ring memzone");
 		return -ENOMEM;
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index 27c8856..1d16bc3 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -239,7 +239,8 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,
 
 static struct rte_mempool *
 qat_comp_create_xform_pool(struct qat_comp_dev_private *comp_dev,
-			      uint32_t num_elements)
+			   struct rte_compressdev_config *config,
+			   uint32_t num_elements)
 {
 	char xform_pool_name[RTE_MEMPOOL_NAMESIZE];
 	struct rte_mempool *mp;
@@ -264,7 +265,7 @@ qat_comp_create_xform_pool(struct qat_comp_dev_private *comp_dev,
 		mp = rte_mempool_create(xform_pool_name,
 				num_elements,
 				qat_comp_xform_size(), 0, 0,
-				NULL, NULL, NULL, NULL, rte_socket_id(),
+				NULL, NULL, NULL, NULL, config->socket_id,
 				0);
 	if (mp == NULL) {
 		QAT_LOG(ERR, "Err creating mempool %s w %d elements of size %d",
@@ -320,7 +321,7 @@ qat_comp_dev_config(struct rte_compressdev *dev,
 		}
 	}
 
-	comp_dev->xformpool = qat_comp_create_xform_pool(comp_dev,
+	comp_dev->xformpool = qat_comp_create_xform_pool(comp_dev, config,
 					config->max_nb_priv_xforms);
 	if (comp_dev->xformpool == NULL) {
 
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH] drivers/qat: fix qp numa node
  2019-03-26 14:20 [dpdk-dev] [PATCH] drivers/qat: fix qp numa node Tomasz Jozwiak
  2019-03-26 14:20 ` Tomasz Jozwiak
@ 2019-03-28 15:00 ` Trahe, Fiona
  2019-03-28 15:00   ` Trahe, Fiona
  2019-03-29 15:36   ` Akhil Goyal
  1 sibling, 2 replies; 6+ messages in thread
From: Trahe, Fiona @ 2019-03-28 15:00 UTC (permalink / raw)
  To: Jozwiak, TomaszX, dev, stable; +Cc: Trahe, Fiona



> -----Original Message-----
> From: Jozwiak, TomaszX
> Sent: Tuesday, March 26, 2019 2:21 PM
> To: dev@dpdk.org; stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>
> Subject: [PATCH] drivers/qat: fix qp numa node
> 
> This patch assigns QAT queue pair resources to the correct NUMA nodes.
> Any DMA'able memory should use NUMA node of QAT device
> rather than socket_id of the initializing process.
> 
> Fixes: 98c4a35c736f ("crypto/qat: move common qat files to common dir")
> Fixes: a795248d740b ("compress/qat: add configure and clear functions")
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>

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

* Re: [dpdk-dev] [PATCH] drivers/qat: fix qp numa node
  2019-03-28 15:00 ` Trahe, Fiona
@ 2019-03-28 15:00   ` Trahe, Fiona
  2019-03-29 15:36   ` Akhil Goyal
  1 sibling, 0 replies; 6+ messages in thread
From: Trahe, Fiona @ 2019-03-28 15:00 UTC (permalink / raw)
  To: Jozwiak, TomaszX, dev, stable; +Cc: Trahe, Fiona



> -----Original Message-----
> From: Jozwiak, TomaszX
> Sent: Tuesday, March 26, 2019 2:21 PM
> To: dev@dpdk.org; stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>
> Subject: [PATCH] drivers/qat: fix qp numa node
> 
> This patch assigns QAT queue pair resources to the correct NUMA nodes.
> Any DMA'able memory should use NUMA node of QAT device
> rather than socket_id of the initializing process.
> 
> Fixes: 98c4a35c736f ("crypto/qat: move common qat files to common dir")
> Fixes: a795248d740b ("compress/qat: add configure and clear functions")
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>


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

* Re: [dpdk-dev] [PATCH] drivers/qat: fix qp numa node
  2019-03-28 15:00 ` Trahe, Fiona
  2019-03-28 15:00   ` Trahe, Fiona
@ 2019-03-29 15:36   ` Akhil Goyal
  2019-03-29 15:36     ` Akhil Goyal
  1 sibling, 1 reply; 6+ messages in thread
From: Akhil Goyal @ 2019-03-29 15:36 UTC (permalink / raw)
  To: Trahe, Fiona, Jozwiak, TomaszX, dev, stable



On 3/28/2019 8:30 PM, Trahe, Fiona wrote:
>
>> -----Original Message-----
>> From: Jozwiak, TomaszX
>> Sent: Tuesday, March 26, 2019 2:21 PM
>> To: dev@dpdk.org; stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
>> <tomaszx.jozwiak@intel.com>
>> Subject: [PATCH] drivers/qat: fix qp numa node
>>
>> This patch assigns QAT queue pair resources to the correct NUMA nodes.
>> Any DMA'able memory should use NUMA node of QAT device
>> rather than socket_id of the initializing process.
>>
>> Fixes: 98c4a35c736f ("crypto/qat: move common qat files to common dir")
>> Fixes: a795248d740b ("compress/qat: add configure and clear functions")
>> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
>
Applied to dpdk-next-crypto

Thanks.

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

* Re: [dpdk-dev] [PATCH] drivers/qat: fix qp numa node
  2019-03-29 15:36   ` Akhil Goyal
@ 2019-03-29 15:36     ` Akhil Goyal
  0 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2019-03-29 15:36 UTC (permalink / raw)
  To: Trahe, Fiona, Jozwiak, TomaszX, dev, stable



On 3/28/2019 8:30 PM, Trahe, Fiona wrote:
>
>> -----Original Message-----
>> From: Jozwiak, TomaszX
>> Sent: Tuesday, March 26, 2019 2:21 PM
>> To: dev@dpdk.org; stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Jozwiak, TomaszX
>> <tomaszx.jozwiak@intel.com>
>> Subject: [PATCH] drivers/qat: fix qp numa node
>>
>> This patch assigns QAT queue pair resources to the correct NUMA nodes.
>> Any DMA'able memory should use NUMA node of QAT device
>> rather than socket_id of the initializing process.
>>
>> Fixes: 98c4a35c736f ("crypto/qat: move common qat files to common dir")
>> Fixes: a795248d740b ("compress/qat: add configure and clear functions")
>> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
>
Applied to dpdk-next-crypto

Thanks.

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

end of thread, other threads:[~2019-03-29 15:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 14:20 [dpdk-dev] [PATCH] drivers/qat: fix qp numa node Tomasz Jozwiak
2019-03-26 14:20 ` Tomasz Jozwiak
2019-03-28 15:00 ` Trahe, Fiona
2019-03-28 15:00   ` Trahe, Fiona
2019-03-29 15:36   ` Akhil Goyal
2019-03-29 15:36     ` Akhil Goyal

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).