15 #ifndef __DPDK_IPSEC_H__ 16 #define __DPDK_IPSEC_H__ 21 #include <rte_crypto.h> 22 #include <rte_cryptodev.h> 25 #define always_inline static inline 27 #define always_inline static inline __attribute__ ((__always_inline__)) 31 #define MAX_QP_PER_LCORE 16 91 #define CRYPTO_N_FREE_COPS (VLIB_FRAME_SIZE * 3) 114 n_alloc = rte_crypto_op_bulk_alloc (dcm->
cop_pools[socket_id],
115 RTE_CRYPTO_OP_TYPE_SYMMETRIC,
133 rte_mempool_put_bulk (cops[0]->mempool,
148 enum rte_crypto_sym_xform_type
type;
151 enum rte_crypto_auth_algorithm auth;
152 enum rte_crypto_cipher_algorithm cipher;
158 .type = RTE_CRYPTO_SYM_XFORM_CIPHER,.cipher =
159 RTE_CRYPTO_CIPHER_NULL,.name =
"NULL"},
161 .type = RTE_CRYPTO_SYM_XFORM_CIPHER,.cipher =
162 RTE_CRYPTO_CIPHER_AES_CBC,.name =
"AES_CBC"},
164 .type = RTE_CRYPTO_SYM_XFORM_CIPHER,.cipher =
165 RTE_CRYPTO_CIPHER_AES_CTR,.name =
"AES_CTR"},
167 .type = RTE_CRYPTO_SYM_XFORM_CIPHER,.cipher =
168 RTE_CRYPTO_CIPHER_3DES_CBC,.name =
"3DES-CBC"},
170 .type = RTE_CRYPTO_SYM_XFORM_CIPHER,.auth =
171 RTE_CRYPTO_CIPHER_AES_GCM,.name =
"AES-GCM"},
173 .type = RTE_CRYPTO_SYM_XFORM_AUTH,.auth =
174 RTE_CRYPTO_AUTH_SHA1_HMAC,.name =
"HMAC-SHA1"},
176 .type = RTE_CRYPTO_SYM_XFORM_AUTH,.auth =
177 RTE_CRYPTO_AUTH_SHA256_HMAC,.name =
"HMAC-SHA256"},
179 .type = RTE_CRYPTO_SYM_XFORM_AUTH,.auth =
180 RTE_CRYPTO_AUTH_SHA384_HMAC,.name =
"HMAC-SHA384"},
182 .type = RTE_CRYPTO_SYM_XFORM_AUTH,.auth =
183 RTE_CRYPTO_AUTH_SHA512_HMAC,.name =
"HMAC-SHA512"},
185 .type = RTE_CRYPTO_SYM_XFORM_AUTH,.auth =
186 RTE_CRYPTO_AUTH_AES_XCBC_MAC,.name =
"AES-XCBC-MAC"},
188 .type = RTE_CRYPTO_SYM_XFORM_AUTH,.auth =
189 RTE_CRYPTO_AUTH_AES_GCM,.name =
"AES-GCM"},
192 .type = RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED},};
195 if (cap->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC)
198 while (supported_algo[i].
type != RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED)
200 if (cap->sym.xform_type == supported_algo[i].type)
202 if ((cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_CIPHER &&
203 cap->sym.cipher.algo == supported_algo[i].cipher) ||
204 (cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AUTH &&
205 cap->sym.auth.algo == supported_algo[i].auth))
208 strcpy (name, supported_algo[i].name);
struct rte_crypto_op ** free_cops
sll srl srl sll sra u16x4 i
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
struct _vlib_node_registration vlib_node_registration_t
#define vec_alloc(V, N)
Allocate space for N more elements (no header, unspecified alignment)
static_always_inline void crypto_free_cop(crypto_qp_data_t *qpd, struct rte_crypto_op **cops, u32 n)
#define static_always_inline
vlib_node_registration_t dpdk_crypto_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_crypto_input_node)
dpdk_crypto_main_t dpdk_crypto_main
static_always_inline void crypto_alloc_cops()
uword os_get_cpu_number(void)
#define CRYPTO_N_FREE_COPS
#define clib_memcpy(a, b, c)
struct rte_mempool ** cop_pools
crypto_worker_main_t * workers_main
crypto_qp_data_t * qp_data
static_always_inline int check_algo_is_supported(const struct rte_cryptodev_capabilities *cap, char *name)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_foreach(var, vec)
Vector iterator.