Lines Matching refs:attr

46 int mlx4_query_device(struct ibv_context *context, struct ibv_device_attr *attr)  in mlx4_query_device()  argument
53 ret = ibv_cmd_query_device(context, attr, &raw_fw_ver, &cmd, sizeof cmd); in mlx4_query_device()
61 snprintf(attr->fw_ver, sizeof attr->fw_ver, in mlx4_query_device()
69 struct ibv_device_attr_ex *attr, in mlx4_query_device_ex() argument
81 err = ibv_cmd_query_device_ex(context, input, attr, attr_size, in mlx4_query_device_ex()
98 snprintf(attr->orig_attr.fw_ver, sizeof attr->orig_attr.fw_ver, in mlx4_query_device_ex()
151 struct ibv_port_attr *attr) in mlx4_query_port() argument
156 err = ibv_cmd_query_port(context, port, attr, &cmd, sizeof(cmd)); in mlx4_query_port()
161 attr->link_layer; in mlx4_query_port()
163 attr->port_cap_flags; in mlx4_query_port()
228 struct ibv_xrcd_init_attr *attr) in mlx4_open_xrcd() argument
239 ret = ibv_cmd_open_xrcd(context, xrcd, sizeof(*xrcd), attr, in mlx4_open_xrcd()
647 struct ibv_srq_init_attr *attr) in mlx4_create_srq() argument
655 if (attr->attr.max_wr > 1 << 16 || attr->attr.max_sge > 64) in mlx4_create_srq()
665 srq->max = align_queue_size(attr->attr.max_wr + 1); in mlx4_create_srq()
666 srq->max_gs = attr->attr.max_sge; in mlx4_create_srq()
670 if (mlx4_alloc_srq_buf(pd, &attr->attr, srq)) in mlx4_create_srq()
682 ret = ibv_cmd_create_srq(pd, &srq->verbs_srq.srq, attr, in mlx4_create_srq()
719 struct ibv_srq_attr *attr, in mlx4_modify_srq() argument
724 return ibv_cmd_modify_srq(srq, attr, attr_mask, &cmd, sizeof cmd); in mlx4_modify_srq()
728 struct ibv_srq_attr *attr) in mlx4_query_srq() argument
732 return ibv_cmd_query_srq(srq, attr, &cmd, sizeof cmd); in mlx4_query_srq()
756 struct ibv_qp_init_attr_ex *attr, in mlx4_cmd_create_qp_ex() argument
775 sizeof(qp->verbs_qp), attr, in mlx4_cmd_create_qp_ex()
793 struct ibv_qp_init_attr_ex *attr) in mlx4_create_qp_ex() argument
803 if (attr->cap.max_send_wr > ctx->max_qp_wr || in mlx4_create_qp_ex()
804 attr->cap.max_recv_wr > ctx->max_qp_wr || in mlx4_create_qp_ex()
805 attr->cap.max_send_sge > ctx->max_sge || in mlx4_create_qp_ex()
806 attr->cap.max_recv_sge > ctx->max_sge) in mlx4_create_qp_ex()
809 if (attr->cap.max_send_wr > 65536 || in mlx4_create_qp_ex()
810 attr->cap.max_recv_wr > 65536 || in mlx4_create_qp_ex()
811 attr->cap.max_send_sge > 64 || in mlx4_create_qp_ex()
812 attr->cap.max_recv_sge > 64) in mlx4_create_qp_ex()
815 if (attr->cap.max_inline_data > 1024) in mlx4_create_qp_ex()
818 if (attr->comp_mask & ~MLX4_CREATE_QP_SUP_COMP_MASK) in mlx4_create_qp_ex()
825 if (attr->qp_type == IBV_QPT_XRC_RECV) { in mlx4_create_qp_ex()
826 attr->cap.max_send_wr = qp->sq.wqe_cnt = 0; in mlx4_create_qp_ex()
828 mlx4_calc_sq_wqe_size(&attr->cap, attr->qp_type, qp); in mlx4_create_qp_ex()
834 qp->sq.wqe_cnt = align_queue_size(attr->cap.max_send_wr + qp->sq_spare_wqes); in mlx4_create_qp_ex()
837 if (attr->srq || attr->qp_type == IBV_QPT_XRC_SEND || in mlx4_create_qp_ex()
838 attr->qp_type == IBV_QPT_XRC_RECV) { in mlx4_create_qp_ex()
839 attr->cap.max_recv_wr = qp->rq.wqe_cnt = attr->cap.max_recv_sge = 0; in mlx4_create_qp_ex()
841 qp->rq.wqe_cnt = align_queue_size(attr->cap.max_recv_wr); in mlx4_create_qp_ex()
842 if (attr->cap.max_recv_sge < 1) in mlx4_create_qp_ex()
843 attr->cap.max_recv_sge = 1; in mlx4_create_qp_ex()
844 if (attr->cap.max_recv_wr < 1) in mlx4_create_qp_ex()
845 attr->cap.max_recv_wr = 1; in mlx4_create_qp_ex()
848 if (mlx4_alloc_qp_buf(context, &attr->cap, attr->qp_type, qp)) in mlx4_create_qp_ex()
858 if (attr->cap.max_recv_sge) { in mlx4_create_qp_ex()
879 if (attr->comp_mask & MLX4_CREATE_QP_EX2_COMP_MASK) in mlx4_create_qp_ex()
880 ret = mlx4_cmd_create_qp_ex(context, attr, &cmd, qp); in mlx4_create_qp_ex()
883 sizeof(qp->verbs_qp), attr, in mlx4_create_qp_ex()
896 qp->rq.wqe_cnt = qp->rq.max_post = attr->cap.max_recv_wr; in mlx4_create_qp_ex()
897 qp->rq.max_gs = attr->cap.max_recv_sge; in mlx4_create_qp_ex()
898 if (attr->qp_type != IBV_QPT_XRC_RECV) in mlx4_create_qp_ex()
899 mlx4_set_sq_sizes(qp, &attr->cap, attr->qp_type); in mlx4_create_qp_ex()
902 if (attr->sq_sig_all) in mlx4_create_qp_ex()
914 if (attr->cap.max_recv_sge) in mlx4_create_qp_ex()
932 struct ibv_qp *mlx4_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr) in mlx4_create_qp() argument
937 memcpy(&attr_ex, attr, sizeof *attr); in mlx4_create_qp()
942 memcpy(attr, &attr_ex, sizeof *attr); in mlx4_create_qp()
946 struct ibv_qp *mlx4_open_qp(struct ibv_context *context, struct ibv_qp_open_attr *attr) in mlx4_open_qp() argument
957 ret = ibv_cmd_open_qp(context, &qp->verbs_qp, sizeof(qp->verbs_qp), attr, in mlx4_open_qp()
969 int mlx4_query_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr, in mlx4_query_qp() argument
977 ret = ibv_cmd_query_qp(ibqp, attr, attr_mask, init_attr, &cmd, sizeof cmd); in mlx4_query_qp()
985 attr->cap = init_attr->cap; in mlx4_query_qp()
990 int mlx4_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, in mlx4_modify_qp() argument
1001 ret = ibv_query_port(qp->context, attr->port_num, in mlx4_modify_qp()
1032 attr->qp_state == IBV_QPS_INIT) { in mlx4_modify_qp()
1036 ret = ibv_cmd_modify_qp(qp, attr, attr_mask, &cmd, sizeof cmd); in mlx4_modify_qp()
1040 attr->qp_state == IBV_QPS_RESET) { in mlx4_modify_qp()
1164 struct ibv_ah_attr *attr) in mlx4_resolve_grh_to_l2() argument
1170 if (link_local_gid(&attr->grh.dgid)) { in mlx4_resolve_grh_to_l2()
1171 memcpy(ah->mac, &attr->grh.dgid.raw[8], 3); in mlx4_resolve_grh_to_l2()
1172 memcpy(ah->mac + 3, &attr->grh.dgid.raw[13], 3); in mlx4_resolve_grh_to_l2()
1175 vid = get_vlan_id(&attr->grh.dgid); in mlx4_resolve_grh_to_l2()
1176 } else if (is_multicast_gid(&attr->grh.dgid)) { in mlx4_resolve_grh_to_l2()
1180 ah->mac[i] = attr->grh.dgid.raw[i + 10]; in mlx4_resolve_grh_to_l2()
1182 err = ibv_query_gid(pd->context, attr->port_num, in mlx4_resolve_grh_to_l2()
1183 attr->grh.sgid_index, &sgid); in mlx4_resolve_grh_to_l2()
1196 ah->vlan = vid | ((attr->sl & 7) << 13); in mlx4_resolve_grh_to_l2()
1202 struct ibv_ah *mlx4_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr) in mlx4_create_ah() argument
1207 if (query_port_cache(pd->context, attr->port_num, &port_attr)) in mlx4_create_ah()
1216 ah->av.port_pd = htobe32(to_mpd(pd)->pdn | (attr->port_num << 24)); in mlx4_create_ah()
1219 ah->av.g_slid = attr->src_path_bits; in mlx4_create_ah()
1220 ah->av.dlid = htobe16(attr->dlid); in mlx4_create_ah()
1221 ah->av.sl_tclass_flowlabel = htobe32(attr->sl << 28); in mlx4_create_ah()
1223 ah->av.sl_tclass_flowlabel = htobe32(attr->sl << 29); in mlx4_create_ah()
1225 if (attr->static_rate) { in mlx4_create_ah()
1226 ah->av.stat_rate = attr->static_rate + MLX4_STAT_RATE_OFFSET; in mlx4_create_ah()
1229 if (attr->is_global) { in mlx4_create_ah()
1231 ah->av.gid_index = attr->grh.sgid_index; in mlx4_create_ah()
1232 ah->av.hop_limit = attr->grh.hop_limit; in mlx4_create_ah()
1234 htobe32((attr->grh.traffic_class << 20) | in mlx4_create_ah()
1235 attr->grh.flow_label); in mlx4_create_ah()
1236 memcpy(ah->av.dgid, attr->grh.dgid.raw, 16); in mlx4_create_ah()
1243 if (ibv_resolve_eth_l2_from_gid(pd->context, attr, in mlx4_create_ah()
1252 ((attr->sl & 7) << 13); in mlx4_create_ah()
1256 if (mlx4_resolve_grh_to_l2(pd, ah, attr)) { in mlx4_create_ah()