diff options
author | Piotr Bronowski <piotrx.bronowski@intel.com> | 2023-09-05 21:18:59 +0000 |
---|---|---|
committer | Fan Zhang <fanzhang.oss@gmail.com> | 2023-09-07 08:05:54 +0000 |
commit | c143cc8967c9e0471e0cb85bf847c6634deeda25 (patch) | |
tree | 4e1be4fd7fceece58c9d399178072c3756da2e0d | |
parent | f0fc65a4b949a6e5a44250d405ce219b8e547859 (diff) |
dpdk-cryptodev: fix cache ring stats cli command
The logic for calcuating processed elements in the cache ring was broken.
In case tail and deq_tail equals and frame element pointed by the tile
is not NULL it means there is exactly one processed element in the ring.
Type: fix
Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
Change-Id: I69c978334fc952049393214ccc9cc5245351f7f7
-rw-r--r-- | src/plugins/dpdk/cryptodev/cryptodev.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/plugins/dpdk/cryptodev/cryptodev.c b/src/plugins/dpdk/cryptodev/cryptodev.c index c66e9ed9427..4e8bc026f58 100644 --- a/src/plugins/dpdk/cryptodev/cryptodev.c +++ b/src/plugins/dpdk/cryptodev/cryptodev.c @@ -698,26 +698,24 @@ cryptodev_show_cache_rings_fn (vlib_main_t *vm, unformat_input_t *input, (CRYPTODEV_CACHE_QUEUE_MASK - deq_tail + enq_head); u16 n_frames_processed = - ((tail == deq_tail) && (ring->frames[deq_tail].f == 0)) ? - 0 : - ((tail == deq_tail) && (ring->frames[deq_tail].f != 0)) ? - (CRYPTODEV_CACHE_QUEUE_MASK + 1) : - (deq_tail > tail) ? (deq_tail - tail) : - (CRYPTODEV_CACHE_QUEUE_MASK - tail + deq_tail); + ((tail == deq_tail) && (ring->frames[deq_tail].f == 0)) ? 0 : + ((tail == deq_tail) && (ring->frames[deq_tail].f != 0)) ? 1 : + (deq_tail > tail) ? (deq_tail - tail + 1) : + (CRYPTODEV_CACHE_QUEUE_MASK - tail + deq_tail - 1); if (vlib_num_workers () > 0 && thread_index == 0) continue; + vlib_cli_output (vm, "\n\n"); - vlib_cli_output (vm, "Frames total: %d", n_cached); - vlib_cli_output (vm, "Frames pending in the ring: %d", + vlib_cli_output (vm, "Frames total: %u", n_cached); + vlib_cli_output (vm, "Frames pending in the ring: %u", n_cached - n_frames_inflight - n_frames_processed); - vlib_cli_output (vm, "Frames enqueued but not dequeued: %d", - n_frames_inflight); - vlib_cli_output (vm, "Frames dequed but not returned: %d", + vlib_cli_output (vm, "Frames inflight: %u", n_frames_inflight); + vlib_cli_output (vm, "Frames dequed but not returned: %u", n_frames_processed); - vlib_cli_output (vm, "inflight: %d", cet->inflight); - vlib_cli_output (vm, "Head: %d", ring->head); - vlib_cli_output (vm, "Tail: %d", ring->tail); + vlib_cli_output (vm, "Elements inflight: %u", cet->inflight); + vlib_cli_output (vm, "Head: %u", head); + vlib_cli_output (vm, "Tail: %u", tail); vlib_cli_output (vm, "\n\n"); } return 0; |