dev: add more units for counters
Type: improvement
Change-Id: If6f70fc34f47c31a986ba837c9a35ce139decfb1
Signed-off-by: Damjan Marion <damjan.marion@gmail.com>
diff --git a/src/vnet/dev/cli.c b/src/vnet/dev/cli.c
index 53be448..608abcf 100644
--- a/src/vnet/dev/cli.c
+++ b/src/vnet/dev/cli.c
@@ -300,22 +300,23 @@
vlib_cli_output (vm, "device '%s':", dev->device_id);
foreach_vnet_dev_port (p, dev)
{
+ vlib_cli_output (vm, " Port %u:", p->port_id);
vlib_cli_output (vm, " %U", format_vnet_dev_counters, &fa,
p->counter_main);
foreach_vnet_dev_port_rx_queue (q, p)
if (q->counter_main)
{
- vlib_cli_output (vm, " RX queue %u:", q->queue_id);
- vlib_cli_output (vm, " %U", format_vnet_dev_counters, &fa,
+ vlib_cli_output (vm, " RX queue %u:", q->queue_id);
+ vlib_cli_output (vm, " %U", format_vnet_dev_counters, &fa,
q->counter_main);
}
foreach_vnet_dev_port_tx_queue (q, p)
if (q->counter_main)
{
- vlib_cli_output (vm, " TX queue %u:", q->queue_id);
- vlib_cli_output (vm, " %U", format_vnet_dev_counters, &fa,
+ vlib_cli_output (vm, " TX queue %u:", q->queue_id);
+ vlib_cli_output (vm, " %U", format_vnet_dev_counters, &fa,
q->counter_main);
}
}
diff --git a/src/vnet/dev/counters.c b/src/vnet/dev/counters.c
index d02839d..05cfc0a 100644
--- a/src/vnet/dev/counters.c
+++ b/src/vnet/dev/counters.c
@@ -89,6 +89,8 @@
char *units[] = {
[VNET_DEV_CTR_UNIT_BYTES] = "bytes",
[VNET_DEV_CTR_UNIT_PACKETS] = "packets",
+ [VNET_DEV_CTR_UNIT_DESCRIPTORS] = "descriptors",
+ [VNET_DEV_CTR_UNIT_BUFFERS] = "buffers",
};
if (c->type == VNET_DEV_CTR_TYPE_VENDOR)
diff --git a/src/vnet/dev/counters.h b/src/vnet/dev/counters.h
index 33d08ff..411ccdf 100644
--- a/src/vnet/dev/counters.h
+++ b/src/vnet/dev/counters.h
@@ -30,6 +30,8 @@
VNET_DEV_CTR_UNIT_NA,
VNET_DEV_CTR_UNIT_BYTES,
VNET_DEV_CTR_UNIT_PACKETS,
+ VNET_DEV_CTR_UNIT_DESCRIPTORS,
+ VNET_DEV_CTR_UNIT_BUFFERS,
} __clib_packed vnet_dev_counter_unit_t;
typedef struct vnet_dev_counter