summaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-09-24 17:59:17 +0200
committerRusty Russell <rusty@rustcorp.com.au>2009-09-24 02:29:18 +0200
commit2b5bbe3b8bee8b38bdc27dd9c0270829b6eb7eeb (patch)
treeae10e097de665aba47306799e9ab5ef44776e1e1 /drivers/net/virtio_net.c
parentMerge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/... (diff)
downloadlinux-2b5bbe3b8bee8b38bdc27dd9c0270829b6eb7eeb.tar.xz
linux-2b5bbe3b8bee8b38bdc27dd9c0270829b6eb7eeb.zip
virtio_net: skb_orphan() and nf_reset() in xmit path.
The complex transmit free logic was introduced to avoid hangs on removing the ip_conntrack module and also because drivers aren't generally supposed to keep stale skbs for unbounded times. After some debate, it was decided that while doing skb_orphan() generally is a rat's nest, we can do it in this driver. Following patches take advantage of this. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 5c498d2b043f..dc4c68718976 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -528,8 +528,12 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
- if (err >= 0 && !vi->free_in_tasklet)
+ if (err >= 0 && !vi->free_in_tasklet) {
+ /* Don't wait up for transmitted skbs to be freed. */
+ skb_orphan(skb);
+ nf_reset(skb);
mod_timer(&vi->xmit_free_timer, jiffies + (HZ/10));
+ }
return err;
}