]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
virtio: virtio_net free transmit skbs in a timer
authorMark McLoughlin <markmc@redhat.com>
Sun, 8 Jun 2008 10:50:56 +0000 (20:50 +1000)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 10 Jun 2008 22:20:31 +0000 (18:20 -0400)
commit14c998f034bdc9a5bfa53bca18fbd0738cbc65e8
tree161263012d022bddcdb7a0389f0ab367c013ce66
parent2506ece0c0bbd2fc19a4827b96dc52ea47e2ce4a
virtio: virtio_net free transmit skbs in a timer

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: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/virtio_net.c