29 #define foreach_dpdk_crypto_input_next \ 30 _(DROP, "error-drop") \ 31 _(ENCRYPT_POST, "dpdk-esp-encrypt-post") \ 32 _(DECRYPT_POST, "dpdk-esp-decrypt-post") 36 #define _(f,s) DPDK_CRYPTO_INPUT_NEXT_##f, 42 #define foreach_dpdk_crypto_input_error \ 43 _(DQ_COPS, "Crypto ops dequeued") \ 44 _(COP_FAILED, "Crypto op failed") 48 #define _(f,s) DPDK_CRYPTO_INPUT_ERROR_##f, 78 s =
format (s,
"dpdk_crypto: cryptodev-id %u queue-pair %u next-index %d",
90 u32 n_deq, *to_next = 0, next_index, n_cops, def_next_index;
91 struct rte_crypto_op **cops = qpd->
cops;
97 def_next_index = DPDK_CRYPTO_INPUT_NEXT_ENCRYPT_POST;
99 def_next_index = DPDK_CRYPTO_INPUT_NEXT_DECRYPT_POST;
101 n_cops = rte_cryptodev_dequeue_burst (qpd->
dev_id, qpd->
qp_id,
104 next_index = def_next_index;
115 while (n_cops > 0 && n_left_to_next > 0)
119 struct rte_crypto_op *cop;
120 struct rte_crypto_sym_op *sym_cop;
127 next0 = def_next_index;
129 if (
PREDICT_FALSE (cop->status != RTE_CRYPTO_OP_STATUS_SUCCESS))
131 next0 = DPDK_CRYPTO_INPUT_NEXT_DROP;
133 DPDK_CRYPTO_INPUT_ERROR_COP_FAILED,
136 cop->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
138 sym_cop = (
struct rte_crypto_sym_op *) (cop + 1);
158 n_left_to_next, bi0, next0);
166 DPDK_CRYPTO_INPUT_ERROR_DQ_COPS, n_deq);
192 .name =
"dpdk-crypto-input",
195 .state = VLIB_NODE_STATE_DISABLED,
201 #define _(s,n) [DPDK_CRYPTO_INPUT_NEXT_##s] = n,
dpdk_crypto_input_error_t
#define vlib_buffer_from_rte_mbuf(x)
static_always_inline u32 dpdk_crypto_dequeue(vlib_main_t *vm, vlib_node_runtime_t *node, crypto_qp_data_t *qpd)
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.
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)
dpdk_crypto_main_t dpdk_crypto_main
#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.
#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)
#define VLIB_BUFFER_IS_TRACED
static char * dpdk_crypto_input_error_strings[]
crypto_worker_main_t * workers_main
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 vec_foreach(var, vec)
Vector iterator.
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.