Lines Matching defs:cap

443 static int set_rq_size(struct hns_roce_dev *hr_dev, struct ib_qp_cap *cap,
453 cap->max_recv_wr = 0;
454 cap->max_recv_sge = 0;
460 if (!cap->max_recv_wr || cap->max_recv_wr > hr_dev->caps.max_wqes ||
461 cap->max_recv_sge > max_sge) {
464 cap->max_recv_wr, cap->max_recv_sge);
468 cnt = roundup_pow_of_two(max(cap->max_recv_wr, hr_dev->caps.min_wqes));
471 cap->max_recv_wr);
475 hr_qp->rq.max_gs = roundup_pow_of_two(max(1U, cap->max_recv_sge) +
483 cap->max_recv_wr = cnt;
484 cap->max_recv_sge = hr_qp->rq.max_gs - hr_qp->rq.rsv_sge;
490 struct ib_qp_cap *cap)
492 if (cap->max_inline_data) {
493 cap->max_inline_data = roundup_pow_of_two(cap->max_inline_data);
494 return min(cap->max_inline_data,
502 struct ib_qp_cap *cap)
511 cap->max_inline_data = max(cap->max_inline_data,
515 hr_qp->max_inline_data = cap->max_inline_data;
549 struct hns_roce_qp *hr_qp, struct ib_qp_cap *cap)
558 cap->max_inline_data = get_max_inline_data(hr_dev, cap);
563 cap->max_send_sge);
568 cap->max_inline_data));
577 hr_qp->sq.max_gs = max(1U, cap->max_send_sge);
591 update_inline_data(hr_qp, cap);
595 struct ib_qp_cap *cap,
608 if (cap->max_send_sge > hr_dev->caps.max_sq_sg) {
610 cap->max_send_sge);
618 struct ib_qp_cap *cap, struct hns_roce_qp *hr_qp,
629 ret = check_sq_size_with_integrity(hr_dev, cap, ucmd);
636 set_ext_sge_param(hr_dev, cnt, hr_qp, cap);
640 cap->max_send_sge = hr_qp->sq.max_gs;
697 struct ib_qp_cap *cap, struct hns_roce_qp *hr_qp)
702 if (!cap->max_send_wr || cap->max_send_wr > hr_dev->caps.max_wqes ||
703 cap->max_send_sge > hr_dev->caps.max_sq_sg) {
708 cnt = roundup_pow_of_two(max(cap->max_send_wr, hr_dev->caps.min_wqes));
718 set_ext_sge_param(hr_dev, cnt, hr_qp, cap);
721 cap->max_send_wr = cnt;
722 cap->max_send_sge = hr_qp->sq.max_gs;
729 if (attr->qp_type == IB_QPT_XRC_TGT || !attr->cap.max_send_wr)
739 !attr->cap.max_recv_wr)
1076 ret = set_rq_size(hr_dev, &init_attr->cap, hr_qp,
1096 ret = set_user_sq_size(hr_dev, &init_attr->cap, hr_qp, ucmd);
1108 ret = set_kernel_sq_size(hr_dev, &init_attr->cap, hr_qp);