[ewg] OFED-1.3.2-20080728-0355.tgz issues

Doug Ledford dledford at redhat.com
Thu Sep 11 14:32:33 PDT 2008


On Thu, 2008-09-11 at 23:42 +0300, Eli Cohen wrote:

> > > Index: ofed_kernel-fixes/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
> > > ===================================================================
> > > --- ofed_kernel-fixes.orig/drivers/infiniband/ulp/ipoib/ipoib_verbs.c	2008-09-08 13:07:02.000000000 +0300
> > > +++ ofed_kernel-fixes/drivers/infiniband/ulp/ipoib/ipoib_verbs.c	2008-09-08 13:08:41.000000000 +0300
> > > @@ -234,7 +234,7 @@ int ipoib_transport_dev_init(struct net_
> > >  		if (i < UD_POST_RCV_COUNT - 1)
> > >  			priv->rx_wr_draft[i].next = &priv->rx_wr_draft[i + 1];
> > >  	}
> > > -	priv->rx_wr_draft[i].next = NULL;
> > > +	priv->rx_wr_draft[UD_POST_RCV_COUNT - 1].next = NULL;
> > >  
> > >  	if (ipoib_ud_need_sg(priv->max_ib_mtu)) {
> > >  		for (i = 0; i < UD_POST_RCV_COUNT; ++i) {
> > > 
> > > What do you think?
> > 
> > If you're going to keep the setting of the last item to NULL outside the
> > loop, then you can also remove the if inside the loop as you'll just
> > overwrite the last entry when you exit the loop.
> > 
> Well, yes, but then I am going to reference an entry outside the
> bounds of the array, which we want to prevent in the first place.

No, you won't be referencing it, you'll be calculating it's address,
saving that calculated result into a valid spot in the array, and then
immediately overwriting that result with NULL.  That's perfectly valid.

-- 
Doug Ledford <dledford at redhat.com>
              GPG KeyID: CFBFF194
              http://people.redhat.com/dledford

Infiniband specific RPMs available at
              http://people.redhat.com/dledford/Infiniband

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/ewg/attachments/20080911/c2c5f684/attachment.sig>


More information about the ewg mailing list