#include <rte_random.h>
#include <rte_eal.h>
#include <rte_cryptodev.h>
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
#include <rte_cryptodev_scheduler.h>
#endif
[CPERF_AUTH_ONLY] = "auth-only",
[CPERF_CIPHER_THEN_AUTH] = "cipher-then-auth",
[CPERF_AUTH_THEN_CIPHER] = "auth-then-cipher",
- [CPERF_AEAD] = "aead"
+ [CPERF_AEAD] = "aead",
+ [CPERF_PDCP] = "pdcp",
+ [CPERF_DOCSIS] = "docsis"
};
const struct cperf_test cperf_testmap[] = {
if (sess_size > max_sess_size)
max_sess_size = sess_size;
}
-
+#ifdef RTE_LIB_SECURITY
+ for (cdev_id = 0; cdev_id < rte_cryptodev_count(); cdev_id++) {
+ sess_size = rte_security_session_get_size(
+ rte_cryptodev_get_sec_ctx(cdev_id));
+ if (sess_size > max_sess_size)
+ max_sess_size = sess_size;
+ }
+#endif
/*
* Calculate number of needed queue pairs, based on the amount
* of available number of logical cores and crypto devices.
for (i = 0; i < enabled_cdev_count &&
i < RTE_CRYPTO_MAX_DEVS; i++) {
cdev_id = enabled_cdevs[i];
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
/*
* If multi-core scheduler is used, limit the number
* of queue pairs to 1, as there is no way to know
struct rte_cryptodev_config conf = {
.nb_queue_pairs = opts->nb_qps,
.socket_id = socket_id,
- .ff_disable = RTE_CRYPTODEV_FF_SECURITY,
+ .ff_disable = RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO,
};
+ if (opts->op_type != CPERF_PDCP &&
+ opts->op_type != CPERF_DOCSIS)
+ conf.ff_disable |= RTE_CRYPTODEV_FF_SECURITY;
+
struct rte_cryptodev_qp_conf qp_conf = {
.nb_descriptors = opts->nb_descriptors
};
*/
if (!strcmp((const char *)opts->device_type,
"crypto_scheduler")) {
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
uint32_t nb_slaves =
- rte_cryptodev_scheduler_slaves_get(cdev_id,
+ rte_cryptodev_scheduler_workers_get(cdev_id,
NULL);
sessions_needed = enabled_cdev_count *
opts->nb_qps * nb_slaves;
#endif
} else
- sessions_needed = enabled_cdev_count *
- opts->nb_qps;
+ sessions_needed = enabled_cdev_count * opts->nb_qps;
/*
* A single session is required per queue pair
if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
if (test_vec->plaintext.data == NULL)
return -1;
- } else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+ } else {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
return -1;
- } else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
+ } else {
if (test_vec->plaintext.data == NULL)
return -1;
if (test_vec->plaintext.length < opts->max_buffer_size)
goto err;
}
- if (!opts.silent)
+ if (!opts.silent && opts.test != CPERF_TEST_TYPE_THROUGHPUT &&
+ opts.test != CPERF_TEST_TYPE_LATENCY)
show_test_vector(t_vec);
total_nb_qps = nb_cryptodevs * opts.nb_qps;
i = 0;
uint8_t qp_id = 0, cdev_index = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
distribution_total[buffer_size_count - 1];
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
- rte_eal_wait_lcore(lcore_id);
+ ret |= rte_eal_wait_lcore(lcore_id);
i++;
}
+
+ if (ret != EXIT_SUCCESS)
+ goto err;
} else {
/* Get next size from range or list */
while (opts.test_buffer_size <= opts.max_buffer_size) {
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
- rte_eal_wait_lcore(lcore_id);
+ ret |= rte_eal_wait_lcore(lcore_id);
i++;
}
+ if (ret != EXIT_SUCCESS)
+ goto err;
+
/* Get next size from range or list */
if (opts.inc_buffer_size != 0)
opts.test_buffer_size += opts.inc_buffer_size;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
err:
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;