virtio: Add gso support for native virtio driver
[vpp.git] / src / vnet / devices / virtio / pci.h
index b08e40e..b1e2916 100644 (file)
@@ -37,6 +37,7 @@
                                           (16, RW) */
 
 /*
+ * Vector value used to disable MSI for queue.
  * define in include/linux/virtio_pci.h
  * #define VIRTIO_MSI_NO_VECTOR 0xFFFF
  */
@@ -45,7 +46,6 @@
 #define VIRTIO_PCI_ISR_INTR   0x1
 /* The bit of the ISR which indicates a device configuration change. */
 #define VIRTIO_PCI_ISR_CONFIG 0x2
-/* Vector value used to disable MSI for queue. */
 
 /* VirtIO device IDs. */
 #define VIRTIO_ID_NETWORK  0x01
@@ -101,10 +101,22 @@ typedef enum
  * at the end of the used ring. Guest should ignore the used->flags field. */ \
   _ (VHOST_USER_F_PROTOCOL_FEATURES, 30)
 
+#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2
 #define VIRTIO_NET_F_MTU 3
 #define VIRTIO_NET_S_LINK_UP    1      /* Link is up */
 #define VIRTIO_NET_S_ANNOUNCE   2      /* Announcement is needed */
 
+/*
+ * Control network offloads
+ * Reconfigures the network offloads that Guest can handle.
+ * Available with the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit.
+ * Command data format matches the feature bit mask exactly.
+ * See VIRTIO_NET_F_GUEST_* for the list of offloads
+ * that can be enabled/disabled.
+ */
+#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
+#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0
+
 /* Common configuration */
 #define VIRTIO_PCI_CAP_COMMON_CFG       1
 /* Notifications */
@@ -227,14 +239,13 @@ typedef struct
 typedef struct
 {
   u32 addr;
-  u16 rxq_size;
-  u16 txq_size;
   /* return */
   i32 rv;
   u32 sw_if_index;
   u8 mac_addr_set;
   u8 mac_addr[6];
   u64 features;
+  u8 gso_enabled;
   clib_error_t *error;
 } virtio_pci_create_if_args_t;