diff options
Diffstat (limited to 'src/plugins/vmxnet3')
-rw-r--r-- | src/plugins/vmxnet3/cli.c | 13 | ||||
-rw-r--r-- | src/plugins/vmxnet3/vmxnet3.c | 3 | ||||
-rw-r--r-- | src/plugins/vmxnet3/vmxnet3.h | 9 |
3 files changed, 18 insertions, 7 deletions
diff --git a/src/plugins/vmxnet3/cli.c b/src/plugins/vmxnet3/cli.c index 039e9f3a75b..f751358262b 100644 --- a/src/plugins/vmxnet3/cli.c +++ b/src/plugins/vmxnet3/cli.c @@ -47,8 +47,10 @@ vmxnet3_create_command_fn (vlib_main_t * vm, unformat_input_t * input, args.enable_gso = 1; else if (unformat (line_input, "elog")) args.enable_elog = 1; + else if (unformat (line_input, "bind force")) + args.bind = VMXNET3_BIND_FORCE; else if (unformat (line_input, "bind")) - args.bind = 1; + args.bind = VMXNET3_BIND_DEFAULT; else if (unformat (line_input, "rx-queue-size %u", &size)) args.rxq_size = size; else if (unformat (line_input, "tx-queue-size %u", &size)) @@ -77,10 +79,11 @@ vmxnet3_create_command_fn (vlib_main_t * vm, unformat_input_t * input, /* *INDENT-OFF* */ VLIB_CLI_COMMAND (vmxnet3_create_command, static) = { .path = "create interface vmxnet3", - .short_help = "create interface vmxnet3 <pci-address>" - " [rx-queue-size <size>] [tx-queue-size <size>]" - " [num-tx-queues <number>] [num-rx-queues <number>] [bind]" - " [gso]", + .short_help = + "create interface vmxnet3 <pci-address>" + " [rx-queue-size <size>] [tx-queue-size <size>]" + " [num-tx-queues <number>] [num-rx-queues <number>] [bind [force]]" + " [gso]", .function = vmxnet3_create_command_fn, }; /* *INDENT-ON* */ diff --git a/src/plugins/vmxnet3/vmxnet3.c b/src/plugins/vmxnet3/vmxnet3.c index 770cb2d418d..be862d7127a 100644 --- a/src/plugins/vmxnet3/vmxnet3.c +++ b/src/plugins/vmxnet3/vmxnet3.c @@ -692,7 +692,8 @@ vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args) if (args->bind) { - error = vlib_pci_bind_to_uio (vm, &args->addr, (char *) "auto"); + error = vlib_pci_bind_to_uio (vm, &args->addr, (char *) "auto", + VMXNET3_BIND_FORCE == args->bind); if (error) { args->rv = VNET_API_ERROR_INVALID_INTERFACE; diff --git a/src/plugins/vmxnet3/vmxnet3.h b/src/plugins/vmxnet3/vmxnet3.h index 81aeec6f5c5..89602f8ee9e 100644 --- a/src/plugins/vmxnet3/vmxnet3.h +++ b/src/plugins/vmxnet3/vmxnet3.h @@ -606,6 +606,13 @@ typedef struct extern vmxnet3_main_t vmxnet3_main; +typedef enum +{ + VMXNET3_BIND_NONE = 0, + VMXNET3_BIND_DEFAULT = 1, + VMXNET3_BIND_FORCE = 2, +} __clib_packed vmxnet3_bind_t; + typedef struct { vlib_pci_addr_t addr; @@ -614,7 +621,7 @@ typedef struct u16 rxq_num; u16 txq_size; u16 txq_num; - u8 bind; + vmxnet3_bind_t bind; u8 enable_gso; /* return */ i32 rv; |