mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user