From 067ef751d3144b5de29b20ff9384d78304dfe387 Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Wed, 5 Aug 2020 12:30:42 -0700 Subject: vmxnet3: enhance debug CLI error handling - Display the interface name upon successfully creating the interface. - Don't go silent when error occurs. Be explicit about it. Type: improvement Signed-off-by: Steven Luong Change-Id: Ie4fdaf323f8b3833ad4a7af3872290141204aba8 --- src/plugins/vmxnet3/cli.c | 3 +++ src/plugins/vmxnet3/vmxnet3.c | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/vmxnet3/cli.c b/src/plugins/vmxnet3/cli.c index fd97c36aee2..ad66e768ad3 100644 --- a/src/plugins/vmxnet3/cli.c +++ b/src/plugins/vmxnet3/cli.c @@ -65,6 +65,9 @@ vmxnet3_create_command_fn (vlib_main_t * vm, unformat_input_t * input, vmxnet3_create_if (vm, &args); + if (args.error == 0) + vlib_cli_output (vm, "%U\n", format_vnet_sw_if_index_name, + vnet_get_main (), args.sw_if_index); return args.error; } diff --git a/src/plugins/vmxnet3/vmxnet3.c b/src/plugins/vmxnet3/vmxnet3.c index 43e5b58cc4c..731a34a99e1 100644 --- a/src/plugins/vmxnet3/vmxnet3.c +++ b/src/plugins/vmxnet3/vmxnet3.c @@ -452,9 +452,18 @@ vmxnet3_device_init (vlib_main_t * vm, vmxnet3_device_t * vd, } /* GSO is only supported for version >= 3 */ - if (args->enable_gso && (vd->version >= 3)) + if (args->enable_gso) { - vd->gso_enable = 1; + if (vd->version >= 3) + vd->gso_enable = 1; + else + { + error = + clib_error_return (0, + "GSO is not supported because hardware version" + " is %u. It must be >= 3", vd->version); + return error; + } } vmxnet3_reg_write (vd, 1, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK); @@ -741,6 +750,10 @@ vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args) vmxnet3_log_error (vd, "No sufficient interrupt lines (%u) for rx queues", num_intr); + error = + clib_error_return (0, + "No sufficient interrupt lines (%u) for rx queues", + num_intr); goto error; } if ((error = vlib_pci_register_msix_handler (vm, h, 0, vd->num_rx_queues, -- cgit 1.2.3-korg