[PATCH 018/227] rib: use NUMA node terminology
Chengwen Feng
chengwen.feng at linux.dev
Tue Nov 3 15:49:36 CET 2026
From: Chengwen Feng <fengchengwen at huawei.com>
Rename socket_id parameters, internal variables and comments to
the NUMA node terminology, and switch internal calls to
rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
lib/rib/rte_rib.c | 8 ++++----
lib/rib/rte_rib.h | 6 +++---
lib/rib/rte_rib6.c | 8 ++++----
lib/rib/rte_rib6.h | 6 +++---
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c
index 046db131ca..e6cf27b68e 100644
--- a/lib/rib/rte_rib.c
+++ b/lib/rib/rte_rib.c
@@ -410,7 +410,7 @@ rte_rib_set_nh(struct rte_rib_node *node, uint64_t nh)
RTE_EXPORT_SYMBOL(rte_rib_create)
struct rte_rib *
-rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)
+rte_rib_create(const char *name, int numa_id, const struct rte_rib_conf *conf)
{
char mem_name[RTE_RIB_NAMESIZE];
struct rte_rib *rib = NULL;
@@ -427,7 +427,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)
snprintf(mem_name, sizeof(mem_name), "MP_%s", name);
node_pool = rte_mempool_create(mem_name, conf->max_nodes,
sizeof(struct rte_rib_node) + conf->ext_sz, 0, 0,
- NULL, NULL, NULL, NULL, socket_id, 0);
+ NULL, NULL, NULL, NULL, numa_id, 0);
if (node_pool == NULL) {
RIB_LOG(ERR,
@@ -462,8 +462,8 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)
}
/* Allocate memory to store the RIB data structures. */
- rib = rte_zmalloc_socket(mem_name,
- sizeof(struct rte_rib), RTE_CACHE_LINE_SIZE, socket_id);
+ rib = rte_zmalloc_numa(mem_name,
+ sizeof(struct rte_rib), RTE_CACHE_LINE_SIZE, numa_id);
if (unlikely(rib == NULL)) {
RIB_LOG(ERR, "RIB %s memory allocation failed", name);
rte_errno = ENOMEM;
diff --git a/lib/rib/rte_rib.h b/lib/rib/rte_rib.h
index c325b3e361..2d3d965d68 100644
--- a/lib/rib/rte_rib.h
+++ b/lib/rib/rte_rib.h
@@ -246,8 +246,8 @@ rte_rib_free(struct rte_rib *rib);
*
* @param name
* RIB name
- * @param socket_id
- * NUMA socket ID for RIB table memory allocation
+ * @param numa_id
+ * NUMA node ID for RIB table memory allocation
* @param conf
* Structure containing the configuration
* @return
@@ -255,7 +255,7 @@ rte_rib_free(struct rte_rib *rib);
* NULL otherwise with rte_errno indicating reason for failure.
*/
struct rte_rib *
-rte_rib_create(const char *name, int socket_id,
+rte_rib_create(const char *name, int numa_id,
const struct rte_rib_conf *conf)
__rte_malloc __rte_dealloc(rte_rib_free, 1);
diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
index 918ddbdfd3..834ad08dad 100644
--- a/lib/rib/rte_rib6.c
+++ b/lib/rib/rte_rib6.c
@@ -472,7 +472,7 @@ rte_rib6_set_nh(struct rte_rib6_node *node, uint64_t nh)
RTE_EXPORT_SYMBOL(rte_rib6_create)
struct rte_rib6 *
-rte_rib6_create(const char *name, int socket_id,
+rte_rib6_create(const char *name, int numa_id,
const struct rte_rib6_conf *conf)
{
char mem_name[RTE_RIB6_NAMESIZE];
@@ -490,7 +490,7 @@ rte_rib6_create(const char *name, int socket_id,
snprintf(mem_name, sizeof(mem_name), "MP_%s", name);
node_pool = rte_mempool_create(mem_name, conf->max_nodes,
sizeof(struct rte_rib6_node) + conf->ext_sz, 0, 0,
- NULL, NULL, NULL, NULL, socket_id, 0);
+ NULL, NULL, NULL, NULL, numa_id, 0);
if (node_pool == NULL) {
RIB_LOG(ERR,
@@ -525,8 +525,8 @@ rte_rib6_create(const char *name, int socket_id,
}
/* Allocate memory to store the RIB6 data structures. */
- rib = rte_zmalloc_socket(mem_name,
- sizeof(struct rte_rib6), RTE_CACHE_LINE_SIZE, socket_id);
+ rib = rte_zmalloc_numa(mem_name,
+ sizeof(struct rte_rib6), RTE_CACHE_LINE_SIZE, numa_id);
if (unlikely(rib == NULL)) {
RIB_LOG(ERR, "RIB6 %s memory allocation failed", name);
rte_errno = ENOMEM;
diff --git a/lib/rib/rte_rib6.h b/lib/rib/rte_rib6.h
index e3fb464ae6..83ac8aa4a3 100644
--- a/lib/rib/rte_rib6.h
+++ b/lib/rib/rte_rib6.h
@@ -235,8 +235,8 @@ rte_rib6_free(struct rte_rib6 *rib);
*
* @param name
* RIB name
- * @param socket_id
- * NUMA socket ID for RIB table memory allocation
+ * @param numa_id
+ * NUMA node ID for RIB table memory allocation
* @param conf
* Structure containing the configuration
* @return
@@ -244,7 +244,7 @@ rte_rib6_free(struct rte_rib6 *rib);
* NULL otherwise with rte_errno indicating reason for failure.
*/
struct rte_rib6 *
-rte_rib6_create(const char *name, int socket_id,
+rte_rib6_create(const char *name, int numa_id,
const struct rte_rib6_conf *conf)
__rte_malloc __rte_dealloc(rte_rib6_free, 1);
--
2.55.0
More information about the dev
mailing list