DPDK 22.11.5
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_compat.h>
18#include <rte_ipsec_sa.h>
19#include <rte_mbuf.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
26
37 union {
38 uint16_t (*async)(const struct rte_ipsec_session *ss,
39 struct rte_mbuf *mb[],
40 struct rte_crypto_op *cop[],
41 uint16_t num);
42 uint16_t (*sync)(const struct rte_ipsec_session *ss,
43 struct rte_mbuf *mb[],
44 uint16_t num);
45 } prepare;
46 uint16_t (*process)(const struct rte_ipsec_session *ss,
47 struct rte_mbuf *mb[],
48 uint16_t num);
49};
50
64 struct rte_ipsec_sa *sa;
68 union {
69 struct {
70 struct rte_cryptodev_sym_session *ses;
71 uint8_t dev_id;
72 } crypto;
73 struct {
74 struct rte_security_session *ses;
75 struct rte_security_ctx *ctx;
76 uint32_t ol_flags;
77 } security;
78 };
82
94int
96
118static inline uint16_t
120 struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
121{
122 return ss->pkt_func.prepare.async(ss, mb, cop, num);
123}
124
125static inline uint16_t
126rte_ipsec_pkt_cpu_prepare(const struct rte_ipsec_session *ss,
127 struct rte_mbuf *mb[], uint16_t num)
128{
129 return ss->pkt_func.prepare.sync(ss, mb, num);
130}
131
155static inline uint16_t
156rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
157 uint16_t num)
158{
159 return ss->pkt_func.process(ss, mb, num);
160}
161
162
171__rte_experimental
172int
173rte_ipsec_telemetry_sa_add(const struct rte_ipsec_sa *sa);
174
181__rte_experimental
182void
183rte_ipsec_telemetry_sa_del(const struct rte_ipsec_sa *sa);
184
185#include <rte_ipsec_group.h>
186
187#ifdef __cplusplus
188}
189#endif
190
191#endif /* _RTE_IPSEC_H_ */
#define __rte_cache_aligned
Definition: rte_common.h:440
__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:119
__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:156
rte_security_session_action_type
Definition: rte_security.h:622
struct rte_ipsec_sa_pkt_func pkt_func
Definition: rte_ipsec.h:80
struct rte_ipsec_sa * sa
Definition: rte_ipsec.h:64
enum rte_security_session_action_type type
Definition: rte_ipsec.h:66