X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fvirtio%2Fvirtio_ring.h;h=17a56b0a7341e3916649e953d9e45d24dfc916c7;hb=daa02b5cddbb8e11b31d41e2bf7bb1ae64dcae2f;hp=6abec4d871c7a2c38546946683420df82e932f02;hpb=4cdc4d98313e717df7d1dba769d71e7e4050da54;p=dpdk.git diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h index 6abec4d871..17a56b0a73 100644 --- a/drivers/net/virtio/virtio_ring.h +++ b/drivers/net/virtio/virtio_ring.h @@ -15,10 +15,15 @@ #define VRING_DESC_F_WRITE 2 /* This means the buffer contains a list of buffer descriptors. */ #define VRING_DESC_F_INDIRECT 4 + /* This flag means the descriptor was made available by the driver */ -#define VRING_DESC_F_AVAIL(b) ((uint16_t)(b) << 7) +#define VRING_PACKED_DESC_F_AVAIL (1 << 7) /* This flag means the descriptor was used by the device */ -#define VRING_DESC_F_USED(b) ((uint16_t)(b) << 15) +#define VRING_PACKED_DESC_F_USED (1 << 15) + +/* Frequently used combinations */ +#define VRING_PACKED_DESC_F_AVAIL_USED (VRING_PACKED_DESC_F_AVAIL | \ + VRING_PACKED_DESC_F_USED) /* The Host uses this in used->flags to advise the Guest: don't kick me * when you add a buffer. It's unreliable, so it's simply an @@ -54,7 +59,7 @@ struct vring_used_elem { struct vring_used { uint16_t flags; - volatile uint16_t idx; + uint16_t idx; struct vring_used_elem ring[0]; }; @@ -128,7 +133,7 @@ vring_size(struct virtio_hw *hw, unsigned int num, unsigned long align) { size_t size; - if (vtpci_packed_queue(hw)) { + if (virtio_with_packed_queue(hw)) { size = num * sizeof(struct vring_packed_desc); size += sizeof(struct vring_packed_desc_event); size = RTE_ALIGN_CEIL(size, align);