Lines Matching refs:opts
121 cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs) in cperf_initialize_cryptodev() argument
128 enabled_cdev_count = rte_cryptodev_devices_get(opts->device_type, in cperf_initialize_cryptodev()
132 opts->device_type); in cperf_initialize_cryptodev()
173 opts->nb_qps = (nb_lcores % enabled_cdev_count) ? in cperf_initialize_cryptodev()
187 if (!strcmp((const char *)opts->device_type, "crypto_scheduler") && in cperf_initialize_cryptodev()
190 opts->nb_qps = 1; in cperf_initialize_cryptodev()
202 if (opts->nb_qps > cdev_info.max_nb_queue_pairs) { in cperf_initialize_cryptodev()
211 .nb_queue_pairs = opts->nb_qps, in cperf_initialize_cryptodev()
216 if (opts->op_type != CPERF_PDCP && in cperf_initialize_cryptodev()
217 opts->op_type != CPERF_DOCSIS) in cperf_initialize_cryptodev()
221 .nb_descriptors = opts->nb_descriptors in cperf_initialize_cryptodev()
229 if (opts->headroom_sz < cdev_info.min_mbuf_headroom_req) { in cperf_initialize_cryptodev()
231 opts->headroom_sz = cdev_info.min_mbuf_headroom_req; in cperf_initialize_cryptodev()
233 if (opts->tailroom_sz < cdev_info.min_mbuf_tailroom_req) { in cperf_initialize_cryptodev()
235 opts->tailroom_sz = cdev_info.min_mbuf_tailroom_req; in cperf_initialize_cryptodev()
239 opts->segment_sz += (opts->headroom_sz + opts->tailroom_sz); in cperf_initialize_cryptodev()
246 if (!strcmp((const char *)opts->device_type, in cperf_initialize_cryptodev()
254 opts->nb_qps * nb_slaves; in cperf_initialize_cryptodev()
257 sessions_needed = enabled_cdev_count * opts->nb_qps; in cperf_initialize_cryptodev()
263 if (dev_max_nb_sess != 0 && dev_max_nb_sess < opts->nb_qps) { in cperf_initialize_cryptodev()
266 "%u sessions\n", opts->nb_qps); in cperf_initialize_cryptodev()
285 for (j = 0; j < opts->nb_qps; j++) { in cperf_initialize_cryptodev()
307 cperf_verify_devices_capabilities(struct cperf_options *opts, in cperf_verify_devices_capabilities() argument
320 if (opts->op_type == CPERF_AUTH_ONLY || in cperf_verify_devices_capabilities()
321 opts->op_type == CPERF_CIPHER_THEN_AUTH || in cperf_verify_devices_capabilities()
322 opts->op_type == CPERF_AUTH_THEN_CIPHER) { in cperf_verify_devices_capabilities()
325 cap_idx.algo.auth = opts->auth_algo; in cperf_verify_devices_capabilities()
334 opts->auth_key_sz, in cperf_verify_devices_capabilities()
335 opts->digest_sz, in cperf_verify_devices_capabilities()
336 opts->auth_iv_sz); in cperf_verify_devices_capabilities()
341 if (opts->op_type == CPERF_CIPHER_ONLY || in cperf_verify_devices_capabilities()
342 opts->op_type == CPERF_CIPHER_THEN_AUTH || in cperf_verify_devices_capabilities()
343 opts->op_type == CPERF_AUTH_THEN_CIPHER) { in cperf_verify_devices_capabilities()
346 cap_idx.algo.cipher = opts->cipher_algo; in cperf_verify_devices_capabilities()
355 opts->cipher_key_sz, in cperf_verify_devices_capabilities()
356 opts->cipher_iv_sz); in cperf_verify_devices_capabilities()
361 if (opts->op_type == CPERF_AEAD) { in cperf_verify_devices_capabilities()
364 cap_idx.algo.aead = opts->aead_algo; in cperf_verify_devices_capabilities()
373 opts->aead_key_sz, in cperf_verify_devices_capabilities()
374 opts->digest_sz, in cperf_verify_devices_capabilities()
375 opts->aead_aad_sz, in cperf_verify_devices_capabilities()
376 opts->aead_iv_sz); in cperf_verify_devices_capabilities()
386 cperf_check_test_vector(struct cperf_options *opts, in cperf_check_test_vector() argument
389 if (opts->op_type == CPERF_CIPHER_ONLY) { in cperf_check_test_vector()
390 if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) { in cperf_check_test_vector()
393 } else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) { in cperf_check_test_vector()
396 if (test_vec->plaintext.length < opts->max_buffer_size) in cperf_check_test_vector()
400 if (test_vec->ciphertext.length < opts->max_buffer_size) in cperf_check_test_vector()
403 if (opts->cipher_iv_sz && in cperf_check_test_vector()
406 if (test_vec->cipher_iv.length != opts->cipher_iv_sz) in cperf_check_test_vector()
410 if (test_vec->cipher_key.length != opts->cipher_key_sz) in cperf_check_test_vector()
413 } else if (opts->op_type == CPERF_AUTH_ONLY) { in cperf_check_test_vector()
414 if (opts->auth_algo != RTE_CRYPTO_AUTH_NULL) { in cperf_check_test_vector()
417 if (test_vec->plaintext.length < opts->max_buffer_size) in cperf_check_test_vector()
420 if (opts->auth_key_sz && in cperf_check_test_vector()
423 if (test_vec->auth_key.length != opts->auth_key_sz) in cperf_check_test_vector()
425 if (test_vec->auth_iv.length != opts->auth_iv_sz) in cperf_check_test_vector()
428 if (opts->auth_iv_sz && test_vec->auth_iv.data == NULL) in cperf_check_test_vector()
432 if (test_vec->digest.length < opts->digest_sz) in cperf_check_test_vector()
436 } else if (opts->op_type == CPERF_CIPHER_THEN_AUTH || in cperf_check_test_vector()
437 opts->op_type == CPERF_AUTH_THEN_CIPHER) { in cperf_check_test_vector()
438 if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) { in cperf_check_test_vector()
441 if (test_vec->plaintext.length < opts->max_buffer_size) in cperf_check_test_vector()
443 } else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) { in cperf_check_test_vector()
446 if (test_vec->plaintext.length < opts->max_buffer_size) in cperf_check_test_vector()
450 if (test_vec->ciphertext.length < opts->max_buffer_size) in cperf_check_test_vector()
454 if (test_vec->cipher_iv.length != opts->cipher_iv_sz) in cperf_check_test_vector()
458 if (test_vec->cipher_key.length != opts->cipher_key_sz) in cperf_check_test_vector()
461 if (opts->auth_algo != RTE_CRYPTO_AUTH_NULL) { in cperf_check_test_vector()
464 if (test_vec->auth_key.length != opts->auth_key_sz) in cperf_check_test_vector()
466 if (test_vec->auth_iv.length != opts->auth_iv_sz) in cperf_check_test_vector()
469 if (opts->auth_iv_sz && test_vec->auth_iv.data == NULL) in cperf_check_test_vector()
473 if (test_vec->digest.length < opts->digest_sz) in cperf_check_test_vector()
476 } else if (opts->op_type == CPERF_AEAD) { in cperf_check_test_vector()
479 if (test_vec->plaintext.length < opts->max_buffer_size) in cperf_check_test_vector()
483 if (test_vec->ciphertext.length < opts->max_buffer_size) in cperf_check_test_vector()
487 if (test_vec->aead_key.length != opts->aead_key_sz) in cperf_check_test_vector()
491 if (test_vec->aead_iv.length != opts->aead_iv_sz) in cperf_check_test_vector()
495 if (test_vec->aad.length != opts->aead_aad_sz) in cperf_check_test_vector()
499 if (test_vec->digest.length < opts->digest_sz) in cperf_check_test_vector()
508 struct cperf_options opts = {0}; in main() local
529 cperf_options_default(&opts); in main()
531 ret = cperf_options_parse(&opts, argc, argv); in main()
537 ret = cperf_options_check(&opts); in main()
544 nb_cryptodevs = cperf_initialize_cryptodev(&opts, enabled_cdevs); in main()
546 if (!opts.silent) in main()
547 cperf_options_dump(&opts); in main()
556 ret = cperf_verify_devices_capabilities(&opts, enabled_cdevs, in main()
564 if (opts.test_file != NULL) { in main()
565 t_vec = cperf_test_vector_get_from_file(&opts); in main()
573 if (cperf_check_test_vector(&opts, t_vec)) { in main()
579 t_vec = cperf_test_vector_get_dummy(&opts); in main()
588 ret = cperf_get_op_functions(&opts, &op_fns); in main()
595 if (!opts.silent && opts.test != CPERF_TEST_TYPE_THROUGHPUT && in main()
596 opts.test != CPERF_TEST_TYPE_LATENCY) in main()
599 total_nb_qps = nb_cryptodevs * opts.nb_qps; in main()
612 ctx[i] = cperf_testmap[opts.test].constructor( in main()
616 &opts, t_vec, &op_fns); in main()
621 qp_id = (qp_id + 1) % opts.nb_qps; in main()
627 if (opts.imix_distribution_count != 0) { in main()
628 uint8_t buffer_size_count = opts.buffer_size_count; in main()
632 const uint32_t *buffer_size_list = opts.buffer_size_list; in main()
633 const uint32_t *imix_distribution_list = opts.imix_distribution_list; in main()
635 opts.imix_buffer_sizes = rte_malloc(NULL, in main()
636 sizeof(uint32_t) * opts.pool_sz, in main()
648 for (op_idx = 0; op_idx < opts.pool_sz; op_idx++) { in main()
655 opts.imix_buffer_sizes[op_idx] = buffer_size_list[i]; in main()
663 opts.test_buffer_size = test_average_size / in main()
672 rte_eal_remote_launch(cperf_testmap[opts.test].runner, in main()
690 if (opts.inc_buffer_size != 0) in main()
691 opts.test_buffer_size = opts.min_buffer_size; in main()
693 opts.test_buffer_size = opts.buffer_size_list[0]; in main()
695 while (opts.test_buffer_size <= opts.max_buffer_size) { in main()
702 rte_eal_remote_launch(cperf_testmap[opts.test].runner, in main()
719 if (opts.inc_buffer_size != 0) in main()
720 opts.test_buffer_size += opts.inc_buffer_size; in main()
722 if (++buffer_size_idx == opts.buffer_size_count) in main()
724 opts.test_buffer_size = in main()
725 opts.buffer_size_list[buffer_size_idx]; in main()
736 cperf_testmap[opts.test].destructor(ctx[i]); in main()
744 free_test_vector(t_vec, &opts); in main()
755 if (ctx[i] && cperf_testmap[opts.test].destructor) in main()
756 cperf_testmap[opts.test].destructor(ctx[i]); in main()
763 rte_free(opts.imix_buffer_sizes); in main()
764 free_test_vector(t_vec, &opts); in main()