* Allocate a crypto operation from a mempool with default parameters set * * @param mempool crypto operation mempool * @param type operation type to allocate * * @returns * - On success returns a valid rte_crypto_op structure * - On failure returns NULL */
| 305 | * - On failure returns NULL |
| 306 | */ |
| 307 | static inline struct rte_crypto_op * |
| 308 | rte_crypto_op_alloc(struct rte_mempool *mempool, enum rte_crypto_op_type type) |
| 309 | { |
| 310 | struct rte_crypto_op *op = NULL; |
| 311 | int retval; |
| 312 | |
| 313 | retval = __rte_crypto_op_raw_bulk_alloc(mempool, type, &op, 1); |
| 314 | if (unlikely(retval != 1)) |
| 315 | return NULL; |
| 316 | |
| 317 | __rte_crypto_op_reset(op, type); |
| 318 | |
| 319 | return op; |
| 320 | } |
| 321 | |
| 322 | |
| 323 | /** |