net/virtio: simplify queue allocation
[dpdk.git] / drivers / net / virtio / virtqueue.h
index c452d04..bbeb2f2 100644 (file)
@@ -44,6 +44,7 @@
 #include "virtio_pci.h"
 #include "virtio_ring.h"
 #include "virtio_logs.h"
+#include "virtio_rxtx.h"
 
 struct rte_mbuf;
 
@@ -191,8 +192,14 @@ struct virtqueue {
        void *vq_ring_virt_mem;  /**< linear address of vring*/
        unsigned int vq_ring_size;
 
+       union {
+               struct virtnet_rx rxq;
+               struct virtnet_tx txq;
+               struct virtnet_ctl cq;
+       };
+
        phys_addr_t vq_ring_mem; /**< physical address of vring,
-                                 * or virtual address for virtio-user. */
+                                 * or virtual address for virtio_user. */
 
        /**
         * Head of the free chain in the descriptor table. If
@@ -223,6 +230,7 @@ struct virtqueue {
  */
 struct virtio_net_hdr {
 #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1    /**< Use csum_start,csum_offset*/
+#define VIRTIO_NET_HDR_F_DATA_VALID 2    /**< Checksum is valid */
        uint8_t flags;
 #define VIRTIO_NET_HDR_GSO_NONE     0    /**< Not a GSO frame */
 #define VIRTIO_NET_HDR_GSO_TCPV4    1    /**< GSO frame, IPv4 TCP (TSO) */