Commit b708fba3 authored by Joachim Fenkes's avatar Joachim Fenkes Committed by Roland Dreier

IB/ehca: Add check for max #SGE to create_qp()

Signed-off-by: default avatarJoachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 86dce445
...@@ -513,7 +513,7 @@ static struct ehca_qp *internal_create_qp( ...@@ -513,7 +513,7 @@ static struct ehca_qp *internal_create_qp(
} else if (init_attr->cap.max_send_wr > 255) { } else if (init_attr->cap.max_send_wr > 255) {
ehca_err(pd->device, ehca_err(pd->device,
"Invalid Number of " "Invalid Number of "
"ax_send_wr=%x for UD QP_TYPE=%x", "max_send_wr=%x for UD QP_TYPE=%x",
init_attr->cap.max_send_wr, qp_type); init_attr->cap.max_send_wr, qp_type);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -524,6 +524,18 @@ static struct ehca_qp *internal_create_qp( ...@@ -524,6 +524,18 @@ static struct ehca_qp *internal_create_qp(
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
break; break;
} }
} else {
int max_sge = (qp_type == IB_QPT_UD || qp_type == IB_QPT_SMI
|| qp_type == IB_QPT_GSI) ? 250 : 252;
if (init_attr->cap.max_send_sge > max_sge
|| init_attr->cap.max_recv_sge > max_sge) {
ehca_err(pd->device, "Invalid number of SGEs requested "
"send_sge=%x recv_sge=%x max_sge=%x",
init_attr->cap.max_send_sge,
init_attr->cap.max_recv_sge, max_sge);
return ERR_PTR(-EINVAL);
}
} }
if (pd->uobject && udata) if (pd->uobject && udata)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment