X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Fvirtio%2Fvirtio.h;h=4b8662699da093fedd7c96b436ac4c7ae4eeade2;hb=6d4af8918;hp=070d0a45262f4f7174d0eb0f2efb738f4704302e;hpb=a069762e8e67f2acb6de612ece01666b1c350473;p=vpp.git diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h index 070d0a45262..4b8662699da 100644 --- a/src/vnet/devices/virtio/virtio.h +++ b/src/vnet/devices/virtio/virtio.h @@ -49,7 +49,7 @@ _ (VIRTIO_NET_F_CTRL_MAC_ADDR, 23) /* Set MAC address */ \ _ (VIRTIO_F_NOTIFY_ON_EMPTY, 24) \ _ (VHOST_F_LOG_ALL, 26) /* Log all write descriptors */ \ - _ (VIRTIO_F_ANY_LAYOUT, 27) /* Can the device handle any descripor layout */ \ + _ (VIRTIO_F_ANY_LAYOUT, 27) /* Can the device handle any descriptor layout */ \ _ (VIRTIO_RING_F_INDIRECT_DESC, 28) /* Support indirect buffer descriptors */ \ _ (VIRTIO_RING_F_EVENT_IDX, 29) /* The Guest publishes the used index for which it expects an interrupt \ * at the end of the avail ring. Host should ignore the avail->flags field. */ \ @@ -82,7 +82,7 @@ typedef enum typedef enum { - VIRTIO_IF_TYPE_TAP, + VIRTIO_IF_TYPE_TAP = 1, VIRTIO_IF_TYPE_PCI, VIRTIO_IF_N_TYPES, } virtio_if_type_t; @@ -148,16 +148,10 @@ typedef struct pci_addr_t pci_addr; }; u32 per_interface_next_index; - union - { - int fd; - u32 msix_enabled; - }; - union - { - int tap_fd; - u32 pci_dev_handle; - }; + int *vhost_fds; + int tap_fd; + u32 msix_enabled; + u32 pci_dev_handle; virtio_vring_t *rxq_vrings; virtio_vring_t *txq_vrings; u64 features, remote_features; @@ -180,6 +174,7 @@ typedef struct u8 host_ip6_prefix_len; u32 host_mtu_size; int gso_enabled; + int csum_offload_enabled; int ifindex; virtio_vring_t *cxq_vring; } virtio_if_t; @@ -212,6 +207,7 @@ extern void virtio_show (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr, extern void virtio_pci_legacy_notify_queue (vlib_main_t * vm, virtio_if_t * vif, u16 queue_id); format_function_t format_virtio_device_name; +format_function_t format_virtio_log_name; static_always_inline void virtio_kick (vlib_main_t * vm, virtio_vring_t * vring, virtio_if_t * vif) @@ -228,6 +224,28 @@ virtio_kick (vlib_main_t * vm, virtio_vring_t * vring, virtio_if_t * vif) } } + +#define virtio_log_debug(vif, f, ...) \ +{ \ + vlib_log(VLIB_LOG_LEVEL_DEBUG, virtio_main.log_default, \ + "%U: " f, format_virtio_log_name, vif, \ + ##__VA_ARGS__); \ +}; + +#define virtio_log_warning(vif, f, ...) \ +{ \ + vlib_log(VLIB_LOG_LEVEL_WARNING, virtio_main.log_default, \ + "%U: " f, format_virtio_log_name, vif, \ + ##__VA_ARGS__); \ +}; + +#define virtio_log_error(vif, f, ...) \ +{ \ + vlib_log(VLIB_LOG_LEVEL_ERR, virtio_main.log_default, \ + "%U: " f, format_virtio_log_name, vif, \ + ##__VA_ARGS__); \ +}; + #endif /* _VNET_DEVICES_VIRTIO_VIRTIO_H_ */ /*