30 #define foreach_dpdk_crypto_input_error \ 31 _(DQ_COPS, "Crypto ops dequeued") \ 32 _(AUTH_FAILED, "Crypto verification failed") \ 33 _(STATUS, "Crypto operation failed") 37 #define _(f,s) DPDK_CRYPTO_INPUT_ERROR_##f, 72 struct rte_crypto_op *op0,
u16 * next)
74 if (
PREDICT_FALSE (op0->status != RTE_CRYPTO_OP_STATUS_SUCCESS))
76 next[0] = DPDK_CRYPTO_INPUT_NEXT_DROP;
79 DPDK_CRYPTO_INPUT_ERROR_STATUS, 1);
81 if (op0->status == RTE_CRYPTO_OP_STATUS_AUTH_FAILED)
84 DPDK_CRYPTO_INPUT_ERROR_AUTH_FAILED, 1);
98 while (n_trace && n_left)
129 u8 numa = rte_socket_id ();
133 struct rte_crypto_op **ops;
139 n_ops = n_deq = rte_cryptodev_dequeue_burst (res->
dev_id,
151 struct rte_crypto_op *op0, *op1, *op2, *op3;
191 op0->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
192 op1->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
193 op2->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
194 op3->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
204 struct rte_crypto_op *op0;
213 op0->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
223 DPDK_CRYPTO_INPUT_ERROR_DQ_COPS, n_deq);
294 .name =
"dpdk-crypto-input",
297 .state = VLIB_NODE_STATE_DISABLED,
303 #define _(s,n) [DPDK_CRYPTO_INPUT_NEXT_##s] = n,
dpdk_crypto_input_error_t
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, crypto_worker_main_t *cwm, vlib_node_runtime_t *node, crypto_resource_t *res)
#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 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.
#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,...)
#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[]
crypto_worker_main_t * workers_main
static void dpdk_crypto_input_trace(vlib_main_t *vm, vlib_node_runtime_t *node, u8 dev_id, u32 *bis, u16 *nexts, u32 n_deq)
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)
VLIB buffer representation.
struct rte_crypto_op ** ops
#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 vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static_always_inline dpdk_op_priv_t * crypto_op_get_priv(struct rte_crypto_op *op)