On Thu, May 30, 2019 at 04:25:26PM +0300, Max Gurtovoy wrote: > Protect the case that a ULP tries to allocate a QP with signature > enabled flag while the LLD doesn't support this feature. > > Signed-off-by: Max Gurtovoy <maxg@xxxxxxxxxxxx> Oh, ok. I think this should be folded into the previous patch. > + 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)) || > + ((qp_init_attr->create_flags & IB_QP_CREATE_SIGNATURE_EN) && > + !(device->attrs.device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER))) > return ERR_PTR(-EINVAL); This looks almost unreadable. Just make the signature check a separate conditional.