summaryrefslogtreecommitdiff
path: root/drivers/net/virtio/virtqueue.h
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2019-03-25 13:27:16 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-29 17:25:32 +0100
commit12e9e70c89cd3fc9baa9b82ac21bce5ccb6c4d25 (patch)
tree5145a2f7329eebfe9b0cd7e8ccbe296585c2c2bf /drivers/net/virtio/virtqueue.h
parent1c8489da561be16ac73c6dab01db816af249713f (diff)
downloaddpdk-next-eventdev-12e9e70c89cd3fc9baa9b82ac21bce5ccb6c4d25.zip
dpdk-next-eventdev-12e9e70c89cd3fc9baa9b82ac21bce5ccb6c4d25.tar.gz
dpdk-next-eventdev-12e9e70c89cd3fc9baa9b82ac21bce5ccb6c4d25.tar.xz
net/virtio: define avail and used flags as constants
We are consistently passing 1 as the argument in the data path, so there is no need to define avail/used flags as function-like macros anymore. This patch changes the avail and used flags to constants. And a frequently used combination is also introduced. Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Jens Freimann <jfreimann@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Diffstat (limited to 'drivers/net/virtio/virtqueue.h')
-rw-r--r--drivers/net/virtio/virtqueue.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 5cea7cb..e9dedc5 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -287,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;
}