[PATCH v8 08/49] net/sxe2: use base device name for representor naming

liujie5 at linkdatatechnology.com liujie5 at linkdatatechnology.com
Tue Sep 1 05:06:01 CEST 2026


From: Jie Liu <liujie5 at linkdatatechnology.com>

Update the representor device naming to use the base device name
prefix, and set the numa_node from the parent device data so that
representor devices are allocated on the same NUMA node.

Cc: stephen at networkplumber.org
Signed-off-by: Jie Liu <liujie5 at linkdatatechnology.com>
---
 drivers/net/sxe2/sxe2_ethdev_repr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/sxe2/sxe2_ethdev_repr.c b/drivers/net/sxe2/sxe2_ethdev_repr.c
index c698baafe0..6f5642ad5d 100644
--- a/drivers/net/sxe2/sxe2_ethdev_repr.c
+++ b/drivers/net/sxe2/sxe2_ethdev_repr.c
@@ -552,9 +552,8 @@ int32_t sxe2_switchdev_repr_devs_init(struct sxe2_adapter *adapter,
 	}
 
 	for (repr_idx = 0; repr_idx < req_eth_da->nb_representor_ports; ++repr_idx) {
-		snprintf(name, sizeof(name), "sxe2_representor_c%dpf%d%s%u",
-			 adapter->pf_idx, adapter->pf_idx,
-			 "vf",
+		snprintf(name, sizeof(name), "%s_representor_vf%u",
+			 adapter->cdev->dev->name,
 			 req_eth_da->representor_ports[repr_idx]);
 
 		eth_dev = rte_eth_dev_allocate(name);
@@ -562,10 +561,11 @@ int32_t sxe2_switchdev_repr_devs_init(struct sxe2_adapter *adapter,
 			ret = -ENOMEM;
 			goto l_release_port;
 		}
+		eth_dev->data->numa_node = adapter->dev_info.dev_data->numa_node;
 		eth_dev->data->dev_private = rte_zmalloc_socket(name,
 			sizeof(struct sxe2_adapter),
 			RTE_CACHE_LINE_SIZE,
-			rte_socket_id());
+			eth_dev->data->numa_node);
 
 		if (!eth_dev->data->dev_private) {
 			rte_eth_dev_release_port(eth_dev);
-- 
2.52.0



More information about the dev mailing list