Skip to contentSkip to conversation

crypto/virtio: alloc private data by NUMA affinity

PATCH Applied Xiao Wang 3 participants 5 messages Sep 4, 2019 – Oct 9, 2019

Subsystems (3)
lore
Share & tools
lore

Xiao Wang

author
#0 lore raw

PATCH 1/1 crypto/virtio: alloc private data by NUMA affinity

It's better to allocate device private data on the same NUMA node with device, rather than with the main thread. This helps avoid cross-NUMA access for worker thread.

---
 drivers/crypto/virtio/virtio_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/virtio/virtio_cryptodev.c +1 -1
index f16bdfe57..4af479f54 100644
@@ -1441,7 +1441,7 @@ crypto_virtio_pci_probe(
 {
 	struct rte_cryptodev_pmd_init_params init_params = {
 		.name = "",
-		.socket_id = rte_socket_id(),
+		.socket_id = pci_dev->device.numa_node,
 		.private_data_size = sizeof(struct virtio_crypto_hw)
 	};
 	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
Signature · 1 line
2.15.1
#1 lore raw

Hi Jay,

Could you please review this change.

Thanks,
Akhil

Quoted 26 lines

It's better to allocate device private data on the same NUMA node with device, rather than with the main thread. This helps avoid cross-NUMA access for worker thread.

---
 drivers/crypto/virtio/virtio_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/virtio/virtio_cryptodev.c +1 -2
index f16bdfe57..4af479f54 100644
@@ -1441,7 +1441,7 @@ crypto_virtio_pci_probe(
 {
 	struct rte_cryptodev_pmd_init_params init_params = {
 		.name = "",
-		.socket_id = rte_socket_id(),
+		.socket_id = pci_dev->device.numa_node,
 		.private_data_size = sizeof(struct virtio_crypto_hw)
 	};
 	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--

2.15.1

#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Akhil Goyal [mailto:[email protected]]
Sent: Friday, October 4, 2019 8:00 PM
To: Zhoujian (jay) <[email protected]>
Cc: [email protected]; Xiao Wang <[email protected]>
Subject: RE: [dpdk-dev] [PATCH] crypto/virtio: alloc private data by NUMA affinity

Quoted 6 lines

Hi Jay,

Could you please review this change.

Thanks,
Akhil

Hi Akhil,

Sure, sorry for the late response.

Thanks,
Jay

Quoted 26 lines
Quoted 26 lines

It's better to allocate device private data on the same NUMA node with device, rather than with the main thread. This helps avoid cross-NUMA access for worker thread.

---
 drivers/crypto/virtio/virtio_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/virtio/virtio_cryptodev.c +1 -2
index f16bdfe57..4af479f54 100644
@@ -1441,7 +1441,7 @@ crypto_virtio_pci_probe(  {
 	struct rte_cryptodev_pmd_init_params init_params = {
 		.name = "",
-		.socket_id = rte_socket_id(),
+		.socket_id = pci_dev->device.numa_node,
 		.private_data_size = sizeof(struct virtio_crypto_hw)
 	};
 	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--

2.15.1

Reviewed-by on v1 1/1
#3 lore raw
In reply to Xiao Wang
Quoted 9 lines

-----Original Message-----
From: Xiao Wang [mailto:[email protected]]
Sent: Wednesday, September 4, 2019 9:22 PM
To: Zhoujian (jay) <[email protected]>
Cc: [email protected]; Xiao Wang <[email protected]>
Subject: [PATCH] crypto/virtio: alloc private data by NUMA affinity

Quoted 5 lines

It's better to allocate device private data on the same NUMA node with device, rather than with the main thread. This helps avoid cross-NUMA access for worker thread.

Quoted 19 lines
---
 drivers/crypto/virtio/virtio_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/virtio/virtio_cryptodev.c +1 -2
index f16bdfe57..4af479f54 100644
@@ -1441,7 +1441,7 @@ crypto_virtio_pci_probe(  {
 	struct rte_cryptodev_pmd_init_params init_params = {
 		.name = "",
-		.socket_id = rte_socket_id(),
+		.socket_id = pci_dev->device.numa_node,
 		.private_data_size = sizeof(struct virtio_crypto_hw)
 	};
 	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
--

2.15.1