From: Chengwen Feng <[email protected]>

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 <[email protected]>
---
 examples/l2fwd-crypto/main.c | 38 ++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 84399463da..1b195a816e 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -672,12 +672,12 @@ static void *
 initialize_crypto_session(struct l2fwd_crypto_options *options, uint8_t 
cdev_id)
 {
        struct rte_crypto_sym_xform *first_xform;
-       int retval = rte_cryptodev_socket_id(cdev_id);
+       int retval = rte_cryptodev_numa_id(cdev_id);
 
        if (retval < 0)
                return NULL;
 
-       uint8_t socket_id = (uint8_t) retval;
+       uint8_t numa_id = (uint8_t) retval;
 
        if (options->xform_chain == L2FWD_CRYPTO_AEAD) {
                first_xform = &options->aead_xform;
@@ -694,7 +694,7 @@ initialize_crypto_session(struct l2fwd_crypto_options 
*options, uint8_t cdev_id)
        }
 
        return rte_cryptodev_sym_session_create(cdev_id, first_xform,
-                       session_pool_socket[socket_id].sess_mp);
+                       session_pool_socket[numa_id].sess_mp);
 }
 /* >8 End of creation of session. */
 
@@ -2350,18 +2350,18 @@ initialize_cryptodevs(struct l2fwd_crypto_options 
*options, unsigned nb_ports,
                if (check_capabilities(options, cdev_id) < 0)
                        continue;
 
-               retval = rte_cryptodev_socket_id(cdev_id);
+               retval = rte_cryptodev_numa_id(cdev_id);
 
                if (retval < 0) {
                        printf("Invalid crypto device id used\n");
                        return -1;
                }
 
-               uint8_t socket_id = (uint8_t) retval;
+               uint8_t numa_id = (uint8_t) retval;
 
                struct rte_cryptodev_config conf = {
                        .nb_queue_pairs = 1,
-                       .socket_id = socket_id,
+                       .numa_id = numa_id,
                        .ff_disable = RTE_CRYPTODEV_FF_SECURITY,
                };
 
@@ -2379,23 +2379,23 @@ initialize_cryptodevs(struct l2fwd_crypto_options 
*options, unsigned nb_ports,
                } else
                        sessions_needed = enabled_cdev_count;
 
-               if (session_pool_socket[socket_id].sess_mp == NULL) {
+               if (session_pool_socket[numa_id].sess_mp == NULL) {
                        char mp_name[RTE_MEMPOOL_NAMESIZE];
                        snprintf(mp_name, RTE_MEMPOOL_NAMESIZE,
-                               "sess_mp_%u", socket_id);
+                               "sess_mp_%u", numa_id);
 
-                       session_pool_socket[socket_id].sess_mp =
+                       session_pool_socket[numa_id].sess_mp =
                                rte_cryptodev_sym_session_pool_create(
                                        mp_name, sessions_needed, max_sess_sz,
-                                       0, 0, socket_id);
-                       if (session_pool_socket[socket_id].sess_mp == NULL) {
+                                       0, 0, numa_id);
+                       if (session_pool_socket[numa_id].sess_mp == NULL) {
                                printf("Cannot create pool on socket %d\n",
-                                       socket_id);
+                                       numa_id);
                                return -ENOMEM;
                        }
 
                        printf("Allocated pool \"%s\" on socket %d\n",
-                               mp_name, socket_id);
+                               mp_name, numa_id);
                }
 
                /* Set AEAD parameters */
@@ -2537,10 +2537,10 @@ initialize_cryptodevs(struct l2fwd_crypto_options 
*options, unsigned nb_ports,
                }
 
                qp_conf.nb_descriptors = 2048;
-               qp_conf.mp_session = session_pool_socket[socket_id].sess_mp;
+               qp_conf.mp_session = session_pool_socket[numa_id].sess_mp;
 
                retval = rte_cryptodev_queue_pair_setup(cdev_id, 0, &qp_conf,
-                               socket_id);
+                               numa_id);
                if (retval < 0) {
                        printf("Failed to setup queue pair %u on cryptodev %u",
                                        0, cdev_id);
@@ -2619,7 +2619,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
                rxq_conf = dev_info.default_rxconf;
                rxq_conf.offloads = local_port_conf.rxmode.offloads;
                retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,
-                                            rte_eth_dev_socket_id(portid),
+                                            rte_eth_dev_numa_id(portid),
                                             &rxq_conf, l2fwd_pktmbuf_pool);
                if (retval < 0) {
                        printf("rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -2632,7 +2632,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
                txq_conf = dev_info.default_txconf;
                txq_conf.offloads = local_port_conf.txmode.offloads;
                retval = rte_eth_tx_queue_setup(portid, 0, nb_txd,
-                               rte_eth_dev_socket_id(portid),
+                               rte_eth_dev_numa_id(portid),
                                &txq_conf);
                if (retval < 0) {
                        printf("rte_eth_tx_queue_setup:err=%d, port=%u\n",
@@ -2766,14 +2766,14 @@ main(int argc, char **argv)
        l2fwd_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF, 512,
                        RTE_ALIGN(sizeof(struct rte_crypto_op),
                                RTE_CACHE_LINE_SIZE),
-                       RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
+                       RTE_MBUF_DEFAULT_BUF_SIZE, rte_numa_id());
        if (l2fwd_pktmbuf_pool == NULL)
                rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
 
        /* create crypto op pool */
        l2fwd_crypto_op_pool = rte_crypto_op_pool_create("crypto_op_pool",
                        RTE_CRYPTO_OP_TYPE_SYMMETRIC, NB_MBUF, 128, 
MAXIMUM_IV_LENGTH,
-                       rte_socket_id());
+                       rte_numa_id());
        if (l2fwd_crypto_op_pool == NULL)
                rte_exit(EXIT_FAILURE, "Cannot create crypto op pool\n");
 
-- 
2.55.0

Reply via email to