diff options
author | Dau Do <daudo@yahoo.com> | 2024-08-29 03:03:16 -0700 |
---|---|---|
committer | Dau Do <daudo@yahoo.com> | 2024-08-29 03:06:34 -0700 |
commit | b8d4490d9ce46ecb17899c9d40cdaae0744403fc (patch) | |
tree | 08965b1b44e745b002377426d65ccb5ac69e874a /src | |
parent | b4808de24779cd0037568cff003b915e25edbdc6 (diff) |
avf: add num tx/rx packets per queue
Type: improvement
Change-Id: I3459dba86eb7a784448633b69492d6d3f49db720
Signed-off-by: Dau Do <daudo@yahoo.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/avf/avf.h | 3 | ||||
-rw-r--r-- | src/plugins/avf/device.c | 4 | ||||
-rw-r--r-- | src/plugins/avf/format.c | 17 | ||||
-rw-r--r-- | src/plugins/avf/input.c | 2 | ||||
-rw-r--r-- | src/plugins/avf/output.c | 2 |
5 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h index f6f79cf0e09..774aac0151b 100644 --- a/src/plugins/avf/avf.h +++ b/src/plugins/avf/avf.h @@ -180,6 +180,7 @@ typedef struct u8 int_mode; u8 buffer_pool_index; u32 queue_index; + u64 total_packets; } avf_rxq_t; typedef struct @@ -198,6 +199,8 @@ typedef struct avf_tx_desc_t *tmp_descs; u32 *tmp_bufs; u32 queue_index; + u64 total_packets; + u64 no_free_tx_count; } avf_txq_t; typedef struct diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index 1618800c432..98169f0bcfe 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -288,6 +288,7 @@ avf_rxq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 rxq_size) d->qword[0] = vlib_buffer_get_pa (vm, b); d++; } + rxq->total_packets = 0; return 0; } @@ -337,6 +338,9 @@ avf_txq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 txq_size) vec_validate_aligned (txq->tmp_descs, txq->size, CLIB_CACHE_LINE_BYTES); vec_validate_aligned (txq->tmp_bufs, txq->size, CLIB_CACHE_LINE_BYTES); + txq->total_packets = 0; + txq->no_free_tx_count = 0; + return 0; } diff --git a/src/plugins/avf/format.c b/src/plugins/avf/format.c index 0a153a093d9..436f5b9fbf2 100644 --- a/src/plugins/avf/format.c +++ b/src/plugins/avf/format.c @@ -104,6 +104,7 @@ format_avf_device (u8 * s, va_list * args) u8 *a = 0; avf_rxq_t *rxq = vec_elt_at_index (ad->rxqs, 0); avf_txq_t *txq = vec_elt_at_index (ad->txqs, 0); + u32 idx = 0; s = format (s, "rx: queues %u, desc %u (min %u max %u)", ad->n_rx_queues, rxq->size, AVF_QUEUE_SZ_MIN, AVF_QUEUE_SZ_MAX); @@ -114,6 +115,22 @@ format_avf_device (u8 * s, va_list * args) format_avf_device_flags, ad); s = format (s, "\n%Ucapability flags: %U", format_white_space, indent, format_avf_vf_cap_flags, ad->cap_flags); + s = + format (s, "\n%U Rx Queue: Total Packets", format_white_space, indent + 4); + for (idx = 0; idx < ad->n_rx_queues; idx++) + { + rxq = vec_elt_at_index (ad->rxqs, idx); + s = format (s, "\n%U %8u : %llu", format_white_space, indent + 4, idx, + rxq->total_packets); + } + s = format (s, "\n%U Tx Queue: Total Packets\t Total Drops", + format_white_space, indent + 4); + for (idx = 0; idx < ad->n_tx_queues; idx++) + { + txq = vec_elt_at_index (ad->txqs, idx); + s = format (s, "\n%U %8u : %llu\t %llu", format_white_space, indent + 4, + idx, txq->total_packets, txq->no_free_tx_count); + } s = format (s, "\n%Unum-queue-pairs %d max-vectors %u max-mtu %u " "rss-key-size %u rss-lut-size %u", format_white_space, indent, diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c index 06007db540d..890259c88ab 100644 --- a/src/plugins/avf/input.c +++ b/src/plugins/avf/input.c @@ -539,6 +539,8 @@ done: else avf_rxq_refill (vm, node, rxq, 0 /* use_va_dma */ ); + rxq->total_packets += n_rx_packets; + return n_rx_packets; } diff --git a/src/plugins/avf/output.c b/src/plugins/avf/output.c index daa86ae86b2..0952886aaee 100644 --- a/src/plugins/avf/output.c +++ b/src/plugins/avf/output.c @@ -510,6 +510,7 @@ retry: avf_tail_write (txq->qtx_tail, txq->next); txq->n_enqueued += n_desc; n_left -= n_enq; + txq->total_packets += n_enq; } if (n_left) @@ -522,6 +523,7 @@ retry: vlib_buffer_free (vm, buffers, n_left); vlib_error_count (vm, node->node_index, AVF_TX_ERROR_NO_FREE_SLOTS, n_left); + txq->no_free_tx_count += n_left; } if (tf->shared_queue) |