Lines Matching refs:attr
46 if (cap->max_send_wr > rxe->attr.max_qp_wr) { in rxe_qp_chk_cap()
48 cap->max_send_wr, rxe->attr.max_qp_wr); in rxe_qp_chk_cap()
52 if (cap->max_send_sge > rxe->attr.max_send_sge) { in rxe_qp_chk_cap()
54 cap->max_send_sge, rxe->attr.max_send_sge); in rxe_qp_chk_cap()
59 if (cap->max_recv_wr > rxe->attr.max_qp_wr) { in rxe_qp_chk_cap()
61 cap->max_recv_wr, rxe->attr.max_qp_wr); in rxe_qp_chk_cap()
65 if (cap->max_recv_sge > rxe->attr.max_recv_sge) { in rxe_qp_chk_cap()
67 cap->max_recv_sge, rxe->attr.max_recv_sge); in rxe_qp_chk_cap()
140 for (i = 0; i < qp->attr.max_dest_rd_atomic; i++) { in free_rd_atomic_resources()
168 for (i = 0; i < qp->attr.max_dest_rd_atomic; i++) { in cleanup_rd_atomic_resources()
182 qp->attr.path_mtu = 1; in rxe_qp_init_misc()
183 qp->mtu = ib_mtu_enum_to_int(qp->attr.path_mtu); in rxe_qp_init_misc()
192 qp->attr.port_num = init->port_num; in rxe_qp_init_misc()
198 qp->attr.port_num = init->port_num; in rxe_qp_init_misc()
357 qp->attr.qp_state = IB_QPS_RESET; in rxe_qp_from_init()
404 struct ib_qp_attr *attr, int mask) in rxe_qp_chk_attr() argument
407 attr->cur_qp_state : qp->attr.qp_state; in rxe_qp_chk_attr()
409 attr->qp_state : cur_state; in rxe_qp_chk_attr()
426 if (attr->port_num != 1) { in rxe_qp_chk_attr()
427 pr_warn("invalid port %d\n", attr->port_num); in rxe_qp_chk_attr()
432 if (mask & IB_QP_CAP && rxe_qp_chk_cap(rxe, &attr->cap, !!qp->srq)) in rxe_qp_chk_attr()
435 if (mask & IB_QP_AV && rxe_av_chk_attr(rxe, &attr->ah_attr)) in rxe_qp_chk_attr()
439 if (rxe_av_chk_attr(rxe, &attr->alt_ah_attr)) in rxe_qp_chk_attr()
441 if (attr->alt_port_num != 1) { in rxe_qp_chk_attr()
442 pr_warn("invalid alt port %d\n", attr->alt_port_num); in rxe_qp_chk_attr()
445 if (attr->alt_timeout > 31) { in rxe_qp_chk_attr()
447 attr->alt_timeout); in rxe_qp_chk_attr()
455 enum ib_mtu max_mtu = port->attr.max_mtu; in rxe_qp_chk_attr()
456 enum ib_mtu mtu = attr->path_mtu; in rxe_qp_chk_attr()
467 if (attr->max_rd_atomic > rxe->attr.max_qp_rd_atom) { in rxe_qp_chk_attr()
469 attr->max_rd_atomic, in rxe_qp_chk_attr()
470 rxe->attr.max_qp_rd_atom); in rxe_qp_chk_attr()
476 if (attr->timeout > 31) { in rxe_qp_chk_attr()
478 attr->timeout); in rxe_qp_chk_attr()
566 qp->attr.qp_state = IB_QPS_ERR; in rxe_qp_error()
579 int rxe_qp_from_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask, in rxe_qp_from_attr() argument
585 int max_rd_atomic = __roundup_pow_of_two(attr->max_rd_atomic); in rxe_qp_from_attr()
587 qp->attr.max_rd_atomic = max_rd_atomic; in rxe_qp_from_attr()
593 __roundup_pow_of_two(attr->max_dest_rd_atomic); in rxe_qp_from_attr()
595 qp->attr.max_dest_rd_atomic = max_dest_rd_atomic; in rxe_qp_from_attr()
605 qp->attr.cur_qp_state = attr->qp_state; in rxe_qp_from_attr()
608 qp->attr.en_sqd_async_notify = attr->en_sqd_async_notify; in rxe_qp_from_attr()
611 qp->attr.qp_access_flags = attr->qp_access_flags; in rxe_qp_from_attr()
614 qp->attr.pkey_index = attr->pkey_index; in rxe_qp_from_attr()
617 qp->attr.port_num = attr->port_num; in rxe_qp_from_attr()
620 qp->attr.qkey = attr->qkey; in rxe_qp_from_attr()
623 rxe_av_from_attr(attr->port_num, &qp->pri_av, &attr->ah_attr); in rxe_qp_from_attr()
624 rxe_av_fill_ip_info(&qp->pri_av, &attr->ah_attr); in rxe_qp_from_attr()
628 rxe_av_from_attr(attr->alt_port_num, &qp->alt_av, in rxe_qp_from_attr()
629 &attr->alt_ah_attr); in rxe_qp_from_attr()
630 rxe_av_fill_ip_info(&qp->alt_av, &attr->alt_ah_attr); in rxe_qp_from_attr()
631 qp->attr.alt_port_num = attr->alt_port_num; in rxe_qp_from_attr()
632 qp->attr.alt_pkey_index = attr->alt_pkey_index; in rxe_qp_from_attr()
633 qp->attr.alt_timeout = attr->alt_timeout; in rxe_qp_from_attr()
637 qp->attr.path_mtu = attr->path_mtu; in rxe_qp_from_attr()
638 qp->mtu = ib_mtu_enum_to_int(attr->path_mtu); in rxe_qp_from_attr()
642 qp->attr.timeout = attr->timeout; in rxe_qp_from_attr()
643 if (attr->timeout == 0) { in rxe_qp_from_attr()
647 int j = nsecs_to_jiffies(4096ULL << attr->timeout); in rxe_qp_from_attr()
654 qp->attr.retry_cnt = attr->retry_cnt; in rxe_qp_from_attr()
655 qp->comp.retry_cnt = attr->retry_cnt; in rxe_qp_from_attr()
657 attr->retry_cnt); in rxe_qp_from_attr()
661 qp->attr.rnr_retry = attr->rnr_retry; in rxe_qp_from_attr()
662 qp->comp.rnr_retry = attr->rnr_retry; in rxe_qp_from_attr()
664 attr->rnr_retry); in rxe_qp_from_attr()
668 qp->attr.rq_psn = (attr->rq_psn & BTH_PSN_MASK); in rxe_qp_from_attr()
669 qp->resp.psn = qp->attr.rq_psn; in rxe_qp_from_attr()
675 qp->attr.min_rnr_timer = attr->min_rnr_timer; in rxe_qp_from_attr()
677 attr->min_rnr_timer); in rxe_qp_from_attr()
681 qp->attr.sq_psn = (attr->sq_psn & BTH_PSN_MASK); in rxe_qp_from_attr()
682 qp->req.psn = qp->attr.sq_psn; in rxe_qp_from_attr()
683 qp->comp.psn = qp->attr.sq_psn; in rxe_qp_from_attr()
688 qp->attr.path_mig_state = attr->path_mig_state; in rxe_qp_from_attr()
691 qp->attr.dest_qp_num = attr->dest_qp_num; in rxe_qp_from_attr()
694 qp->attr.qp_state = attr->qp_state; in rxe_qp_from_attr()
696 switch (attr->qp_state) { in rxe_qp_from_attr()
739 int rxe_qp_to_attr(struct rxe_qp *qp, struct ib_qp_attr *attr, int mask) in rxe_qp_to_attr() argument
741 *attr = qp->attr; in rxe_qp_to_attr()
743 attr->rq_psn = qp->resp.psn; in rxe_qp_to_attr()
744 attr->sq_psn = qp->req.psn; in rxe_qp_to_attr()
746 attr->cap.max_send_wr = qp->sq.max_wr; in rxe_qp_to_attr()
747 attr->cap.max_send_sge = qp->sq.max_sge; in rxe_qp_to_attr()
748 attr->cap.max_inline_data = qp->sq.max_inline; in rxe_qp_to_attr()
751 attr->cap.max_recv_wr = qp->rq.max_wr; in rxe_qp_to_attr()
752 attr->cap.max_recv_sge = qp->rq.max_sge; in rxe_qp_to_attr()
755 rxe_av_to_attr(&qp->pri_av, &attr->ah_attr); in rxe_qp_to_attr()
756 rxe_av_to_attr(&qp->alt_av, &attr->alt_ah_attr); in rxe_qp_to_attr()
759 attr->sq_draining = 1; in rxe_qp_to_attr()
766 attr->sq_draining = 0; in rxe_qp_to_attr()
769 pr_debug("attr->sq_draining = %d\n", attr->sq_draining); in rxe_qp_to_attr()