33 u64 feature_mask = (
u64) ~ (0ULL);
39 memset (&args, 0,
sizeof (args));
44 else if (
unformat (line_input,
"feature-mask 0x%llx", &feature_mask))
46 else if (
unformat (line_input,
"rx-queue-size %u", &tmp))
48 else if (
unformat (line_input,
"tx-queue-size %u", &tmp))
63 .path =
"create interface virtio",
64 .short_help =
"create interface virtio <pci-address> " 65 "[feature-mask <hex-mask>] [rx-queue-size <size>] [tx-queue-size <size>]",
87 if (
unformat (line_input,
"sw_if_index %d", &sw_if_index))
98 if (sw_if_index == ~0)
100 "please specify interface name or sw_if_index");
116 .path =
"delete interface virtio",
117 .short_help =
"delete interface virtio " 118 "{<interface> | sw_if_index <sw_idx>}",
131 u32 hw_if_index, *hw_if_indices = 0;
133 u8 show_descr = 0, show_device_config = 0;
147 vec_add1 (hw_if_indices, hw_if_index);
151 else if (
unformat (input,
"debug-device"))
152 show_device_config = 1;
161 if (
vec_len (hw_if_indices) == 0)
167 else if (show_device_config)
183 .path =
"show virtio pci",
184 .short_help =
"show virtio pci [<interface>] [descriptors | desc] [debug-device]",
unformat_function_t unformat_vnet_hw_interface
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
void virtio_show(vlib_main_t *vm, u32 *hw_if_indices, u8 show_descr, u32 type)
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_device_class_t virtio_device_class
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static clib_error_t * show_virtio_pci_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_sw_interface
void virtio_pci_create_if(vlib_main_t *vm, virtio_pci_create_if_args_t *args)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
unformat_function_t unformat_vlib_pci_addr
static clib_error_t * virtio_pci_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_free(V)
Free vector's memory (no header).
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
void debug_device_config_space(vlib_main_t *vm, virtio_if_t *vif)
vlib_log_class_t log_default
#define VLIB_CLI_COMMAND(x,...)
int virtio_pci_delete_if(vlib_main_t *vm, virtio_if_t *vif)
static clib_error_t * virtio_pci_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
virtio_main_t virtio_main
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * virtio_pci_cli_init(vlib_main_t *vm)