DPDK 25.03.0-rc0
rte_swx_ipsec.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2022 Intel Corporation
3 */
4#ifndef __INCLUDE_RTE_SWX_IPSEC_H__
5#define __INCLUDE_RTE_SWX_IPSEC_H__
6
45#include <stdint.h>
46#include <stdio.h>
47#include <netinet/in.h>
48
49#include <rte_compat.h>
50#include <rte_crypto_sym.h>
51#include <rte_ip6.h>
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
62struct rte_swx_ipsec;
63
65#ifndef RTE_SWX_IPSEC_NAME_SIZE
66#define RTE_SWX_IPSEC_NAME_SIZE 64
67#endif
68
70#ifndef RTE_SWX_IPSEC_BURST_SIZE_MAX
71#define RTE_SWX_IPSEC_BURST_SIZE_MAX 256
72#endif
73
77 uint32_t ring_rd;
78
80 uint32_t ring_wr;
81
83 uint32_t crypto_wr;
84
86 uint32_t crypto_rd;
87};
88
94 const char *ring_in_name;
95
97 const char *ring_out_name;
98
100 const char *crypto_dev_name;
101
104
107
109 uint32_t n_sa_max;
110};
111
116 /* SA ID. */
117 uint32_t sa_id;
118};
119
128__rte_experimental
129struct rte_swx_ipsec *
130rte_swx_ipsec_find(const char *name);
131
150__rte_experimental
151int
152rte_swx_ipsec_create(struct rte_swx_ipsec **ipsec,
153 const char *name,
154 struct rte_swx_ipsec_params *params,
155 int numa_node);
156
163__rte_experimental
164void
165rte_swx_ipsec_free(struct rte_swx_ipsec *ipsec);
166
177__rte_experimental
178void
179rte_swx_ipsec_run(struct rte_swx_ipsec *ipsec);
180
181/*
182 * IPsec Control Plane API
183 */
184
186#define RTE_SWX_IPSEC_KEY_SIZE_MAX 64
187
192
195
197 uint32_t key_size;
198};
199
204
207
209 uint32_t key_size;
210};
211
216
219
221 uint32_t key_size;
222};
223
227 struct {
229 uint32_t spi;
231
234
237
239 union {
241 struct {
243 struct in_addr src_addr;
244
246 struct in_addr dst_addr;
248
250 struct {
253
258};
259
264
266 struct {
267 union {
268 struct {
271
274 } cipher_auth;
275
278 };
279
283
286};
287
300__rte_experimental
301int
302rte_swx_ipsec_sa_add(struct rte_swx_ipsec *ipsec,
303 struct rte_swx_ipsec_sa_params *sa_params,
304 uint32_t *sa_id);
305
317__rte_experimental
318void
319rte_swx_ipsec_sa_delete(struct rte_swx_ipsec *ipsec,
320 uint32_t sa_id);
321
370__rte_experimental
372rte_swx_ipsec_sa_read(struct rte_swx_ipsec *ipsec,
373 const char *string,
374 int *is_blank_or_comment,
375 const char **errmsg);
376
377#ifdef __cplusplus
378}
379#endif
380
381#endif
rte_crypto_auth_algorithm
rte_crypto_aead_algorithm
rte_crypto_cipher_algorithm
__rte_experimental void rte_swx_ipsec_free(struct rte_swx_ipsec *ipsec)
__rte_experimental void rte_swx_ipsec_sa_delete(struct rte_swx_ipsec *ipsec, uint32_t sa_id)
__rte_experimental int rte_swx_ipsec_create(struct rte_swx_ipsec **ipsec, const char *name, struct rte_swx_ipsec_params *params, int numa_node)
#define RTE_SWX_IPSEC_KEY_SIZE_MAX
__rte_experimental struct rte_swx_ipsec_sa_params * rte_swx_ipsec_sa_read(struct rte_swx_ipsec *ipsec, const char *string, int *is_blank_or_comment, const char **errmsg)
__rte_experimental int rte_swx_ipsec_sa_add(struct rte_swx_ipsec *ipsec, struct rte_swx_ipsec_sa_params *sa_params, uint32_t *sa_id)
__rte_experimental void rte_swx_ipsec_run(struct rte_swx_ipsec *ipsec)
__rte_experimental struct rte_swx_ipsec * rte_swx_ipsec_find(const char *name)
const char * ring_in_name
Definition: rte_swx_ipsec.h:94
struct rte_swx_ipsec_burst_size bsz
uint32_t crypto_dev_queue_pair_id
const char * crypto_dev_name
const char * ring_out_name
Definition: rte_swx_ipsec.h:97
enum rte_crypto_aead_algorithm alg
uint8_t key[RTE_SWX_IPSEC_KEY_SIZE_MAX]
enum rte_crypto_auth_algorithm alg
uint8_t key[RTE_SWX_IPSEC_KEY_SIZE_MAX]
enum rte_crypto_cipher_algorithm alg
uint8_t key[RTE_SWX_IPSEC_KEY_SIZE_MAX]
struct rte_swx_ipsec_sa_encap_params::@365::@366 ipv4
union rte_swx_ipsec_sa_encap_params::@365 tunnel
struct rte_swx_ipsec_sa_encap_params::@365::@367 ipv6
struct rte_swx_ipsec_sa_encap_params::@364 esp
struct rte_swx_ipsec_sa_authentication_params auth
struct rte_swx_ipsec_sa_cipher_params cipher
struct rte_swx_ipsec_sa_aead_params aead
struct rte_swx_ipsec_sa_params::@368 crypto
struct rte_swx_ipsec_sa_encap_params encap