From d53a95ceadd481401f3ae4c3279636c3e5050999 Mon Sep 17 00:00:00 2001 From: Piotr Bronowski Date: Fri, 9 Jun 2023 14:22:40 +0000 Subject: dpdk-cryptodev: introduce sw_ring This patch introduces sw_ring. This ring is used in next set of patchas and plays role of a buffer for QAT, allowing collecting frame elements in case QAT queue is fully utilized, and assembling frame from QAT dequeued elements. Type: improvement Signed-off-by: Piotr Bronowski Signed-off-by: Dastin Wilski Change-Id: I20718e200986ab4dba5cbc31c05a904072a6981a --- src/plugins/dpdk/cryptodev/cryptodev.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/plugins/dpdk/cryptodev/cryptodev.c') diff --git a/src/plugins/dpdk/cryptodev/cryptodev.c b/src/plugins/dpdk/cryptodev/cryptodev.c index 84a307d02ce..8750ffd3c31 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev.c +++ b/src/plugins/dpdk/cryptodev/cryptodev.c @@ -666,6 +666,40 @@ VLIB_CLI_COMMAND (show_cryptodev_assignment, static) = { .function = cryptodev_show_assignment_fn, }; +static clib_error_t * +cryptodev_show_sw_rings_fn (vlib_main_t *vm, unformat_input_t *input, + vlib_cli_command_t *cmd) +{ + cryptodev_main_t *cmt = &cryptodev_main; + u32 thread_index = 0; + vec_foreach_index (thread_index, cmt->per_thread_data) + { + cryptodev_engine_thread_t *cet = cmt->per_thread_data + thread_index; + if (vlib_num_workers () > 0 && thread_index == 0) + continue; + vlib_cli_output (vm, "\n\n"); + vlib_cli_output (vm, "Frames total: %d", cet->frames_on_ring); + vlib_cli_output (vm, "Frames pending in a ring: %d", + cet->frames_on_ring - cet->enqueued_not_dequeueq - + cet->deqeued_not_returned); + vlib_cli_output (vm, "Frames enqueued but not dequeued: %d", + cet->enqueued_not_dequeueq); + vlib_cli_output (vm, "Frames dequed but not returned: %d", + cet->deqeued_not_returned); + vlib_cli_output (vm, "inflight: %d", cet->inflight); + vlib_cli_output (vm, "Head: %d", cet->frame_ring.head); + vlib_cli_output (vm, "Tail: %d", cet->frame_ring.tail); + vlib_cli_output (vm, "\n\n"); + } + return 0; +} + +VLIB_CLI_COMMAND (show_cryptodev_sw_rings, static) = { + .path = "show cryptodev sw-ring status", + .short_help = "show status of all cryptodev software rings", + .function = cryptodev_show_sw_rings_fn, +}; + static clib_error_t * cryptodev_set_assignment_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) -- cgit 1.2.3-korg