1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
9 session_check(struct rte_ipsec_session *ss)
11 if (ss == NULL || ss->sa == NULL)
14 if (ss->type == RTE_SECURITY_ACTION_TYPE_NONE) {
15 if (ss->crypto.ses == NULL)
18 if (ss->security.ses == NULL)
20 if ((ss->type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO ||
22 RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) &&
23 ss->security.ctx == NULL)
31 rte_ipsec_session_prepare(struct rte_ipsec_session *ss)
34 struct rte_ipsec_sa_pkt_func fp;
36 rc = session_check(ss);
40 rc = ipsec_sa_pkt_func_select(ss, ss->sa, &fp);
46 if (ss->type == RTE_SECURITY_ACTION_TYPE_NONE)
47 ss->crypto.ses->opaque_data = (uintptr_t)ss;
49 ss->security.ses->opaque_data = (uintptr_t)ss;