summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/cli.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2021-10-15 08:35:56 -0700
committerDamjan Marion <dmarion@me.com>2021-10-16 08:33:09 +0000
commit27c56681d81c814be15f69bd41f98ef7b3606564 (patch)
treed3bca27626f9e542e068ed283ca0adbbbacc7605 /src/plugins/memif/cli.c
parent0d27e3e7a1d5ddd572718818a56270bac639ea2e (diff)
memif: Enhance show memif descriptors to display region
memif descriptors table may have more than one shared memory region. To see whether a descriptor's memory address is valid or not, it is beneficial to also display the descriptor's region. While at it, fix the truncation problem for the offset field. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ia3b7062ac0323c39ade6f3a58333c6405889148f
Diffstat (limited to 'src/plugins/memif/cli.c')
-rw-r--r--src/plugins/memif/cli.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/plugins/memif/cli.c b/src/plugins/memif/cli.c
index b313e9737b3..056364c3e4a 100644
--- a/src/plugins/memif/cli.c
+++ b/src/plugins/memif/cli.c
@@ -378,23 +378,22 @@ format_memif_descriptor (u8 * s, va_list * args)
if (ring)
{
s = format (s, "%Udescriptor table:\n", format_white_space, indent);
- s =
- format (s,
- "%Uid flags len address offset user address\n",
- format_white_space, indent);
- s =
- format (s,
- "%U===== ===== ======== ================== ====== ==================\n",
- format_white_space, indent);
+ s = format (s,
+ "%Uid flags region len address offset "
+ " user address\n",
+ format_white_space, indent);
+ s = format (s,
+ "%U===== ===== ====== ======== ================== "
+ "========== ==================\n",
+ format_white_space, indent);
for (slot = 0; slot < ring_size; slot++)
{
- s = format (s, "%U%-5d %-5d %-7d 0x%016lx %-6d 0x%016lx\n",
- format_white_space, indent, slot,
- ring->desc[slot].flags,
- ring->desc[slot].length,
+ s = format (s, "%U%-5d %-5d %-6d %-7d 0x%016lx %-10d 0x%016lx\n",
+ format_white_space, indent, slot, ring->desc[slot].flags,
+ ring->desc[slot].region, ring->desc[slot].length,
mif->regions[ring->desc[slot].region].shm,
- ring->desc[slot].offset, memif_get_buffer (mif, ring,
- slot));
+ ring->desc[slot].offset,
+ memif_get_buffer (mif, ring, slot));
}
s = format (s, "\n");
}