| 246 | } |
| 247 | |
| 248 | static int |
| 249 | check_cryptodev_capability(const struct ipsec_unitest_params *ut, |
| 250 | uint8_t dev_id) |
| 251 | { |
| 252 | struct rte_cryptodev_sym_capability_idx cap_idx; |
| 253 | const struct rte_cryptodev_symmetric_capability *cap; |
| 254 | int rc = -1; |
| 255 | |
| 256 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH; |
| 257 | cap_idx.algo.auth = ut->auth_xform.auth.algo; |
| 258 | cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx); |
| 259 | |
| 260 | if (cap != NULL) { |
| 261 | rc = rte_cryptodev_sym_capability_check_auth(cap, |
| 262 | ut->auth_xform.auth.key.length, |
| 263 | ut->auth_xform.auth.digest_length, 0); |
| 264 | if (rc == 0) { |
| 265 | cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER; |
| 266 | cap_idx.algo.cipher = ut->cipher_xform.cipher.algo; |
| 267 | cap = rte_cryptodev_sym_capability_get( |
| 268 | dev_id, &cap_idx); |
| 269 | if (cap != NULL) |
| 270 | rc = rte_cryptodev_sym_capability_check_cipher( |
| 271 | cap, |
| 272 | ut->cipher_xform.cipher.key.length, |
| 273 | ut->cipher_xform.cipher.iv.length); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | return rc; |
| 278 | } |
| 279 | |
| 280 | static int |
| 281 | testsuite_setup(void) |
no test coverage detected