27 #define foreach_dpdk_crypto_input_next \ 28 _(DROP, "error-drop") \ 29 _(ENCRYPT_POST, "dpdk-esp-encrypt-post") \ 30 _(DECRYPT_POST, "dpdk-esp-decrypt-post") 34 #define _(f,s) DPDK_CRYPTO_INPUT_NEXT_##f, 40 #define foreach_dpdk_crypto_input_error \ 41 _(DQ_COPS, "Crypto ops dequeued") \ 42 _(COP_FAILED, "Crypto op failed") 46 #define _(f,s) DPDK_CRYPTO_INPUT_ERROR_##f, 76 s =
format (s,
"dpdk_crypto: cryptodev-id %u queue-pair %u next-index %d",
88 u32 n_deq, *to_next = 0, next_index, n_cops, def_next_index;
89 struct rte_crypto_op **cops = qpd->
cops;
95 def_next_index = DPDK_CRYPTO_INPUT_NEXT_ENCRYPT_POST;
97 def_next_index = DPDK_CRYPTO_INPUT_NEXT_DECRYPT_POST;
99 n_cops = rte_cryptodev_dequeue_burst (qpd->
dev_id, qpd->
qp_id,
102 next_index = def_next_index;
113 while (n_cops > 0 && n_left_to_next > 0)
117 struct rte_crypto_op *cop;
118 struct rte_crypto_sym_op *sym_cop;
125 next0 = def_next_index;
127 if (
PREDICT_FALSE (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS))
129 next0 = DPDK_CRYPTO_INPUT_NEXT_DROP;
131 DPDK_CRYPTO_INPUT_ERROR_COP_FAILED,
134 cop->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
136 sym_cop = (
struct rte_crypto_sym_op *) (cop + 1);
156 n_left_to_next, bi0, next0);
164 DPDK_CRYPTO_INPUT_ERROR_DQ_COPS, n_deq);
190 VLIB_NODE_STATE_DISABLED,.n_errors =
195 #define _(s,n) [DPDK_CRYPTO_INPUT_NEXT_##s] = n, 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.
dpdk_crypto_input_error_t
static_always_inline u32 dpdk_crypto_dequeue(vlib_main_t *vm, vlib_node_runtime_t *node, crypto_qp_data_t *qpd)
struct _vlib_node_registration vlib_node_registration_t
vlib_node_registration_t dpdk_crypto_input_node
(constructor) VLIB_REGISTER_NODE (dpdk_crypto_input_node)
static_always_inline void crypto_free_cop(crypto_qp_data_t *qpd, struct rte_crypto_op **cops, u32 n)
#define static_always_inline
static void vlib_trace_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
dpdk_crypto_main_t dpdk_crypto_main
#define foreach_dpdk_crypto_input_error
#define foreach_dpdk_crypto_input_next
uword os_get_cpu_number(void)
static uword dpdk_crypto_input_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
struct rte_crypto_op * cops[VLIB_FRAME_SIZE]
#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)
static char * dpdk_crypto_input_error_strings[]
crypto_worker_main_t * workers_main
#define VLIB_BUFFER_IS_TRACED
crypto_qp_data_t * qp_data
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u8 * format_dpdk_crypto_input_trace(u8 *s, va_list *args)
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
#define vlib_buffer_from_rte_mbuf(x)
#define vec_foreach(var, vec)
Vector iterator.
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.