Re: [PATCH WIP 02/43] IB/mlx4: Support ib_alloc_mr verb

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

 



On 7/22/2015 7:58 PM, Jason Gunthorpe wrote:
On Wed, Jul 22, 2015 at 09:55:02AM +0300, Sagi Grimberg wrote:

+struct ib_mr *mlx4_ib_alloc_mr(struct ib_pd *pd,
+			       enum ib_mr_type mr_type,
+			       u32 max_entries,
+			       u32 flags)
+{

This is just a copy of mlx4_ib_alloc_fast_reg_mr with
this added:

+	if (mr_type != IB_MR_TYPE_FAST_REG || flags)
+		return ERR_PTR(-EINVAL);

Are all the driver updates the same? It looks like it.

I'd suggest shortening this patch series, have the core provide the
wrapper immediately:

struct ib_mr *ib_alloc_mr(struct ib_pd *pd,
{
...

     if (pd->device->alloc_mr) {
	mr = pd->device->alloc_mr(pd, mr_type, max_entries, flags);
     } else {
    	if (mr_type != IB_MR_TYPE_FAST_REG || flags ||
	    !ib_dev->alloc_fast_reg_mr)
		return ERR_PTR(-ENOSYS);
	mr = pd->device->alloc_fast_reg_mr(..);
     }
}

Then go through the series to remove ib_alloc_fast_reg_mr

Then go through one series to migrate the drivers from
alloc_fast_reg_mr to alloc_mr

Then entirely drop alloc_fast_reg_mr from the driver API.

That should be shorter and easier to read the driver diffs, which is
the major change here.

Yea, it would be better...

Thanks.
--
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