[PATCH 219/227] examples/vhost_crypto: use NUMA node terminology
Chengwen Feng
chengwen.feng at linux.dev
Tue Nov 3 15:52:57 CET 2026
From: Chengwen Feng <fengchengwen at huawei.com>
Rename socket_id parameters, local 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>
---
examples/vhost_crypto/main.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c
index 53bd8fa825..7f28d507f1 100644
--- a/examples/vhost_crypto/main.c
+++ b/examples/vhost_crypto/main.c
@@ -313,7 +313,7 @@ new_device(int vid)
}
ret = rte_vhost_crypto_create(vid, info->cid, info->sess_pool,
- rte_lcore_to_socket_id(options.los[i].lcore_id));
+ rte_lcore_to_numa_id(options.los[i].lcore_id));
if (ret) {
RTE_LOG(ERR, USER1, "Cannot create vhost crypto\n");
return ret;
@@ -510,8 +510,8 @@ main(int argc, char *argv[])
struct lcore_option *lo = &options.los[i];
struct vhost_crypto_info *info;
- info = rte_zmalloc_socket(NULL, sizeof(*info),
- RTE_CACHE_LINE_SIZE, rte_lcore_to_socket_id(
+ info = rte_zmalloc_numa(NULL, sizeof(*info),
+ RTE_CACHE_LINE_SIZE, rte_lcore_to_numa_id(
lo->lcore_id));
if (!info) {
ret = -ENOMEM;
@@ -544,7 +544,7 @@ main(int argc, char *argv[])
}
config.nb_queue_pairs = dev_info.max_nb_queue_pairs;
- config.socket_id = rte_lcore_to_socket_id(lo->lcore_id);
+ config.numa_id = rte_lcore_to_numa_id(lo->lcore_id);
config.ff_disable = RTE_CRYPTODEV_FF_SECURITY;
ret = rte_cryptodev_configure(info->cid, &config);
@@ -560,13 +560,13 @@ main(int argc, char *argv[])
SESSION_MAP_ENTRIES,
rte_cryptodev_sym_get_private_session_size(
info->cid), 0, 0,
- rte_lcore_to_socket_id(lo->lcore_id));
+ rte_lcore_to_numa_id(lo->lcore_id));
cop_type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
} else {
snprintf(name, 127, "ASYM_SESS_POOL_%u", lo->lcore_id);
info->sess_pool = rte_cryptodev_asym_session_pool_create(name,
SESSION_MAP_ENTRIES, 0, 64,
- rte_lcore_to_socket_id(lo->lcore_id));
+ rte_lcore_to_numa_id(lo->lcore_id));
cop_type = RTE_CRYPTO_OP_TYPE_ASYMMETRIC;
}
@@ -579,7 +579,7 @@ main(int argc, char *argv[])
info->cop_pool = rte_crypto_op_pool_create(name,
cop_type, NB_MEMPOOL_OBJS,
NB_CACHE_OBJS, VHOST_CRYPTO_MAX_IV_LEN,
- rte_lcore_to_socket_id(lo->lcore_id));
+ rte_lcore_to_numa_id(lo->lcore_id));
if (!info->cop_pool) {
RTE_LOG(ERR, USER1, "Failed to create crypto pool");
@@ -596,7 +596,7 @@ main(int argc, char *argv[])
for (j = 0; j < dev_info.max_nb_queue_pairs; j++) {
ret = rte_cryptodev_queue_pair_setup(info->cid, j,
- &qp_conf, rte_lcore_to_socket_id(
+ &qp_conf, rte_lcore_to_numa_id(
lo->lcore_id));
if (ret < 0) {
RTE_LOG(ERR, USER1, "Failed to configure qp\n");
--
2.55.0
More information about the dev
mailing list