| 47 | }; |
| 48 | |
| 49 | static struct ccp_session * |
| 50 | get_ccp_session(struct ccp_qp *qp, struct rte_crypto_op *op) |
| 51 | { |
| 52 | struct ccp_session *sess = NULL; |
| 53 | |
| 54 | if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) { |
| 55 | if (unlikely(op->sym->session == NULL)) |
| 56 | return NULL; |
| 57 | |
| 58 | sess = CRYPTODEV_GET_SYM_SESS_PRIV(op->sym->session); |
| 59 | } else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) { |
| 60 | struct rte_cryptodev_sym_session *_sess; |
| 61 | struct ccp_private *internals; |
| 62 | |
| 63 | if (rte_mempool_get(qp->sess_mp, (void **)&_sess)) |
| 64 | return NULL; |
| 65 | |
| 66 | sess = (void *)_sess->driver_priv_data; |
| 67 | |
| 68 | internals = (struct ccp_private *)qp->dev->data->dev_private; |
| 69 | if (unlikely(ccp_set_session_parameters(sess, op->sym->xform, |
| 70 | internals) != 0)) { |
| 71 | rte_mempool_put(qp->sess_mp, _sess); |
| 72 | sess = NULL; |
| 73 | } |
| 74 | op->sym->session = _sess; |
| 75 | } |
| 76 | |
| 77 | return sess; |
| 78 | } |
| 79 | |
| 80 | static uint16_t |
| 81 | ccp_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops, |
no test coverage detected