Re: Can someone help me understand the reason for this code in ib_isert.c?

Or Gerlitz
2014-10-20T21:13:22Z

On Mon, Oct 20, 2014 at 6:29 PM, Chris Moore <Chris.Moore-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org> wrote:
> The following code is in isert_conn_setup_qp() in ib_isert.c:
>
> /*
> * FIXME: Use devattr.max_sge - 2 for max_send_sge as
> * work-around for RDMA_READ..
> */
> attr.cap.max_send_sge = device->dev_attr.max_sge - 2;
>
> It's not clear from the comment what this is a work-around for, and I wasn't able
> to figure it out from looking at logs.

I believe this refers to some IBTA spec corner case which comes into
play with the max_sges advertized by mlx4, Eli, can you shed some
light (IBTA pointer) on that? is this the case (i.e dev_attr.max_sge
isn't always achievable) with mlx5 too?

> In trying to get isert working with ocrdma I ran into a problem where the code
> thought there was only 1 send SGE available when in fact the device has 3.
> Then I found the above work-around, which explained the problem.

Nic, any reason for attr.cap.max_send_sge = 1 not to work OK?

> Removing this (setting attr.cap.max_send_sge to device->dev_attr.max_sge)
> fixes the problem with isert and ocrdma, but I don't know what other side effects
> that might have.
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html