cryptodev: rename ADD field
[dpdk.git] / examples / l2fwd-crypto / main.c
index cba29ce..84b727b 100644 (file)
@@ -765,7 +765,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
                        port_cparams[i].aead_algo = options->aead_xform.aead.algo;
                        port_cparams[i].digest_length =
                                        options->aead_xform.aead.digest_length;
-                       if (options->aead_xform.aead.add_auth_data_length) {
+                       if (options->aead_xform.aead.aad_length) {
                                port_cparams[i].aad.data = options->aad.data;
                                port_cparams[i].aad.phys_addr = options->aad.phys_addr;
                                port_cparams[i].aad.length = options->aad.length;
@@ -2082,7 +2082,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
                        } else
                                options->aad.length = cap->sym.auth.aad_size.min;
 
-                       options->aead_xform.aead.add_auth_data_length =
+                       options->aead_xform.aead.aad_length =
                                                options->aad.length;
 
                        /* Check if digest size is supported by the algorithm. */
@@ -2232,8 +2232,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
                                                cap->sym.auth.digest_size.min;
                }
 
-               retval = rte_cryptodev_configure(cdev_id, &conf,
-                               session_pool_socket[socket_id]);
+               retval = rte_cryptodev_configure(cdev_id, &conf);
                if (retval < 0) {
                        printf("Failed to configure cryptodev %u", cdev_id);
                        return -1;
@@ -2242,7 +2241,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,
                qp_conf.nb_descriptors = 2048;
 
                retval = rte_cryptodev_queue_pair_setup(cdev_id, 0, &qp_conf,
-                               socket_id);
+                               socket_id, session_pool_socket[socket_id]);
                if (retval < 0) {
                        printf("Failed to setup queue pair %u on cryptodev %u",
                                        0, cdev_id);
@@ -2298,6 +2297,14 @@ initialize_ports(struct l2fwd_crypto_options *options)
                        return -1;
                }
 
+               retval = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd,
+                                                         &nb_txd);
+               if (retval < 0) {
+                       printf("Cannot adjust number of descriptors: err=%d, port=%u\n",
+                               retval, (unsigned) portid);
+                       return -1;
+               }
+
                /* init one RX queue */
                fflush(stdout);
                retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd,