aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2020-08-05 12:30:42 -0700
committerDave Barach <openvpp@barachs.net>2020-08-24 10:43:52 +0000
commit067ef751d3144b5de29b20ff9384d78304dfe387 (patch)
tree7f0f6fe25d255d4fca03dde835013eb8379328b3 /src
parent34a72c61ea2952de450634f1cf9a629911d9bde7 (diff)
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 <sluong@cisco.com> Change-Id: Ie4fdaf323f8b3833ad4a7af3872290141204aba8
Diffstat (limited to 'src')
-rw-r--r--src/plugins/vmxnet3/cli.c3
-rw-r--r--src/plugins/vmxnet3/vmxnet3.c17
2 files changed, 18 insertions, 2 deletions
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,