DPDK  20.11.3
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  };
79  struct rte_ipsec_sa_pkt_func pkt_func;
81 
93 int
95 
117 static 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 
124 static inline uint16_t
125 rte_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 
154 static inline uint16_t
155 rte_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 #include <rte_ipsec_group.h>
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif /* _RTE_IPSEC_H_ */
rte_security_session_action_type
Definition: rte_security.h:330
struct rte_ipsec_sa * sa
Definition: rte_ipsec.h:63
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
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
#define __rte_cache_aligned
Definition: rte_common.h:400
struct rte_ipsec_sa_pkt_func pkt_func
Definition: rte_ipsec.h:79