netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krishna Kumar <krkumar2@in.ibm.com>
To: rdreier@cisco.com
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	general@lists.openfabrics.org
Subject: [ofa-general] [PATCH 1/2] IPoIB: Fix unregister_netdev hang
Date: Tue, 18 Sep 2007 16:48:03 +0530	[thread overview]
Message-ID: <20070918111803.1769.60619.sendpatchset@localhost.localdomain> (raw)

While using IPoIB over EHCA (rc6 bits), unregister_netdev hangs with
the message: "waiting for ib2 to become free.  Usage count = -515276",
etc.

The problem is that the poll handler does netif_rx_complete (which
does a dev_put) followed by netif_rx_reschedule() to schedule for
more receives (which again does a dev_put). This reduces refcount to
< 0 (depending on how many times netif_rx_complete followed by
netif_rx_reschedule was called).

The following patch fixes the bug, but I don't know if there is some
specific IB issue that prevents this approach.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 ipoib_ib.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff -ruNp org/drivers/infiniband/ulp/ipoib/ipoib_ib.c new1/drivers/infiniband/ulp/ipoib/ipoib_ib.c
--- org/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2007-09-18 15:50:09.000000000 +0530
+++ new1/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2007-09-18 16:14:20.000000000 +0530
@@ -291,7 +291,6 @@ int ipoib_poll(struct napi_struct *napi,
 
 	done  = 0;
 
-poll_more:
 	while (done < budget) {
 		int max = (budget - done);
 
@@ -316,12 +315,10 @@ poll_more:
 	}
 
 	if (done < budget) {
-		netif_rx_complete(dev, napi);
-		if (unlikely(ib_req_notify_cq(priv->cq,
-					      IB_CQ_NEXT_COMP |
-					      IB_CQ_REPORT_MISSED_EVENTS)) &&
-		    netif_rx_reschedule(napi))
-			goto poll_more;
+		if (likely(!ib_req_notify_cq(priv->cq,
+					     IB_CQ_NEXT_COMP |
+					     IB_CQ_REPORT_MISSED_EVENTS)))
+			netif_rx_complete(dev, napi);
 	}
 
 	return done;

             reply	other threads:[~2007-09-18 11:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 11:18 Krishna Kumar [this message]
2007-09-18 11:18 ` [ofa-general] [PATCH 2/2] IPoIB: Code cleanup Krishna Kumar
2007-09-18 14:27 ` [PATCH 1/2] IPoIB: Fix unregister_netdev hang Roland Dreier
2007-09-19  3:23   ` Krishna Kumar2
2007-09-19  3:30     ` [ofa-general] " Roland Dreier
2007-09-19  4:24       ` Krishna Kumar2
2007-09-18 17:58 ` [PATCH net-2.6.24] Fix refcounting problem with netif_rx_reschedule() Roland Dreier
2007-09-18 18:04   ` [ofa-general] [PATCH net-2.6.24] Fix documentation for dev_put()/dev_hold() Roland Dreier
2007-09-18 20:16     ` David Miller
2007-09-18 20:15   ` [ofa-general] Re: [PATCH net-2.6.24] Fix refcounting problem with netif_rx_reschedule() David Miller
2007-09-18 22:46     ` Roland Dreier
2007-09-18 22:50       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070918111803.1769.60619.sendpatchset@localhost.localdomain \
    --to=krkumar2@in.ibm.com \
    --cc=davem@davemloft.net \
    --cc=general@lists.openfabrics.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).