dm: virtio: rename virtio ring structures and feature bits

Some virtio ring structures and virtio feature bits are using the
same name/definition as those in kernel header files(linux/
virtio_ring.h, linux/virtio_config.h). Kernel header files must
be included to perform ioctls to support vhost. There are
compiling errors due to duplicated definitions. In this patch
the following renamings are done:

VRING_DESC_F_NEXT -> ACRN_VRING_DESC_F_NEXT
VRING_DESC_F_WRITE -> ACRN_VRING_DESC_F_WRITE
VRING_DESC_F_INDIRECT -> ACRN_VRING_DESC_F_INDIRECT

VRING_AVAIL_F_NO_INTERRUPT -> ACRN_VRING_AVAIL_F_NO_INTERRUPT
VRING_USED_F_NO_NOTIFY -> ACRN_VRING_USED_F_NO_NOTIFY

VIRTIO_F_NOTIFY_ON_EMPTY -> ACRN_VIRTIO_F_NOTIFY_ON_EMPTY
VIRTIO_RING_F_INDIRECT_DESC -> ACRN_VIRTIO_RING_F_INDIRECT_DESC
VIRTIO_RING_F_EVENT_IDX -> ACRN_VIRTIO_RING_F_EVENT_IDX
VIRTIO_F_VERSION_1 -> ACRN_VIRTIO_F_VERSION_1

vring_avail -> virtio_vring_avail
vring_used -> virtio_vring_used
vring_size -> virtio_vring_size

Tracked-On: #1329
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Jian Jun Chen
2018-08-10 14:46:39 +08:00
committed by lijinxia
parent dd6a5fbe95
commit 781e7dfb29
7 changed files with 50 additions and 50 deletions

View File

@@ -972,7 +972,7 @@ static void *virtio_heci_tx_thread(void *param)
while (vheci->status != VHECI_DEINIT) {
/* note - tx mutex is locked here */
while (!vq_has_descs(vq)) {
vq->used->flags &= ~VRING_USED_F_NO_NOTIFY;
vq->used->flags &= ~ACRN_VRING_USED_F_NO_NOTIFY;
mb();
if (vq_has_descs(vq) &&
vheci->status != VHECI_RESET)
@@ -984,7 +984,7 @@ static void *virtio_heci_tx_thread(void *param)
if (vheci->status == VHECI_DEINIT)
goto out;
}
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
vq->used->flags |= ACRN_VRING_USED_F_NO_NOTIFY;
pthread_mutex_unlock(&vheci->tx_mutex);
do {
@@ -1125,7 +1125,7 @@ static void *virtio_heci_rx_thread(void *param)
while (vheci->status != VHECI_DEINIT) {
/* note - rx mutex is locked here */
while (vq_ring_ready(vq)) {
vq->used->flags &= ~VRING_USED_F_NO_NOTIFY;
vq->used->flags &= ~ACRN_VRING_USED_F_NO_NOTIFY;
mb();
if (vq_has_descs(vq) &&
vheci->rx_need_sched &&
@@ -1138,7 +1138,7 @@ static void *virtio_heci_rx_thread(void *param)
if (vheci->status == VHECI_DEINIT)
goto out;
}
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
vq->used->flags |= ACRN_VRING_USED_F_NO_NOTIFY;
do {
if (virtio_heci_proc_rx(vheci, vq))
@@ -1166,7 +1166,7 @@ virtio_heci_notify_rx(void *heci, struct virtio_vq_info *vq)
/* Signal the rx thread for processing */
pthread_mutex_lock(&vheci->rx_mutex);
DPRINTF(("vheci: RX: New IN buffer available!\n\r"));
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
vq->used->flags |= ACRN_VRING_USED_F_NO_NOTIFY;
pthread_cond_signal(&vheci->rx_cond);
pthread_mutex_unlock(&vheci->rx_mutex);
}
@@ -1184,7 +1184,7 @@ virtio_heci_notify_tx(void *heci, struct virtio_vq_info *vq)
/* Signal the tx thread for processing */
pthread_mutex_lock(&vheci->tx_mutex);
DPRINTF(("vheci: TX: New OUT buffer available!\n\r"));
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
vq->used->flags |= ACRN_VRING_USED_F_NO_NOTIFY;
pthread_cond_signal(&vheci->tx_cond);
pthread_mutex_unlock(&vheci->tx_mutex);
}