net/bnxt: support thor controller
[dpdk.git] / drivers / net / virtio / virtqueue.h
index 78df6d3..c6dd4a3 100644 (file)
@@ -134,7 +134,7 @@ enum { VTNET_RQ = 0, VTNET_TQ = 1, VTNET_CQ = 2 };
  */
 struct virtio_net_ctrl_mac {
        uint32_t entries;
-       uint8_t macs[][ETHER_ADDR_LEN];
+       uint8_t macs[][RTE_ETHER_ADDR_LEN];
 } __attribute__((__packed__));
 
 #define VIRTIO_NET_CTRL_MAC    1
@@ -277,12 +277,8 @@ struct virtio_net_hdr_mrg_rxbuf {
 #define VIRTIO_MAX_TX_INDIRECT 8
 struct virtio_tx_region {
        struct virtio_net_hdr_mrg_rxbuf tx_hdr;
-       union {
-               struct vring_desc tx_indir[VIRTIO_MAX_TX_INDIRECT]
-                       __attribute__((__aligned__(16)));
-               struct vring_packed_desc tx_indir_pq[VIRTIO_MAX_TX_INDIRECT]
-                       __attribute__((__aligned__(16)));
-       };
+       struct vring_desc tx_indir[VIRTIO_MAX_TX_INDIRECT]
+               __attribute__((__aligned__(16)));
 };
 
 static inline int
@@ -291,8 +287,8 @@ desc_is_used(struct vring_packed_desc *desc, struct virtqueue *vq)
        uint16_t used, avail, flags;
 
        flags = desc->flags;
-       used = !!(flags & VRING_DESC_F_USED(1));
-       avail = !!(flags & VRING_DESC_F_AVAIL(1));
+       used = !!(flags & VRING_PACKED_DESC_F_USED);
+       avail = !!(flags & VRING_PACKED_DESC_F_AVAIL);
 
        return avail == used && used == vq->vq_packed.used_wrap_counter;
 }
@@ -321,7 +317,7 @@ vring_desc_init_split(struct vring_desc *dp, uint16_t n)
 }
 
 /**
- * Tell the backend not to interrupt us.
+ * Tell the backend not to interrupt us. Implementation for packed virtqueues.
  */
 static inline void
 virtqueue_disable_intr_packed(struct virtqueue *vq)
@@ -333,6 +329,15 @@ virtqueue_disable_intr_packed(struct virtqueue *vq)
        }
 }
 
+/**
+ * Tell the backend not to interrupt us. Implementation for split virtqueues.
+ */
+static inline void
+virtqueue_disable_intr_split(struct virtqueue *vq)
+{
+       vq->vq_split.ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
+}
+
 /**
  * Tell the backend not to interrupt us.
  */
@@ -342,7 +347,7 @@ virtqueue_disable_intr(struct virtqueue *vq)
        if (vtpci_packed_queue(vq->hw))
                virtqueue_disable_intr_packed(vq);
        else
-               vq->vq_split.ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
+               virtqueue_disable_intr_split(vq);
 }
 
 /**