Re: [PATCH 08/14] staging/rdma/hfi1: Start adding building blocks for TID caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 17, 2015 at 02:23:39PM +0300, Dan Carpenter wrote:
> On Thu, Dec 17, 2015 at 02:00:18AM -0500, ira.weiny@xxxxxxxxx wrote:
> > From: Mitko Haralanov <mitko.haralanov@xxxxxxxxx>
> > +static int unprogram_rcvarray(struct file *fp, u32 tidinfo,
> > +			      struct tid_group **grp)
> > +{
> > +	struct hfi1_filedata *fd = fp->private_data;
> > +	struct hfi1_ctxtdata *uctxt = fd->uctxt;
> > +	struct hfi1_devdata *dd = uctxt->dd;
> > +	struct mmu_rb_node *node;
> > +	u8 tidctrl = EXP_TID_GET(tidinfo, CTRL);
> > +	u32 tidbase = uctxt->expected_base,
> > +		tididx = EXP_TID_GET(tidinfo, IDX) << 1, rcventry;
> > +
> > +	if (tididx > uctxt->expected_count) {
> 
> Should this be >= ?  I don't think it makes that much difference since
> we're not using it as an offset.

Yes it looks like it should be.

I'm working on a V2 now.

Ira

> 
> > +		dd_dev_err(dd, "Invalid RcvArray entry (%u) index for ctxt %u\n",
> > +			   tididx, uctxt->ctxt);
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (tidctrl == 0x3)
> > +		return -EINVAL;
> > +
> > +	rcventry = tidbase + tididx + (tidctrl - 1);
> > +
> > +	spin_lock(&fd->rb_lock);
> > +	node = mmu_rb_search_by_entry(&fd->tid_rb_root, rcventry);
> > +	if (!node) {
> > +		spin_unlock(&fd->rb_lock);
> > +		return -EBADF;
> > +	}
> > +	rb_erase(&node->rbnode, &fd->tid_rb_root);
> > +	spin_unlock(&fd->rb_lock);
> > +	if (grp)
> > +		*grp = node->grp;
> > +	clear_tid_node(fd, fd->subctxt, node);
> > +	return 0;
> > +}
> 
> regards,
> dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux