MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_session

Function get_session

dpdk/drivers/crypto/null/null_crypto_pmd.c:72–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72static struct null_crypto_session *
73get_session(struct null_crypto_qp *qp, struct rte_crypto_op *op)
74{
75 struct null_crypto_session *sess = NULL;
76 struct rte_crypto_sym_op *sym_op = op->sym;
77
78 if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
79 if (likely(sym_op->session != NULL))
80 sess = CRYPTODEV_GET_SYM_SESS_PRIV(sym_op->session);
81 } else {
82 struct rte_cryptodev_sym_session *_sess = NULL;
83
84 if (rte_mempool_get(qp->sess_mp, (void **)&_sess))
85 return NULL;
86
87 sess = (struct null_crypto_session *)_sess->driver_priv_data;
88
89 if (unlikely(null_crypto_set_session_parameters(sess,
90 sym_op->xform) != 0)) {
91 rte_mempool_put(qp->sess_mp, _sess);
92 sess = NULL;
93 }
94 sym_op->session = _sess;
95 }
96
97 return sess;
98}
99
100/** Enqueue burst */
101static uint16_t

Callers 1

Calls 3

rte_mempool_getFunction · 0.85
rte_mempool_putFunction · 0.85

Tested by

no test coverage detected