DPDK  20.08.0
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 
21 #include <rte_ipsec_sa.h>
22 #include <rte_mbuf.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 struct rte_ipsec_session;
29 
40  union {
41  uint16_t (*async)(const struct rte_ipsec_session *ss,
42  struct rte_mbuf *mb[],
43  struct rte_crypto_op *cop[],
44  uint16_t num);
45  uint16_t (*sync)(const struct rte_ipsec_session *ss,
46  struct rte_mbuf *mb[],
47  uint16_t num);
48  } prepare;
49  uint16_t (*process)(const struct rte_ipsec_session *ss,
50  struct rte_mbuf *mb[],
51  uint16_t num);
52 };
53 
67  struct rte_ipsec_sa *sa;
71  union {
72  struct {
73  struct rte_cryptodev_sym_session *ses;
74  uint8_t dev_id;
75  } crypto;
76  struct {
77  struct rte_security_session *ses;
78  struct rte_security_ctx *ctx;
79  uint32_t ol_flags;
80  } security;
81  };
85 
97 __rte_experimental
98 int
100 
122 __rte_experimental
123 static inline uint16_t
125  struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
126 {
127  return ss->pkt_func.prepare.async(ss, mb, cop, num);
128 }
129 
130 __rte_experimental
131 static inline uint16_t
132 rte_ipsec_pkt_cpu_prepare(const struct rte_ipsec_session *ss,
133  struct rte_mbuf *mb[], uint16_t num)
134 {
135  return ss->pkt_func.prepare.sync(ss, mb, num);
136 }
137 
161 __rte_experimental
162 static inline uint16_t
163 rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
164  uint16_t num)
165 {
166  return ss->pkt_func.process(ss, mb, num);
167 }
168 
169 #include <rte_ipsec_group.h>
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif /* _RTE_IPSEC_H_ */
rte_security_session_action_type
Definition: rte_security.h:321
struct rte_ipsec_sa * sa
Definition: rte_ipsec.h:67
__rte_experimental int rte_ipsec_session_prepare(struct rte_ipsec_session *ss)
enum rte_security_session_action_type type
Definition: rte_ipsec.h:69
static __rte_experimental 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:124
static __rte_experimental uint16_t rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], uint16_t num)
Definition: rte_ipsec.h:163
#define __rte_cache_aligned
Definition: rte_common.h:376
struct rte_ipsec_sa_pkt_func pkt_func
Definition: rte_ipsec.h:83