|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
32 u64 feature_mask = (
u64) ~ (0ULL);
33 u32 buffering_size = 0;
39 memset (&args, 0,
sizeof (args));
44 else if (
unformat (line_input,
"feature-mask 0x%llx", &feature_mask))
46 else if (
unformat (line_input,
"gso-enabled"))
48 else if (
unformat (line_input,
"csum-enabled"))
50 else if (
unformat (line_input,
"buffering"))
53 if (
unformat (line_input,
"size %u", &buffering_size))
56 else if (
unformat (line_input,
"packed"))
71 .path =
"create interface virtio",
72 .short_help =
"create interface virtio <pci-address> "
73 "[feature-mask <hex-mask>] [gso-enabled] [csum-enabled] "
74 "[buffering [size <buffering-szie>]] [packed]",
109 "please specify interface name or sw_if_index");
125 .path =
"delete interface virtio",
126 .short_help =
"delete interface virtio "
127 "{<interface> | sw_if_index <sw_idx>}",
142 int gso_enabled = 0, checksum_offload_enabled = 0;
143 int offloads_disabled = 0;
156 else if (
unformat (line_input,
"gso-enabled"))
158 else if (
unformat (line_input,
"csum-offload-enabled"))
159 checksum_offload_enabled = 1;
160 else if (
unformat (line_input,
"offloads-disabled"))
161 offloads_disabled = 1;
170 "please specify interface name or sw_if_index");
179 (
vm, vif, gso_enabled, checksum_offload_enabled, offloads_disabled) < 0)
187 .path =
"set virtio pci",
188 .short_help =
"set virtio pci {<interface> | sw_if_index <sw_idx>}"
189 " [gso-enabled | csum-offload-enabled | offloads-disabled]",
202 u32 hw_if_index, *hw_if_indices = 0;
204 u8 show_descr = 0, show_device_config = 0;
218 vec_add1 (hw_if_indices, hw_if_index);
222 else if (
unformat (input,
"debug-device"))
223 show_device_config = 1;
232 if (
vec_len (hw_if_indices) == 0)
237 else if (show_device_config)
240 if (vif->
type == VIRTIO_IF_TYPE_PCI)
244 virtio_show (
vm, hw_if_indices, show_descr, VIRTIO_IF_TYPE_PCI);
253 .path =
"show virtio pci",
254 .short_help =
"show virtio pci [<interface>] [descriptors | desc] [debug-device]",
vnet_device_class_t virtio_device_class
void virtio_pci_create_if(vlib_main_t *vm, virtio_pci_create_if_args_t *args)
static clib_error_t * virtio_pci_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define clib_error_return(e, args...)
unformat_function_t unformat_vlib_pci_addr
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * virtio_pci_enable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
const virtio_pci_func_t * virtio_pci_func
virtio_main_t virtio_main
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
int virtio_pci_delete_if(vlib_main_t *vm, virtio_if_t *vif)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
static vlib_cli_command_t virtio_pci_delete_command
(constructor) VLIB_CLI_COMMAND (virtio_pci_delete_command)
static vlib_cli_command_t virtio_pci_enable_command
(constructor) VLIB_CLI_COMMAND (virtio_pci_enable_command)
u8 checksum_offload_enabled
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * virtio_pci_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_hw_interface
static vlib_cli_command_t show_virtio_pci_command
(constructor) VLIB_CLI_COMMAND (show_virtio_pci_command)
static vlib_cli_command_t virtio_pci_create_command
(constructor) VLIB_CLI_COMMAND (virtio_pci_create_command)
#define vec_free(V)
Free vector's memory (no header).
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_show(vlib_main_t *vm, u32 *hw_if_indices, u8 show_descr, u32 type)
#define VLIB_INIT_FUNCTION(x)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
int virtio_pci_enable_disable_offloads(vlib_main_t *vm, virtio_if_t *vif, int gso_enabled, int checksum_offload_enabled, int offloads_disabled)
clib_error_t * virtio_pci_cli_init(vlib_main_t *vm)
vl_api_interface_index_t sw_if_index