29 #define foreach_dpdk_crypto_input_error \ 30 _(DQ_COPS, "Crypto ops dequeued") \ 31 _(AUTH_FAILED, "Crypto verification failed") \ 32 _(STATUS, "Crypto operation failed") 36 #define _(f,s) DPDK_CRYPTO_INPUT_ERROR_##f, 55 #define foreach_cryptodev_status \ 56 _(SUCCESS, "success") \ 57 _(NOT_PROCESSED, "not processed") \ 58 _(AUTH_FAILED, "auth failed") \ 59 _(INVALID_SESSION, "invalid session") \ 60 _(INVALID_ARGS, "invalid arguments") \ 66 u32 status = va_arg (*args,
u32);
71 #define _(x, z) case RTE_CRYPTO_OP_STATUS_##x: str = z; break; 94 struct rte_crypto_op *op0,
u16 * next)
96 if (
PREDICT_FALSE (op0->status != RTE_CRYPTO_OP_STATUS_SUCCESS))
98 next[0] = DPDK_CRYPTO_INPUT_NEXT_DROP;
101 DPDK_CRYPTO_INPUT_ERROR_STATUS, 1);
103 if (op0->status == RTE_CRYPTO_OP_STATUS_AUTH_FAILED)
106 DPDK_CRYPTO_INPUT_ERROR_AUTH_FAILED, 1);
112 struct rte_crypto_op **ops,
u32 n_deq)
119 while (n_trace && n_left)
122 struct rte_crypto_op *op0;
150 u8 numa = rte_socket_id ();
159 struct rte_crypto_op **ops;
165 n_ops = n_deq = rte_cryptodev_dequeue_burst (res->
dev_id,
166 res->
qp_id + outbound,
179 struct rte_crypto_op *op0, *op1, *op2, *op3;
225 op0->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
226 op1->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
227 op2->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
228 op3->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
238 struct rte_crypto_op *op0;
251 op0->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
261 DPDK_CRYPTO_INPUT_ERROR_DQ_COPS, n_deq);
334 .name =
"dpdk-crypto-input",
337 .state = VLIB_NODE_STATE_DISABLED,
343 #define _(s,n) [DPDK_CRYPTO_INPUT_NEXT_##s] = n,
dpdk_crypto_input_error_t
#define vlib_buffer_from_rte_mbuf(x)
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
#define foreach_dpdk_crypto_input_next
static_always_inline u32 dpdk_crypto_dequeue(vlib_main_t *vm, vlib_node_runtime_t *node, crypto_resource_t *res, u8 outbound)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define VLIB_NODE_FN(node)
vlib_node_registration_t dpdk_crypto_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_crypto_input_node)
static void dpdk_crypto_input_trace(vlib_main_t *vm, vlib_node_runtime_t *node, struct rte_crypto_op **ops, u32 n_deq)
static void vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
static_always_inline void crypto_free_ops(u8 numa, struct rte_crypto_op **ops, u32 n)
#define static_always_inline
dpdk_crypto_main_t dpdk_crypto_main
static_always_inline uword dpdk_crypto_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
#define foreach_dpdk_crypto_input_error
#define vec_del1(v, i)
Delete the element at index I.
u32 node_index
Node index.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
static_always_inline void dpdk_crypto_input_check_op(vlib_main_t *vm, vlib_node_runtime_t *node, struct rte_crypto_op *op0, u16 *next)
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
#define vec_free(V)
Free vector's memory (no header).
static char * dpdk_crypto_input_error_strings[]
#define foreach_cryptodev_status
crypto_worker_main_t * workers_main
crypto_resource_t * resource
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static u8 * format_dpdk_crypto_input_trace(u8 *s, va_list *args)
struct rte_crypto_op ** ops
static u8 * format_cryptodev_status(u8 *s, va_list *args)
#define vec_foreach(var, vec)
Vector iterator.
static void vlib_set_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 count)
#define CLIB_CACHE_LINE_BYTES
static_always_inline dpdk_op_priv_t * crypto_op_get_priv(struct rte_crypto_op *op)