net/virtio: add check for cvq
authorZhiyong Yang <zhiyong.yang@intel.com>
Wed, 21 Mar 2018 03:03:41 +0000 (11:03 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:44 +0000 (14:08 +0200)
Add checking for cvq to judge if virtio_ack_link_announce should be called.
The existing code doesn't cause issue, and add the checking just to look
more reasonable.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c

index 4a1971c..2ef213d 100644 (file)
@@ -1296,7 +1296,8 @@ virtio_interrupt_handler(void *param)
 
        if (isr & VIRTIO_NET_S_ANNOUNCE) {
                virtio_notify_peers(dev);
-               virtio_ack_link_announce(dev);
+               if (hw->cvq)
+                       virtio_ack_link_announce(dev);
        }
 }