• Jason Wang's avatar
    virtio-net: correct error handling of virtqueue_kick() · 681daee2
    Jason Wang authored
    Current error handling of virtqueue_kick() was wrong in two places:
    - The skb were freed immediately when virtqueue_kick() fail during
      xmit. This may lead double free since the skb was not detached from
      the virtqueue.
    - try_fill_recv() returns false when virtqueue_kick() fail. This will
      lead unnecessary rescheduling of refill work.
    
    Actually, it's safe to just ignore the kick failure in those two
    places. So this patch fixes this by partially revert commit
    67975901.
    
    Fixes 67975901
    (virtio_net: verify if virtqueue_kick() succeeded).
    
    Cc: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Cc: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    681daee2
virtio_net.c 48.7 KB