[ewg] Re: Continue of "defer skb_orphan() until irqs enabled"

Eli Cohen eli at dev.mellanox.co.il
Thu Sep 25 08:28:02 PDT 2008


On Thu, Sep 25, 2008 at 06:02:48PM +0300, Moni Shoua wrote:
> Are you sure? Although the chances are low I still don't see how it is 100% safe to assume that 
> no cq polling that will drain the queue completely will happen if we don't hold the lock.
> 
> > +
> > +	return !(sent && priv->tx_outstanding &&
> > +			priv->tx_outstanding != ipoib_sendq_size);
> >  }
> >  
> The second condition in the if() is contained in the third. I think you can drop it.
> Your earlier patch checked for !netif_queue_stopped(). Is there a reason 
> why you changed it to priv->tx_outstanding != ipoib_sendq_size?
> Aren't they the same?

The first condition makes sure I sent something
The second makes sure the SKB I sent was not released yet.
The third one ensures the queue is not stopped (maybe it would be
clearer if I made it && !netif_queue_stopped().
In any case, the dangerous SKB is the one who's posting caused the
queue to be stopped (and the CQ be armed), so I believe this patch
fixes this situation.



More information about the ewg mailing list