X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ffeature%2Ffeature.c;h=0f0bfeb11d27296b718eb1fddd49253cfe09488a;hb=30928f87a3c9d98e288d1364d50c032e052e69ab;hp=24960d933ae02c72df32cd79475b44caac02cc33;hpb=c8972fe506c78530a3e4085453e86a0b85b245ef;p=vpp.git diff --git a/src/vnet/feature/feature.c b/src/vnet/feature/feature.c index 24960d933ae..0f0bfeb11d2 100644 --- a/src/vnet/feature/feature.c +++ b/src/vnet/feature/feature.c @@ -396,7 +396,7 @@ show_features_command_fn (vlib_main_t * vm, /* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_features_command, static) = { .path = "show features", - .short_help = "show features", + .short_help = "show features [verbose]", .function = show_features_command_fn, }; /* *INDENT-ON* */ @@ -490,21 +490,22 @@ set_interface_features_command_fn (vlib_main_t * vm, while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat - (line_input, "%U %v", unformat_vnet_sw_interface, vnm, &sw_if_index, - &feature_name)) - ; - else if (unformat (line_input, "arc %v", &arc_name)) + (line_input, "%U %s arc %s", unformat_vnet_sw_interface, vnm, + &sw_if_index, &feature_name, &arc_name)) ; else if (unformat (line_input, "disable")) enable = 0; else { - if (feature_name && arc_name) - break; error = unformat_parse_error (line_input); goto done; } } + if (!feature_name || !arc_name) + { + error = clib_error_return (0, "Both feature name and arc required..."); + goto done; + } if (sw_if_index == ~0) { @@ -515,13 +516,28 @@ set_interface_features_command_fn (vlib_main_t * vm, vec_add1 (arc_name, 0); vec_add1 (feature_name, 0); + u8 arc_index; + + arc_index = vnet_get_feature_arc_index ((const char *) arc_name); + + if (arc_index == (u8) ~ 0) + { + error = + clib_error_return (0, "Unknown arc name (%s)... ", + (const char *) arc_name); + goto done; + } + vnet_feature_registration_t *reg; reg = vnet_get_feature_reg ((const char *) arc_name, (const char *) feature_name); if (reg == 0) { - error = clib_error_return (0, "Unknown feature..."); + error = + clib_error_return (0, + "Feature (%s) not registered to arc (%s)... See 'show features verbose' for valid feature/arc combinations. ", + feature_name, arc_name); goto done; } if (reg->enable_disable_cb)