31 rte_cryptodevs[dev->
id].data->dev_started ?
"up" :
"down");
33 s =
format (s,
" free_resources %u, used_resources %u\n",
38 for (mask = 1; mask != 0; mask <<= 1)
45 rte_cryptodev_get_feature_name (feat));
52 s =
format (s,
" Cipher:");
116 .path =
"show dpdk crypto devices",
117 .short_help =
"show dpdk crypto devices",
125 u32 thread_idx = va_arg (*args,
u32);
126 u8 verbose = (
u8) va_arg (*args,
u32);
136 s =
format (s,
"Thread %u (%v):\n", thread_idx,
144 s =
format (s,
"%s%-20s dev-id %2u inbound-queue %2u outbound-queue %2u\n",
151 s =
format (s,
"%sCipher:", ind);
161 s =
format (s,
"%sAuth:", ind);
239 .path =
"show dpdk crypto placement",
240 .short_help =
"show dpdk crypto placement",
273 .path =
"show dpdk crypto placement verbose",
274 .short_help =
"show dpdk crypto placement verbose",
290 u8 dev_idx, auto_en = 0;
297 if (
unformat (line_input,
"%u %u", &dev_idx, &thread_idx))
299 else if (
unformat (line_input,
"auto"))
334 thread_idx, dev_idx);
371 if (idx[0] == res_idx)
389 .path =
"set dpdk crypto placement",
390 .short_help =
"set dpdk crypto placement (<device> <thread> | auto)",
433 u32 thread_idx = (
u32) ~ 0;
435 u8 dev_idx = (
u8) ~ 0;
443 if (
unformat (line_input,
"%u %u", &dev_idx, &thread_idx))
445 else if (
unformat (line_input,
"%u", &dev_idx))
485 thread_idx, dev_idx);
494 .path =
"clear dpdk crypto placement",
495 .short_help =
"clear dpdk crypto placement <device> [<thread>]",
503 struct rte_mempool *mp = va_arg (*args,
struct rte_mempool *);
505 u32 count = rte_mempool_avail_count (mp);
507 s =
format (s,
"%s\n%Uavailable %7d, allocated %7d total %7d\n",
509 count, mp->size - count, mp->size);
510 s =
format (s,
"%Uphys_addr %p, flags %08x, nb_mem_chunks %u\n",
512 mp->mz->phys_addr, mp->flags, mp->nb_mem_chunks);
513 s =
format (s,
"%Uelt_size %4u, header_size %3u, trailer_size %u\n",
515 mp->elt_size, mp->header_size, mp->trailer_size);
516 s =
format (s,
"%Uprivate_data_size %3u, total_elt_size %u\n",
518 mp->private_data_size,
519 mp->elt_size + mp->header_size + mp->trailer_size);
538 struct rte_mempool **mp;
576 .path =
"show dpdk crypto pools",
577 .short_help =
"show dpdk crypto pools",
#define vec_foreach_index(var, v)
Iterate over vector indices.
static clib_error_t * show_dpdk_crypto_placement_v_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
for(i=1;i<=collision_buckets;i++)
#define vec_pop(V)
Returns last element of a vector and decrements its length.
u16 cipher_resource_idx[IPSEC_CRYPTO_N_ALG]
dpdk_crypto_main_t dpdk_crypto_main
static clib_error_t * show_dpdk_crypto_pools_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_error_return(e, args...)
#define vec_end(v)
End (last data address) of vector.
vlib_worker_thread_t * vlib_worker_threads
crypto_alg_t * cipher_algs
u8 * format_dpdk_mempool(u8 *s, va_list *args)
static u8 * format_crypto(u8 *s, va_list *args)
static u8 * format_crypto_worker(u8 *s, va_list *args)
struct rte_mempool ** session_drv
static void dpdk_crypto_clear_resource(u16 res_idx)
#define VLIB_CLI_COMMAND(x,...)
struct rte_mempool * crypto_op
crypto_worker_main_t * workers_main
static clib_error_t * show_dpdk_crypto_placement_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
crypto_resource_t * resource
struct rte_mempool * session_h
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void crypto_auto_placement(void)
static clib_error_t * set_dpdk_crypto_placement_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * clear_dpdk_crypto_placement_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u32 vlib_num_workers()
static clib_error_t * common_crypto_placement_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, u8 verbose)
u16 auth_resource_idx[IPSEC_INTEG_N_ALG]
u8 auth_support[IPSEC_INTEG_N_ALG]
#define vec_foreach(var, vec)
Vector iterator.
static clib_error_t * show_dpdk_crypto_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u8 cipher_support[IPSEC_CRYPTO_N_ALG]