| 330 | } |
| 331 | |
| 332 | static int |
| 333 | cperf_verify_devices_capabilities(struct cperf_options *opts, |
| 334 | uint8_t *enabled_cdevs, uint8_t nb_cryptodevs) |
| 335 | { |
| 336 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 337 | const struct rte_cryptodev_symmetric_capability *capability; |
| 338 | struct rte_cryptodev_asym_capability_idx asym_cap_idx; |
| 339 | const struct rte_cryptodev_asymmetric_xform_capability *asym_capability; |
| 340 | |
| 341 | |
| 342 | uint8_t i, cdev_id; |
| 343 | int ret; |
| 344 | |
| 345 | for (i = 0; i < nb_cryptodevs; i++) { |
| 346 | |
| 347 | cdev_id = enabled_cdevs[i]; |
| 348 | |
| 349 | if (opts->op_type == CPERF_ASYM_MODEX) { |
| 350 | asym_cap_idx.type = RTE_CRYPTO_ASYM_XFORM_MODEX; |
| 351 | asym_capability = rte_cryptodev_asym_capability_get( |
| 352 | cdev_id, &asym_cap_idx); |
| 353 | if (asym_capability == NULL) |
| 354 | return -1; |
| 355 | |
| 356 | ret = rte_cryptodev_asym_xform_capability_check_modlen( |
| 357 | asym_capability, opts->modex_data->modulus.len); |
| 358 | if (ret != 0) |
| 359 | return ret; |
| 360 | |
| 361 | } |
| 362 | |
| 363 | if (opts->op_type == CPERF_AUTH_ONLY || |
| 364 | opts->op_type == CPERF_CIPHER_THEN_AUTH || |
| 365 | opts->op_type == CPERF_AUTH_THEN_CIPHER) { |
| 366 | |
| 367 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; |
| 368 | cap_idx.algo.auth = opts->auth_algo; |
| 369 | |
| 370 | capability = rte_cryptodev_sym_capability_get(cdev_id, |
| 371 | &cap_idx); |
| 372 | if (capability == NULL) |
| 373 | return -1; |
| 374 | |
| 375 | ret = rte_cryptodev_sym_capability_check_auth( |
| 376 | capability, |
| 377 | opts->auth_key_sz, |
| 378 | opts->digest_sz, |
| 379 | opts->auth_iv_sz); |
| 380 | if (ret != 0) |
| 381 | return ret; |
| 382 | } |
| 383 | |
| 384 | if (opts->op_type == CPERF_CIPHER_ONLY || |
| 385 | opts->op_type == CPERF_CIPHER_THEN_AUTH || |
| 386 | opts->op_type == CPERF_AUTH_THEN_CIPHER) { |
| 387 | |
| 388 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 389 | cap_idx.algo.cipher = opts->cipher_algo; |
no test coverage detected