[PATCH 102/227] net/af_packet: use NUMA node terminology
Chengwen Feng
chengwen.feng at linux.dev
Tue Nov 3 15:51:00 CET 2026
From: Chengwen Feng <fengchengwen at huawei.com>
Rename socket_id parameters, internal structure fields, variables
and comments to the NUMA node terminology, and switch calls to
the NUMA-named APIs.
Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
drivers/net/af_packet/rte_eth_af_packet.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 44f82c0309..ad59d3dd7d 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -599,7 +599,7 @@ eth_dev_close(struct rte_eth_dev *dev)
return 0;
PMD_LOG(INFO, "Closing AF_PACKET ethdev on NUMA socket %u",
- rte_socket_id());
+ rte_numa_id());
internals = dev->data->dev_private;
req = &internals->req;
@@ -656,7 +656,7 @@ static int
eth_rx_queue_setup(struct rte_eth_dev *dev,
uint16_t rx_queue_id,
uint16_t nb_rx_desc __rte_unused,
- unsigned int socket_id __rte_unused,
+ unsigned int numa_id __rte_unused,
const struct rte_eth_rxconf *rx_conf __rte_unused,
struct rte_mempool *mb_pool)
{
@@ -694,7 +694,7 @@ static int
eth_tx_queue_setup(struct rte_eth_dev *dev,
uint16_t tx_queue_id,
uint16_t nb_tx_desc __rte_unused,
- unsigned int socket_id __rte_unused,
+ unsigned int numa_id __rte_unused,
const struct rte_eth_txconf *tx_conf __rte_unused)
{
@@ -933,17 +933,17 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
"%s: creating AF_PACKET-backed ethdev on numa socket %u",
name, numa_node);
- *internals = rte_zmalloc_socket(name, sizeof(**internals),
+ *internals = rte_zmalloc_numa(name, sizeof(**internals),
0, numa_node);
if (*internals == NULL)
return -1;
- (*internals)->rx_queue = rte_calloc_socket("af_packet_rx",
+ (*internals)->rx_queue = rte_calloc_numa("af_packet_rx",
nb_queues,
sizeof(struct pkt_rx_queue),
0, numa_node);
- (*internals)->tx_queue = rte_calloc_socket("af_packet_tx",
+ (*internals)->tx_queue = rte_calloc_numa("af_packet_tx",
nb_queues,
sizeof(struct pkt_tx_queue),
0, numa_node);
@@ -979,7 +979,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
PMD_LOG_ERRNO(ERR, "%s: ioctl failed (SIOCGIFINDEX)", name);
goto free_internals;
}
- (*internals)->if_name = rte_malloc_socket(name, ifnamelen + 1, 0, numa_node);
+ (*internals)->if_name = rte_malloc_numa(name, ifnamelen + 1, 0, numa_node);
if ((*internals)->if_name == NULL)
goto free_internals;
strlcpy((*internals)->if_name, pair->value, ifnamelen + 1);
@@ -1098,7 +1098,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
/* rdsize is same for both Tx and Rx */
rdsize = req->tp_frame_nr * sizeof(*(rx_queue->rd));
- rx_queue->rd = rte_zmalloc_socket(name, rdsize, 0, numa_node);
+ rx_queue->rd = rte_zmalloc_numa(name, rdsize, 0, numa_node);
if (rx_queue->rd == NULL)
goto error;
for (i = 0; i < req->tp_frame_nr; ++i) {
@@ -1115,7 +1115,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
tx_queue->map = rx_queue->map + req->tp_block_size * req->tp_block_nr;
- tx_queue->rd = rte_zmalloc_socket(name, rdsize, 0, numa_node);
+ tx_queue->rd = rte_zmalloc_numa(name, rdsize, 0, numa_node);
if (tx_queue->rd == NULL)
goto error;
for (i = 0; i < req->tp_frame_nr; ++i) {
@@ -1406,8 +1406,8 @@ rte_pmd_af_packet_probe(struct rte_vdev_device *dev)
goto exit;
}
- if (dev->device.numa_node == SOCKET_ID_ANY)
- dev->device.numa_node = rte_socket_id();
+ if (dev->device.numa_node == RTE_NUMA_ID_ANY)
+ dev->device.numa_node = rte_numa_id();
ret = rte_eth_from_packet(dev, &sockfd, kvlist);
close(sockfd); /* no longer needed */
--
2.55.0
More information about the dev
mailing list