DPDK 25.03.0-rc0
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
21
30 uint64_t sqn;
31};
32
45 union {
46 uint16_t (*async)(const struct rte_ipsec_session *ss,
47 struct rte_mbuf *mb[],
48 struct rte_crypto_op *cop[],
49 uint16_t num);
50 uint16_t (*sync)(const struct rte_ipsec_session *ss,
51 struct rte_mbuf *mb[],
52 uint16_t num);
53 } prepare;
54 union {
55 uint16_t (*async)(const struct rte_ipsec_session *ss,
56 struct rte_mbuf *mb[],
57 struct rte_crypto_op *cop[],
58 uint16_t num,
59 struct rte_ipsec_state *state);
60 uint16_t (*sync)(const struct rte_ipsec_session *ss,
61 struct rte_mbuf *mb[],
62 uint16_t num,
63 struct rte_ipsec_state *state);
64 } prepare_stateless;
65 uint16_t (*process)(const struct rte_ipsec_session *ss,
66 struct rte_mbuf *mb[],
67 uint16_t num);
68};
69
83 struct rte_ipsec_sa *sa;
87 union {
88 struct {
89 struct rte_cryptodev_sym_session *ses;
90 uint8_t dev_id;
91 } crypto;
92 struct {
93 struct rte_security_session *ses;
94 struct rte_security_ctx *ctx;
95 uint32_t ol_flags;
96 } security;
97 };
99 struct rte_ipsec_sa_pkt_func pkt_func;
100};
101
113int
115
137static inline uint16_t
139 struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
140{
141 return ss->pkt_func.prepare.async(ss, mb, cop, num);
142}
143
144static inline uint16_t
145rte_ipsec_pkt_cpu_prepare(const struct rte_ipsec_session *ss,
146 struct rte_mbuf *mb[], uint16_t num)
147{
148 return ss->pkt_func.prepare.sync(ss, mb, num);
149}
150
178__rte_experimental
179static inline uint16_t
181 struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num,
182 struct rte_ipsec_state *state)
183{
184 return ss->pkt_func.prepare_stateless.async(ss, mb, cop, num, state);
185}
186
203__rte_experimental
204static inline uint16_t
206 struct rte_mbuf *mb[], uint16_t num, struct rte_ipsec_state *state)
207{
208 return ss->pkt_func.prepare_stateless.sync(ss, mb, num, state);
209}
210
234static inline uint16_t
235rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
236 uint16_t num)
237{
238 return ss->pkt_func.process(ss, mb, num);
239}
240
241
250int
251rte_ipsec_telemetry_sa_add(const struct rte_ipsec_sa *sa);
252
259void
260rte_ipsec_telemetry_sa_del(const struct rte_ipsec_sa *sa);
261
262#include <rte_ipsec_group.h>
263
264#ifdef __cplusplus
265extern "C" {
266#endif
267
268#ifdef __cplusplus
269}
270#endif
271
272#endif /* _RTE_IPSEC_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:627
static __rte_experimental uint16_t rte_ipsec_pkt_cpu_prepare_stateless(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], uint16_t num, struct rte_ipsec_state *state)
Definition: rte_ipsec.h:205
int rte_ipsec_telemetry_sa_add(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:138
static __rte_experimental uint16_t rte_ipsec_pkt_crypto_prepare_stateless(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num, struct rte_ipsec_state *state)
Definition: rte_ipsec.h:180
void rte_ipsec_telemetry_sa_del(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:235
rte_security_session_action_type
Definition: rte_security.h:731
struct rte_ipsec_sa_pkt_func pkt_func
Definition: rte_ipsec.h:99
struct rte_ipsec_sa * sa
Definition: rte_ipsec.h:83
enum rte_security_session_action_type type
Definition: rte_ipsec.h:85
uint64_t sqn
Definition: rte_ipsec.h:30