aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 88d7dd946033..f95403cb523d 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -513,7 +513,7 @@ static struct ehca_qp *internal_create_qp(
513 } else if (init_attr->cap.max_send_wr > 255) { 513 } else if (init_attr->cap.max_send_wr > 255) {
514 ehca_err(pd->device, 514 ehca_err(pd->device,
515 "Invalid Number of " 515 "Invalid Number of "
516 "ax_send_wr=%x for UD QP_TYPE=%x", 516 "max_send_wr=%x for UD QP_TYPE=%x",
517 init_attr->cap.max_send_wr, qp_type); 517 init_attr->cap.max_send_wr, qp_type);
518 return ERR_PTR(-EINVAL); 518 return ERR_PTR(-EINVAL);
519 } 519 }
@@ -524,6 +524,18 @@ static struct ehca_qp *internal_create_qp(
524 return ERR_PTR(-EINVAL); 524 return ERR_PTR(-EINVAL);
525 break; 525 break;
526 } 526 }
527 } else {
528 int max_sge = (qp_type == IB_QPT_UD || qp_type == IB_QPT_SMI
529 || qp_type == IB_QPT_GSI) ? 250 : 252;
530
531 if (init_attr->cap.max_send_sge > max_sge
532 || init_attr->cap.max_recv_sge > max_sge) {
533 ehca_err(pd->device, "Invalid number of SGEs requested "
534 "send_sge=%x recv_sge=%x max_sge=%x",
535 init_attr->cap.max_send_sge,
536 init_attr->cap.max_recv_sge, max_sge);
537 return ERR_PTR(-EINVAL);
538 }
527 } 539 }
528 540
529 if (pd->uobject && udata) 541 if (pd->uobject && udata)