29 #define foreach_dpdk_crypto_input_error \ 30 _(DQ_COPS, "Crypto ops dequeued") \ 31 _(STATUS, "Crypto operation failed") 35 #define _(f,s) DPDK_CRYPTO_INPUT_ERROR_##f, 54 #define foreach_cryptodev_status \ 55 _(SUCCESS, "success") \ 56 _(NOT_PROCESSED, "not processed") \ 57 _(AUTH_FAILED, "auth failed") \ 58 _(INVALID_SESSION, "invalid session") \ 59 _(INVALID_ARGS, "invalid arguments") \ 65 u32 status = va_arg (*args,
u32);
70 #define _(x, z) case RTE_CRYPTO_OP_STATUS_##x: str = z; break; 95 u32 n_deq, total_n_deq = 0, *to_next = 0, n_ops, next_index;
98 u8 numa = rte_socket_id ();
101 struct rte_crypto_op **ops;
108 n_ops = rte_cryptodev_dequeue_burst (res->
dev_id,
109 res->
qp_id + outbound,
115 total_n_deq += n_ops;
123 while (n_ops > 0 && n_left_to_next > 0)
127 struct rte_crypto_op *op;
137 if (
PREDICT_FALSE (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS))
139 next0 = DPDK_CRYPTO_INPUT_NEXT_DROP;
142 DPDK_CRYPTO_INPUT_ERROR_STATUS,
162 op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
165 n_left_to_next, bi0, next0);
175 DPDK_CRYPTO_INPUT_ERROR_DQ_COPS, total_n_deq);
240 .name =
"dpdk-crypto-input",
243 .state = VLIB_NODE_STATE_DISABLED,
249 #define _(s,n) [DPDK_CRYPTO_INPUT_NEXT_##s] = n,
dpdk_crypto_input_error_t
#define vlib_buffer_from_rte_mbuf(x)
#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).
vlib_node_registration_t dpdk_crypto_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_crypto_input_node)
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
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void vlib_trace_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index)
#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 VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define foreach_dpdk_crypto_input_error
static uword dpdk_crypto_input_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_del1(v, i)
Delete the element at index I.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_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 vec_free(V)
Free vector's memory (no header).
static char * dpdk_crypto_input_error_strings[]
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#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.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static_always_inline dpdk_op_priv_t * crypto_op_get_priv(struct rte_crypto_op *op)