From b5967c1fe58911ab4f353094c37b0823984570a0 Mon Sep 17 00:00:00 2001 From: Huawei Xie Date: Thu, 23 Oct 2014 11:24:26 +0200 Subject: [PATCH] examples/vhost: disable guest notifications Signed-off-by: Huawei Xie Acked-by: Changchun Ouyang --- examples/vhost/main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index b2aa7031e1..8517fd3924 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -2271,16 +2271,6 @@ init_data_ll (void) return 0; } -/* - * Set virtqueue flags so that we do not receive interrupts. - */ -static void -set_irq_status (struct virtio_net *dev) -{ - dev->virtqueue[VIRTIO_RXQ]->used->flags = VRING_USED_F_NO_NOTIFY; - dev->virtqueue[VIRTIO_TXQ]->used->flags = VRING_USED_F_NO_NOTIFY; -} - /* * Remove a device from the specific data core linked list and from the main linked list. Synchonization * occurs through the use of the lcore dev_removal_flag. Device is made volatile here to avoid re-ordering @@ -2732,7 +2722,8 @@ new_device (struct virtio_net *dev) memset(&dev_statistics[dev->device_fh], 0, sizeof(struct device_statistics)); /* Disable notifications. */ - set_irq_status(dev); + rte_vhost_enable_guest_notification(dev, VIRTIO_RXQ, 0); + rte_vhost_enable_guest_notification(dev, VIRTIO_TXQ, 0); lcore_info[vdev->coreid].lcore_ll->device_num++; dev->flags |= VIRTIO_DEV_RUNNING;