crypto/virtio: allocate private data by NUMA affinity
authorXiao Wang <xiao.w.wang@intel.com>
Wed, 4 Sep 2019 13:21:51 +0000 (21:21 +0800)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 9 Oct 2019 09:50:12 +0000 (11:50 +0200)
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.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Reviewed-by: Jay Zhou <jianjay.zhou@huawei.com>
drivers/crypto/virtio/virtio_cryptodev.c

index f16bdfe..4af479f 100644 (file)
@@ -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];