DPDK 21.11.9
rte_ipsec.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018-2020 Intel Corporation
3 */
4
5#ifndef _RTE_IPSEC_H_
6#define _RTE_IPSEC_H_
7
17#include <rte_ipsec_sa.h>
18#include <rte_mbuf.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
25
36 union {
37 uint16_t (*async)(const struct rte_ipsec_session *ss,
38 struct rte_mbuf *mb[],
39 struct rte_crypto_op *cop[],
40 uint16_t num);
41 uint16_t (*sync)(const struct rte_ipsec_session *ss,
42 struct rte_mbuf *mb[],
43 uint16_t num);
44 } prepare;
45 uint16_t (*process)(const struct rte_ipsec_session *ss,
46 struct rte_mbuf *mb[],
47 uint16_t num);
48};
49
63 struct rte_ipsec_sa *sa;
67 union {
68 struct {
69 struct rte_cryptodev_sym_session *ses;
70 uint8_t dev_id;
71 } crypto;
72 struct {
73 struct rte_security_session *ses;
74 struct rte_security_ctx *ctx;
75 uint32_t ol_flags;
76 } security;
77 };
81
93int
95
117static inline uint16_t
119 struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
120{
121 return ss->pkt_func.prepare.async(ss, mb, cop, num);
122}
123
124static inline uint16_t
125rte_ipsec_pkt_cpu_prepare(const struct rte_ipsec_session *ss,
126 struct rte_mbuf *mb[], uint16_t num)
127{
128 return ss->pkt_func.prepare.sync(ss, mb, num);
129}
130
154static inline uint16_t
155rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
156 uint16_t num)
157{
158 return ss->pkt_func.process(ss, mb, num);
159}
160
161
170__rte_experimental
171int
172rte_ipsec_telemetry_sa_add(const struct rte_ipsec_sa *sa);
173
180__rte_experimental
181void
182rte_ipsec_telemetry_sa_del(const struct rte_ipsec_sa *sa);
183
184#include <rte_ipsec_group.h>
185
186#ifdef __cplusplus
187}
188#endif
189
190#endif /* _RTE_IPSEC_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:420
__rte_experimental void rte_ipsec_telemetry_sa_del(const struct rte_ipsec_sa *sa)
int rte_ipsec_session_prepare(struct rte_ipsec_session *ss)
static uint16_t rte_ipsec_pkt_crypto_prepare(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
Definition: rte_ipsec.h:118
__rte_experimental int rte_ipsec_telemetry_sa_add(const struct rte_ipsec_sa *sa)
static uint16_t rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], uint16_t num)
Definition: rte_ipsec.h:155
rte_security_session_action_type
Definition: rte_security.h:457
struct rte_ipsec_sa_pkt_func pkt_func
Definition: rte_ipsec.h:79
struct rte_ipsec_sa * sa
Definition: rte_ipsec.h:63
enum rte_security_session_action_type type
Definition: rte_ipsec.h:65