From: David Miller <davem@davemloft.net>
To: ogerlitz@mellanox.com
Cc: netdev@vger.kernel.org, shlomop@mellanox.com
Subject: Re: net-next warning at kernel/softirq.c:159 local_bh_enable
Date: Thu, 05 Jul 2012 21:08:32 -0700 (PDT) [thread overview]
Message-ID: <20120705.210832.1951884287116053841.davem@davemloft.net> (raw)
In-Reply-To: <alpine.LRH.2.00.1207060616590.21283@ogerlitz.voltaire.com>
From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Fri, 6 Jul 2012 06:20:58 +0300
> Shlomo saw too the ipv6 dst crash that was reported over
> the list and also this warning when he rebased to net-next yesterday
Here is what I commited to fix this:
====================
[PATCH] ipoib: Need to do dst_neigh_lookup_skb() outside of priv->lock.
Otherwise local_bh_enable() complains.
Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index fbb95ee..7cecb16 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -658,9 +658,15 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
+ struct dst_entry *dst = skb_dst(skb);
struct ipoib_mcast *mcast;
+ struct neighbour *n;
unsigned long flags;
+ n = NULL;
+ if (dst)
+ n = dst_neigh_lookup_skb(dst, skb);
+
spin_lock_irqsave(&priv->lock, flags);
if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) ||
@@ -715,12 +721,6 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
out:
if (mcast && mcast->ah) {
- struct dst_entry *dst = skb_dst(skb);
- struct neighbour *n = NULL;
-
- rcu_read_lock();
- if (dst)
- n = dst_neigh_lookup_skb(dst, skb);
if (n) {
if (!*to_ipoib_neigh(n)) {
struct ipoib_neigh *neigh;
@@ -735,13 +735,14 @@ out:
}
neigh_release(n);
}
- rcu_read_unlock();
spin_unlock_irqrestore(&priv->lock, flags);
ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
return;
}
unlock:
+ if (n)
+ neigh_release(n);
spin_unlock_irqrestore(&priv->lock, flags);
}
--
1.7.10.4
next prev parent reply other threads:[~2012-07-06 4:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-06 3:20 net-next warning at kernel/softirq.c:159 local_bh_enable Or Gerlitz
2012-07-06 4:08 ` David Miller [this message]
2012-07-06 4:22 ` Or Gerlitz
2012-07-06 4:17 ` Or Gerlitz
2012-07-06 4:20 ` David Miller
2012-07-06 4:33 ` Or Gerlitz
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=20120705.210832.1951884287116053841.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=shlomop@mellanox.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).