DPDK  20.05.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 
17 #include <rte_ipsec_sa.h>
18 #include <rte_mbuf.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 struct rte_ipsec_session;
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 
93 __rte_experimental
94 int
96 
118 __rte_experimental
119 static inline uint16_t
121  struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
122 {
123  return ss->pkt_func.prepare.async(ss, mb, cop, num);
124 }
125 
126 __rte_experimental
127 static inline uint16_t
128 rte_ipsec_pkt_cpu_prepare(const struct rte_ipsec_session *ss,
129  struct rte_mbuf *mb[], uint16_t num)
130 {
131  return ss->pkt_func.prepare.sync(ss, mb, num);
132 }
133 
157 __rte_experimental
158 static inline uint16_t
159 rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
160  uint16_t num)
161 {
162  return ss->pkt_func.process(ss, mb, num);
163 }
164 
165 #include <rte_ipsec_group.h>
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* _RTE_IPSEC_H_ */
rte_security_session_action_type
Definition: rte_security.h:299
struct rte_ipsec_sa * sa
Definition: rte_ipsec.h:63
__rte_experimental int rte_ipsec_session_prepare(struct rte_ipsec_session *ss)
enum rte_security_session_action_type type
Definition: rte_ipsec.h:65
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:120
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:159
#define __rte_cache_aligned
Definition: rte_common.h:367
struct rte_ipsec_sa_pkt_func pkt_func
Definition: rte_ipsec.h:79