From: Roland Dreier <rdreier@cisco.com>
To: David Miller <davem@davemloft.net>
Cc: herbert@gondor.apana.org.au, mchan@broadcom.com,
jgarzik@pobox.com, netdev@vger.kernel.org
Subject: Re: [NET]: Add netif_tx_lock
Date: Mon, 05 Jun 2006 23:01:34 -0700 [thread overview]
Message-ID: <ada8xoan7pd.fsf@cisco.com> (raw)
In-Reply-To: <20060605.221018.70218518.davem@davemloft.net> (David Miller's message of "Mon, 05 Jun 2006 22:10:18 -0700 (PDT)")
David> As long as you never take priv->lock while ->xmit_lock is
David> held your patch should be OK.
Duh ... unfortunately priv->lock is taken from interrupt context so
that patch isn't safe. A correct fix would be the following, which
leads to a trivial conversion to using netif_tx_lock().
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 1dae4b2..7a8ca5d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -821,8 +821,8 @@ void ipoib_mcast_restart_task(void *dev_
ipoib_mcast_stop_thread(dev, 0);
- spin_lock_irqsave(&dev->xmit_lock, flags);
- spin_lock(&priv->lock);
+ spin_lock_bh(&dev->xmit_lock);
+ spin_lock_irqsave(&priv->lock, flags);
/*
* Unfortunately, the networking core only gives us a list of all of
@@ -895,8 +895,8 @@ void ipoib_mcast_restart_task(void *dev_
}
}
- spin_unlock(&priv->lock);
- spin_unlock_irqrestore(&dev->xmit_lock, flags);
+ spin_unlock_irqrestore(&priv->lock, flags);
+ spin_unlock_bh(&dev->xmit_lock);
/* We have to cancel outside of the spinlock */
list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
next prev parent reply other threads:[~2006-06-06 6:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 4:51 netif_tx_disable and lockless TX Michael Chan
2006-05-31 4:58 ` Herbert Xu
2006-05-31 5:11 ` David Miller
2006-05-31 5:14 ` Herbert Xu
2006-05-31 6:26 ` David Miller
2006-05-31 6:31 ` Herbert Xu
2006-05-31 7:08 ` David Miller
2006-05-31 12:06 ` Herbert Xu
2006-05-31 12:36 ` jamal
2006-05-31 12:40 ` Herbert Xu
2006-05-31 13:03 ` jamal
2006-05-31 17:52 ` Robert Olsson
2006-06-02 3:25 ` Stephen Hemminger
2006-06-02 10:46 ` Robert Olsson
2006-06-14 12:52 ` jamal
2006-05-31 21:20 ` Michael Chan
2006-06-01 0:09 ` David Miller
2006-06-01 0:25 ` Herbert Xu
2006-05-31 23:01 ` Michael Chan
2006-06-01 0:42 ` Herbert Xu
2006-06-01 0:27 ` Michael Chan
2006-06-01 2:27 ` Herbert Xu
2006-06-01 11:15 ` [NET]: Add netif_tx_lock Herbert Xu
2006-06-06 4:32 ` David Miller
2006-06-06 4:44 ` Roland Dreier
2006-06-06 4:50 ` Roland Dreier
2006-06-06 4:57 ` Roland Dreier
2006-06-06 5:10 ` David Miller
2006-06-06 6:01 ` Roland Dreier [this message]
2006-06-06 4:58 ` David Miller
2006-06-06 5:04 ` Roland Dreier
2006-06-06 5:09 ` David Miller
2006-06-06 4:57 ` David Miller
2006-06-06 10:22 ` Herbert Xu
2006-06-09 5:48 ` Herbert Xu
2006-06-09 19:21 ` 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=ada8xoan7pd.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jgarzik@pobox.com \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.