Re: [PATCH v1 1/1] rxe: calculate inline data size based on requested values

From: Jason Gunthorpe
Date: Tue Oct 29 2019 - 15:44:41 EST


On Tue, Oct 29, 2019 at 12:31:03PM -0700, Rao Shoaib wrote:

> > > @@ -81,6 +80,7 @@ enum rxe_device_param {
> > > | IB_DEVICE_MEM_MGT_EXTENSIONS,
> > > RXE_MAX_SGE = 32,
> > > RXE_MAX_SGE_RD = 32,
> > > + RXE_MAX_INLINE_DATA = RXE_MAX_SGE * sizeof(struct ib_sge),
> > > RXE_MAX_CQ = 16384,
> > > RXE_MAX_LOG_CQE = 15,
> > > RXE_MAX_MR = 2 * 1024,
> > Increasing RXE_MAX_INLINE_DATA to match the WQE size limited the
> > MAX_SGE. IMHO this is done in a hacky way, instead we should define a
> > maximim WQE size and from there derive the MAX_INLINE_DATA and MAX_SGE
> > limitations.
> There was already RXE_MAX_SGE defined so I did not define MAX_WQE. If that
> is what is preference I can submit a patch with that. What is a good value
> for MAX_WQE?

I would arrange it so that RXE_MAX_SGE doesn't change

> > Also don't double initialize qp->sq.max_inline in the same function,
> > and there is no need for the temporary 'inline_size'
>
> I used a separate variable as I would have to repeat the calculation twice.
> I do not understand your comment about double initialization, can you please
> clarify that for me.

Assign it to qp->sq.max_inline and then read it to get the init

Look above in the function, there is already an assignment to
qp->sq.max_inline

Jason