Re: About a shortcoming of the verbs API

Ralph Campbell
2010-07-28T18:11:41Z

On Wed, 2010-07-28 at 11:05 -0700, Roland Dreier wrote:
> > Actually, I tried to implement the completion callback
> > in a workqueue thread but ipoib_cm_handle_tx_wc() calls
> > netif_tx_lock() which isn't safe unless it is called
> > from an IRQ handler or netif_tx_lock_bh() is called first.
>
> Oh, sounds like a bug in IPoIB. I guess we could fix it by just
> changing it to netif_tx_lock_bh()? (Or is that not safe from an IRQ handler?)

netif_tx_lock_bh() is an inline function for
local_bh_disable();
netif_tx_lock();

so I meant to say local_bh_disable(), not netif_tx_lock_bh().

Basically, we would need a "irqsave" version of netif_tx_lock()
so that it could be called from either IRQ or non-IRQ context
and save/restore the prior state.