[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <OF78ACF954.97C6291D-ON65257321.003BD95C-65257321.003E0CCE@in.ibm.com>
Date: Mon, 23 Jul 2007 16:47:45 +0530
From: Krishna Kumar2 <krkumar2@...ibm.com>
To: Evgeniy Polyakov <johnpol@....mipt.ru>
Cc: davem@...emloft.net, gaagaan@...il.com,
general@...ts.openfabrics.org, hadi@...erus.ca,
herbert@...dor.apana.org.au, jagana@...ibm.com, jeff@...zik.org,
kaber@...sh.net, kumarkr@...ux.ibm.com, mcarlson@...adcom.com,
mchan@...adcom.com, netdev@...r.kernel.org,
peter.p.waskiewicz.jr@...el.com, rdreier@...co.com,
rick.jones2@...com, Robert.Olsson@...a.slu.se, sri@...ibm.com,
tgraf@...g.ch, xma@...ibm.com
Subject: Re: [PATCH 11/12 -Rev2] IPoIB xmit API addition
Hi Evgeniy,
Evgeniy Polyakov <johnpol@....mipt.ru> 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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists