Re: [PATCH V4 for-next 08/10] IB/core: Extend create QP to get indirection table

Sagi Grimberg
2016-05-29T13:11:41Z

On 23/05/16 15:20, Yishai Hadas wrote:
> Extend create QP to get Receive Work Queue (WQ) indirection table.
>
> QP can be created with external Receive Work Queue indirection table,
> in that case it is ready to receive immediately.
>
>
> Signed-off-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/core/verbs.c | 19 +++++++++++++++++--
> include/rdma/ib_verbs.h | 2 ++
> 2 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index 6b548d7..6916d5c 100644
> --- a/drivers/infiniband/core/verbs.c
> +++ b/drivers/infiniband/core/verbs.c
> @@ -754,6 +754,12 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
> struct ib_qp *qp;
> int ret;
>
> + if (qp_init_attr->rwq_ind_tbl &&
> + (qp_init_attr->recv_cq ||
> + qp_init_attr->srq || qp_init_attr->cap.max_recv_wr ||
> + qp_init_attr->cap.max_recv_sge))
> + return ERR_PTR(-EINVAL);
> +

Yishai,

I understand that a qp cannot have indirection table with a srq or a
recv_cq, but can you explain the max_recv_[wr|sge] condition?

Would it make better sense to condition on the QP type?

Other then that,

Reviewed-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>