| 378 | }; |
| 379 | |
| 380 | const struct rte_cryptodev_symmetric_capability * |
| 381 | rte_cryptodev_sym_capability_get(uint8_t dev_id, |
| 382 | const struct rte_cryptodev_sym_capability_idx *idx) |
| 383 | { |
| 384 | const struct rte_cryptodev_capabilities *capability; |
| 385 | const struct rte_cryptodev_symmetric_capability *sym_capability = NULL; |
| 386 | struct rte_cryptodev_info dev_info; |
| 387 | int i = 0; |
| 388 | |
| 389 | rte_cryptodev_info_get(dev_id, &dev_info); |
| 390 | |
| 391 | while ((capability = &dev_info.capabilities[i++])->op != |
| 392 | RTE_CRYPTO_OP_TYPE_UNDEFINED) { |
| 393 | if (capability->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC) |
| 394 | continue; |
| 395 | |
| 396 | if (capability->sym.xform_type != idx->type) |
| 397 | continue; |
| 398 | |
| 399 | if (idx->type == RTE_CRYPTO_SYM_XFORM_AUTH && |
| 400 | capability->sym.auth.algo == idx->algo.auth) { |
| 401 | sym_capability = &capability->sym; |
| 402 | break; |
| 403 | } |
| 404 | |
| 405 | if (idx->type == RTE_CRYPTO_SYM_XFORM_CIPHER && |
| 406 | capability->sym.cipher.algo == idx->algo.cipher) { |
| 407 | sym_capability = &capability->sym; |
| 408 | break; |
| 409 | } |
| 410 | |
| 411 | if (idx->type == RTE_CRYPTO_SYM_XFORM_AEAD && |
| 412 | capability->sym.aead.algo == idx->algo.aead) { |
| 413 | sym_capability = &capability->sym; |
| 414 | break; |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | rte_cryptodev_trace_sym_capability_get(dev_id, dev_info.driver_name, |
| 419 | dev_info.driver_id, idx->type, sym_capability); |
| 420 | |
| 421 | return sym_capability; |
| 422 | } |
| 423 | |
| 424 | static int |
| 425 | param_range_check(uint16_t size, const struct rte_crypto_param_range *range) |