[PATCH] net/idpf: propagate PCI NUMA node to vport ethdev

Shaiq Wani <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
The IDPF driver creates vport ethdevs via rte_eth_dev_create() with a
NULL bus_specific_init callback, bypassing the standard PCI probe path
that normally copies the PCI device's NUMA node into
eth_dev->data->numa_node via rte_eth_copy_pci_info().

As a result, rte_eth_dev_socket_id() always returns 0 regardless of
which NUMA node the device is attached to, causing NUMA-unaware memory
allocations for mempools and queue descriptors on multi-socket systems.

Set dev->data->numa_node explicitly from the parent PCI device in
idpf_dev_vport_init() to restore correct NUMA affinity.

Fixes: 5e0f60527e5b ("net/idpf: remove vport req and recv info from adapter")
Cc: [email protected]

Signed-off-by: Shaiq Wani <[email protected]>
---
 drivers/net/intel/idpf/idpf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/intel/idpf/idpf_ethdev.c b/drivers/net/intel/idpf/idpf_ethdev.c
index c13505416a..965de4ed9d 100644
--- a/drivers/net/intel/idpf/idpf_ethdev.c
+++ b/drivers/net/intel/idpf/idpf_ethdev.c
@@ -1565,6 +1565,7 @@ idpf_dev_vport_init(struct rte_eth_dev *dev, void *init_params)
 	int ret = 0;
 
 	dev->dev_ops = &idpf_eth_dev_ops;
+	dev->data->numa_node = dev->device->numa_node;
 	vport->adapter = &adapter->base;
 	vport->sw_idx = param->idx;
 	vport->devarg_id = param->devarg_id;
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.