If after receiving some packets and refilling the queue with buffers,
we detect that more packets are available then we re-schedule the
queue and process them.

This re-scheduling - i.e. calling __netif_rx_schedule() - causes a
netdev reference to be taken.

Once we've finally run out of buffers to process, we return zero and
net_rx_action() drops the reference taken by the original call to
_netif_rx_schedule() in e.g. skb_recv_done().

The reference taken by re-scheduling is always leaked, leading to:

      waiting for eth0 to become free. Usage count = 132568

Fix by immediately dropping the extra reference taken.

Signed-off-by: Mark McLoughlin <[EMAIL PROTECTED]>
---
 hack-module.awk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hack-module.awk b/hack-module.awk
index 7cb9381..b401aae 100644
--- a/hack-module.awk
+++ b/hack-module.awk
@@ -63,6 +63,7 @@
     print "    if (!no_work && netif_rx_schedule_prep(vi->dev)) {";
     print "            vi->rvq->vq_ops->disable_cb(vi->rvq);";
     print "            __netif_rx_schedule(vi->dev);";
+    print "            dev_put(vi->dev);";
     print "            goto again;";
     print "    }";
     print "";
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to