diff options
author | Roland Dreier <rolandd@cisco.com> | 2008-09-30 13:36:21 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-09-30 13:36:21 -0400 |
commit | 943c246e9ba9078a61b6bcc5b4a8131ce8befb64 (patch) | |
tree | 5be6015188c06d14ff39ac85f28f58834d001d05 /drivers/infiniband/ulp/ipoib/ipoib.h | |
parent | c9da4bad5b80c3d9884e2c6ad8d2091252c32d5e (diff) |
IPoIB: Use netif_tx_lock() and get rid of private tx_lock, LLTX
Currently, IPoIB is an LLTX driver that uses its own IRQ-disabling
tx_lock. Not only do we want to get rid of LLTX, this actually causes
problems because of the skb_orphan() done with this tx_lock held: some
skb destructors expect to be run with interrupts enabled.
The simplest fix for this is to get rid of the driver-private tx_lock
and stop using LLTX. We kill off priv->tx_lock and use
netif_tx_lock[_bh]() instead; the patch to do this is a tiny bit
tricky because we need to update places that take priv->lock inside
the tx_lock to disable IRQs, rather than relying on tx_lock having
already disabled IRQs.
Also, there are a couple of places where we need to disable BHs to
make sure we have a consistent context to call netif_tx_lock() (since
we no longer can use _irqsave() variants), and we also have to change
ipoib_send_comp_handler() to call drain_tx_cq() through a timer rather
than directly, because ipoib_send_comp_handler() runs in interrupt
context and drain_tx_cq() must run in BH context so it can call
netif_tx_lock().
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib.h')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 05eb41b8ab63..68ba5c3482e4 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -268,10 +268,9 @@ struct ipoib_lro { | |||
268 | }; | 268 | }; |
269 | 269 | ||
270 | /* | 270 | /* |
271 | * Device private locking: tx_lock protects members used in TX fast | 271 | * Device private locking: network stack tx_lock protects members used |
272 | * path (and we use LLTX so upper layers don't do extra locking). | 272 | * in TX fast path, lock protects everything else. lock nests inside |
273 | * lock protects everything else. lock nests inside of tx_lock (ie | 273 | * of tx_lock (ie tx_lock must be acquired first if needed). |
274 | * tx_lock must be acquired first if needed). | ||
275 | */ | 274 | */ |
276 | struct ipoib_dev_priv { | 275 | struct ipoib_dev_priv { |
277 | spinlock_t lock; | 276 | spinlock_t lock; |
@@ -320,7 +319,6 @@ struct ipoib_dev_priv { | |||
320 | 319 | ||
321 | struct ipoib_rx_buf *rx_ring; | 320 | struct ipoib_rx_buf *rx_ring; |
322 | 321 | ||
323 | spinlock_t tx_lock; | ||
324 | struct ipoib_tx_buf *tx_ring; | 322 | struct ipoib_tx_buf *tx_ring; |
325 | unsigned tx_head; | 323 | unsigned tx_head; |
326 | unsigned tx_tail; | 324 | unsigned tx_tail; |