summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/cli.c
diff options
context:
space:
mode:
authorChun Li <chunl2@cisco.com>2018-02-06 15:17:20 +0800
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-09 09:08:01 +0000
commit15e598c76e815786dea8e964db7b6de35a2fc4ca (patch)
treef0e11fc2a5c66732d18f08c3a26ddad844ac4aa2 /src/plugins/memif/cli.c
parent08118f00e113424ca8ae22d83c766b14297a15f8 (diff)
memif: fix crash caused by zero pkt len in memif and clear dirty cache while interface reconnect.
Change-Id: Ifc7eb2494a22c334d8899422545fca1a4bba4d05 Signed-off-by: Chun Li <chunl2@cisco.com>
Diffstat (limited to 'src/plugins/memif/cli.c')
-rw-r--r--src/plugins/memif/cli.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/memif/cli.c b/src/plugins/memif/cli.c
index 3f0e28179e2..6a149f9fb94 100644
--- a/src/plugins/memif/cli.c
+++ b/src/plugins/memif/cli.c
@@ -354,14 +354,13 @@ format_memif_if_mode (u8 * s, va_list * args)
static u8 *
format_memif_queue (u8 * s, va_list * args)
{
- memif_if_t *mif = va_arg (*args, memif_if_t *);
memif_queue_t *mq = va_arg (*args, memif_queue_t *);
uword i = va_arg (*args, uword);
u32 indent = format_get_indent (s);
s = format (s, "%U%s ring %u:\n",
format_white_space, indent,
- (mif->flags & MEMIF_IF_FLAG_IS_SLAVE) ?
+ (mq->type == MEMIF_RING_S2M) ?
"slave-to-master" : "master-to-slave", i);
s = format (s, "%Uregion %u offset %u ring-size %u int-fd %d\n",
format_white_space, indent + 4,
@@ -514,14 +513,14 @@ memif_show_command_fn (vlib_main_t * vm, unformat_input_t * input,
vec_foreach_index (i, mif->tx_queues)
{
mq = vec_elt_at_index (mif->tx_queues, i);
- vlib_cli_output (vm, " %U", format_memif_queue, mif, mq, i);
+ vlib_cli_output (vm, " %U", format_memif_queue, mq, i);
if (show_descr)
vlib_cli_output (vm, " %U", format_memif_descriptor, mif, mq);
}
vec_foreach_index (i, mif->rx_queues)
{
mq = vec_elt_at_index (mif->rx_queues, i);
- vlib_cli_output (vm, " %U", format_memif_queue, mif, mq, i);
+ vlib_cli_output (vm, " %U", format_memif_queue, mq, i);
if (show_descr)
vlib_cli_output (vm, " %U", format_memif_descriptor, mif, mq);
}