X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Finterface_cli.c;h=a2dfc2bb3ed409925b5a93b4f51e28bce3964832;hb=8e0af7a7ffb0d6208c91e74eeaa0e46f3ac29026;hp=d2e748abec258782221e86791dd70cc02783caeb;hpb=0d05c0d214ffd326e531bea58f3c971bb9a58252;p=vpp.git diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c index d2e748abec2..a2dfc2bb3ed 100644 --- a/src/vnet/interface_cli.c +++ b/src/vnet/interface_cli.c @@ -1158,6 +1158,7 @@ mtu_cmd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) u32 hw_if_index, sw_if_index, mtu; ethernet_main_t *em = ðernet_main; u32 mtus[VNET_N_MTU] = { 0, 0, 0, 0 }; + clib_error_t *err; if (unformat (input, "%d %U", &mtu, unformat_vnet_hw_interface, vnm, &hw_if_index)) @@ -1166,22 +1167,14 @@ mtu_cmd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) * Change physical MTU on interface. Only supported for Ethernet * interfaces */ - vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, hw_if_index); ethernet_interface_t *eif = ethernet_get_interface (em, hw_if_index); if (!eif) return clib_error_return (0, "not supported"); - if (mtu < hi->min_supported_packet_bytes) - return clib_error_return (0, "Invalid mtu (%d): " - "must be >= min pkt bytes (%d)", mtu, - hi->min_supported_packet_bytes); - - if (mtu > hi->max_supported_packet_bytes) - return clib_error_return (0, "Invalid mtu (%d): must be <= (%d)", mtu, - hi->max_supported_packet_bytes); - - vnet_hw_interface_set_mtu (vnm, hw_if_index, mtu); + err = vnet_hw_interface_set_mtu (vnm, hw_if_index, mtu); + if (err) + return err; goto done; } else if (unformat (input, "packet %d %U", &mtu, @@ -2522,6 +2515,12 @@ set_interface_tx_hash_cmd (vlib_main_t *vm, unformat_input_t *input, goto error; } + if (hash_name == 0) + { + error = clib_error_return (0, "hash-name is required"); + goto error; + } + hi = vnet_get_hw_interface (vnm, hw_if_index); ftype = vnet_get_hw_interface_class (vnm, hi->hw_class_index)->tx_hash_fn_type;