• Mark McLoughlin's avatar
    virtio: virtio_net free transmit skbs in a timer · 14c998f0
    Mark McLoughlin authored
    virtio_net currently only frees old transmit skbs just
    before queueing new ones. If the queue is full, it then
    enables interrupts and waits for notification that more
    work has been performed.
    
    However, a side-effect of this scheme is that there are
    always xmit skbs left dangling when no new packets are
    sent, against the Documentation/networking/driver.txt
    guideline:
    
      "... it is not allowed for your TX mitigation scheme
       to let TX packets "hang out" in the TX ring unreclaimed
       forever if no new TX packets are sent."
    
    Add a timer to ensure that any time we queue new TX
    skbs, we will shortly free them again.
    
    This fixes an easily reproduced hang at shutdown where
    iptables attempts to unload nf_conntrack and nf_conntrack
    waits for an skb it is tracking to be freed, but virtio_net
    never frees it.
    Signed-off-by: default avatarMark McLoughlin <markmc@redhat.com>
    Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
    Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
    14c998f0
virtio_net.c 14.5 KB