summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-11-09 08:19:27 -0800
committerOle Trøan <otroan@employees.org>2018-11-13 14:45:26 +0000
commit5d9df1db07969fea8f391bd48ba14cceb840da1e (patch)
tree5b78ed089e3a84ab1cc66ef968120f46348c69c8
parenta3d5986a35743a3ca1020155bed8267b5246d155 (diff)
L2 feautre bitmaps output verbose/non-verbose mode
Change-Id: I15ff191ee8724a3354c074db590472db05e0652e Signed-off-by: Neale Ranns <nranns@cisco.com>
-rw-r--r--src/plugins/gbp/gbp_itf.c4
-rw-r--r--src/vnet/interface_cli.c5
-rw-r--r--src/vnet/l2/l2_input.c13
-rw-r--r--src/vnet/l2/l2_input.h2
-rw-r--r--src/vnet/l2/l2_output.c15
-rw-r--r--src/vnet/l2/l2_output.h2
6 files changed, 31 insertions, 10 deletions
diff --git a/src/plugins/gbp/gbp_itf.c b/src/plugins/gbp/gbp_itf.c
index 39a1124bba2..e1afdfb94dc 100644
--- a/src/plugins/gbp/gbp_itf.c
+++ b/src/plugins/gbp/gbp_itf.c
@@ -196,8 +196,8 @@ format_gbp_itf (u8 * s, va_list * args)
s = format (s, "%U locks:%d input-feats:%U output-feats:%U",
format_vnet_sw_if_index_name, vnet_get_main (),
- gi->gi_sw_if_index, gi->gi_locks, format_l2_input_features,
- gi->gi_l2_input_fb, format_l2_output_features,
+ gi->gi_sw_if_index, gi->gi_locks, format_l2_input_features, 0,
+ gi->gi_l2_input_fb, format_l2_output_features, 0,
gi->gi_l2_output_fb);
return (s);
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index b11d35e9efa..b15d283fe49 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -326,14 +326,15 @@ show_sw_interfaces (vlib_main_t * vm,
/* intf input features are masked by bridge domain */
if (l2_input->bridge)
fb &= l2input_bd_config (l2_input->bd_index)->feature_bitmap;
- vlib_cli_output (vm, "\nl2-input:\n%U", format_l2_input_features, fb);
+ vlib_cli_output (vm, "\nl2-input:\n%U", format_l2_input_features, fb,
+ 1);
l2_output_config_t *l2_output = l2output_intf_config (sw_if_index);
vlib_cli_output (vm, "\nl2-output:");
if (l2_output->out_vtr_flag)
vlib_cli_output (vm, "%10s (%s)", "VTR", "--internal--");
vlib_cli_output (vm, "%U", format_l2_output_features,
- l2_output->feature_bitmap);
+ l2_output->feature_bitmap, 1);
return 0;
}
if (show_tag)
diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c
index 85daba5a8ea..28b8697a7e4 100644
--- a/src/vnet/l2/l2_input.c
+++ b/src/vnet/l2/l2_input.c
@@ -71,6 +71,7 @@ format_l2_input_features (u8 * s, va_list * args)
#undef _
};
u32 feature_bitmap = va_arg (*args, u32);
+ u32 verbose = va_arg (*args, u32);
if (feature_bitmap == 0)
{
@@ -81,8 +82,16 @@ format_l2_input_features (u8 * s, va_list * args)
feature_bitmap &= ~L2INPUT_FEAT_DROP; /* Not a feature */
int i;
for (i = L2INPUT_N_FEAT; i >= 0; i--)
- if (feature_bitmap & (1 << i))
- s = format (s, "%17s (%s)\n", display_names[i], l2input_feat_names[i]);
+ {
+ if (feature_bitmap & (1 << i))
+ {
+ if (verbose)
+ s = format (s, "%17s (%s)\n",
+ display_names[i], l2input_feat_names[i]);
+ else
+ s = format (s, "%s ", l2input_feat_names[i]);
+ }
+ }
return s;
}
diff --git a/src/vnet/l2/l2_input.h b/src/vnet/l2/l2_input.h
index 57fca57fc29..4a5cf6c8748 100644
--- a/src/vnet/l2/l2_input.h
+++ b/src/vnet/l2/l2_input.h
@@ -152,7 +152,7 @@ STATIC_ASSERT ((u64) L2INPUT_VALID_MASK == (1ull << L2INPUT_N_FEAT) - 1, "");
/** Return an array of strings containing graph node names of each feature */
char **l2input_get_feat_names (void);
-/* arg0 - u32 feature_bitmap */
+/* arg0 - u32 feature_bitmap, arg1 - u32 verbose */
u8 *format_l2_input_features (u8 * s, va_list * args);
static_always_inline u8
diff --git a/src/vnet/l2/l2_output.c b/src/vnet/l2/l2_output.c
index 31e3f067749..27b838f4378 100644
--- a/src/vnet/l2/l2_output.c
+++ b/src/vnet/l2/l2_output.c
@@ -50,6 +50,7 @@ format_l2_output_features (u8 * s, va_list * args)
#undef _
};
u32 feature_bitmap = va_arg (*args, u32);
+ u32 verbose = va_arg (*args, u32);
if (feature_bitmap == 0)
{
@@ -59,8 +60,18 @@ format_l2_output_features (u8 * s, va_list * args)
int i;
for (i = L2OUTPUT_N_FEAT - 1; i >= 0; i--)
- if (feature_bitmap & (1 << i))
- s = format (s, "%17s (%s)\n", display_names[i], l2output_feat_names[i]);
+ {
+ if (feature_bitmap & (1 << i))
+ {
+ if (verbose)
+ s =
+ format (s, "%17s (%s)\n", display_names[i],
+ l2output_feat_names[i]);
+ else
+ s = format (s, "%s ", l2output_feat_names[i]);
+ }
+ }
+
return s;
}
diff --git a/src/vnet/l2/l2_output.h b/src/vnet/l2/l2_output.h
index 33eeb8e6e9b..74d2829839f 100644
--- a/src/vnet/l2/l2_output.h
+++ b/src/vnet/l2/l2_output.h
@@ -141,7 +141,7 @@ typedef enum
/* Return an array of strings containing graph node names of each feature */
char **l2output_get_feat_names (void);
-/* arg0 - u32 feature_bitmap */
+/* arg0 - u32 feature_bitmap, arg1 - u32 verbose */
u8 *format_l2_output_features (u8 * s, va_list * args);
/**