1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2020 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 ss->type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) {
16 if (ss->crypto.ses == NULL)
19 if (ss->security.ses == NULL)
21 if ((ss->type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO ||
23 RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) &&
24 ss->security.ctx == NULL)
32 rte_ipsec_session_prepare(struct rte_ipsec_session *ss)
35 struct rte_ipsec_sa_pkt_func fp;
37 rc = session_check(ss);
41 rc = ipsec_sa_pkt_func_select(ss, ss->sa, &fp);
47 if (ss->type == RTE_SECURITY_ACTION_TYPE_NONE)
48 ss->crypto.ses->opaque_data = (uintptr_t)ss;
50 ss->security.ses->opaque_data = (uintptr_t)ss;