Hi Evgeniy, Evgeniy Polyakov <[EMAIL PROTECTED]> wrote on 07/23/2007 04:18:26 PM:
> > static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc) > > { > > struct ipoib_dev_priv *priv = netdev_priv(dev); > > + int i = 0, num_completions; > > + int tx_ring_index = priv->tx_tail & (ipoib_sendq_size - 1); > > unsigned int wr_id = wc->wr_id; > > - struct ipoib_tx_buf *tx_req; > > unsigned long flags; > > > > ipoib_dbg_data(priv, "send completion: id %d, status: %d\n", > > @@ -255,23 +256,57 @@ static void ipoib_ib_handle_tx_wc(struct > > return; > > } > > > > - tx_req = &priv->tx_ring[wr_id]; > > + num_completions = wr_id - tx_ring_index + 1; > > + if (num_completions <= 0) > > + num_completions += ipoib_sendq_size; > > Can this still be less than zero? Should never happen, otherwise the TX code wrote on bad/unallocated memory and would have crashed first. Thanks, - KK - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html