Lines Matching refs:info

192 eibnx_find_mgroups(eibnx_thr_info_t *info)  in eibnx_find_mgroups()  argument
194 ibt_hca_portinfo_t *pi = info->ti_pi; in eibnx_find_mgroups()
200 mutex_enter(&info->ti_mcg_lock); in eibnx_find_mgroups()
202 if ((info->ti_mcg_status & ENX_MCGS_FOUND) == ENX_MCGS_FOUND) { in eibnx_find_mgroups()
203 mutex_exit(&info->ti_mcg_lock); in eibnx_find_mgroups()
221 if ((ret = ibt_query_mcg(rgid, &mcg_attr, 1, &info->ti_solicit_mcg, in eibnx_find_mgroups()
233 if (info->ti_solicit_mcg->mc_mtu > pi->p_mtu) { in eibnx_find_mgroups()
236 enx_solicit_mgid.gid_guid, info->ti_solicit_mcg->mc_mtu, in eibnx_find_mgroups()
240 if (info->ti_solicit_mcg->mc_qkey != EIB_FIP_QKEY) { in eibnx_find_mgroups()
243 enx_solicit_mgid.gid_guid, info->ti_solicit_mcg->mc_qkey, in eibnx_find_mgroups()
257 if ((ret = ibt_query_mcg(rgid, &mcg_attr, 1, &info->ti_advertise_mcg, in eibnx_find_mgroups()
269 if (info->ti_advertise_mcg->mc_mtu > pi->p_mtu) { in eibnx_find_mgroups()
273 info->ti_advertise_mcg->mc_mtu, pi->p_mtu); in eibnx_find_mgroups()
276 if (info->ti_advertise_mcg->mc_qkey != EIB_FIP_QKEY) { in eibnx_find_mgroups()
280 info->ti_advertise_mcg->mc_qkey, EIB_FIP_QKEY); in eibnx_find_mgroups()
284 info->ti_mcg_status |= ENX_MCGS_FOUND; in eibnx_find_mgroups()
285 mutex_exit(&info->ti_mcg_lock); in eibnx_find_mgroups()
290 if (info->ti_advertise_mcg) { in eibnx_find_mgroups()
291 ibt_free_mcg_info(info->ti_advertise_mcg, 1); in eibnx_find_mgroups()
292 info->ti_advertise_mcg = NULL; in eibnx_find_mgroups()
294 if (info->ti_solicit_mcg) { in eibnx_find_mgroups()
295 ibt_free_mcg_info(info->ti_solicit_mcg, 1); in eibnx_find_mgroups()
296 info->ti_solicit_mcg = NULL; in eibnx_find_mgroups()
298 mutex_exit(&info->ti_mcg_lock); in eibnx_find_mgroups()
307 eibnx_setup_cq(eibnx_thr_info_t *info) in eibnx_setup_cq() argument
317 ret = ibt_query_hca(info->ti_hca, &hca_attr); in eibnx_setup_cq()
320 info->ti_hca, ret); in eibnx_setup_cq()
332 ret = ibt_alloc_cq(info->ti_hca, &cq_attr, &info->ti_cq_hdl, &sz); in eibnx_setup_cq()
335 "failed, ret=%d", info->ti_hca, cq_attr.cq_size, ret); in eibnx_setup_cq()
342 info->ti_cq_sz = sz; in eibnx_setup_cq()
343 info->ti_wc = kmem_zalloc(sizeof (ibt_wc_t) * sz, KM_SLEEP); in eibnx_setup_cq()
352 eibnx_setup_ud_channel(eibnx_thr_info_t *info) in eibnx_setup_ud_channel() argument
371 alloc_attr.ud_hca_port_num = info->ti_pi->p_port_num; in eibnx_setup_ud_channel()
373 ret = ibt_pkey2index(info->ti_hca, info->ti_pi->p_port_num, in eibnx_setup_ud_channel()
378 info->ti_hca, info->ti_pi->p_port_num, in eibnx_setup_ud_channel()
390 alloc_attr.ud_scq = info->ti_cq_hdl; in eibnx_setup_ud_channel()
391 alloc_attr.ud_rcq = info->ti_cq_hdl; in eibnx_setup_ud_channel()
392 alloc_attr.ud_pd = info->ti_pd; in eibnx_setup_ud_channel()
394 ret = ibt_alloc_ud_channel(info->ti_hca, IBT_ACHAN_NO_FLAGS, in eibnx_setup_ud_channel()
395 &alloc_attr, &info->ti_chan, NULL); in eibnx_setup_ud_channel()
399 info->ti_hca, alloc_attr.ud_sizes.cs_sq, in eibnx_setup_ud_channel()
404 ret = ibt_query_ud_channel(info->ti_chan, &query_attr); in eibnx_setup_ud_channel()
407 "failed, ret=%d", info->ti_chan, ret); in eibnx_setup_ud_channel()
408 if ((ret = ibt_free_channel(info->ti_chan)) != IBT_SUCCESS) { in eibnx_setup_ud_channel()
410 "failed, ret=%d", info->ti_chan, ret); in eibnx_setup_ud_channel()
412 info->ti_chan = NULL; in eibnx_setup_ud_channel()
415 info->ti_qpn = query_attr.ud_qpn; in eibnx_setup_ud_channel()
426 eibnx_setup_txbufs(eibnx_thr_info_t *info) in eibnx_setup_txbufs() argument
428 eibnx_tx_t *snd_p = &info->ti_snd; in eibnx_setup_txbufs()
436 uint_t mtu = (128 << info->ti_pi->p_mtu); in eibnx_setup_txbufs()
453 if ((ret = ibt_register_mr(info->ti_hca, info->ti_pd, &attr, in eibnx_setup_txbufs()
473 ret = ibt_alloc_ud_dest(info->ti_hca, IBT_UD_DEST_NO_FLAGS, in eibnx_setup_txbufs()
474 info->ti_pd, &dest); in eibnx_setup_txbufs()
477 "failed, ret=%d", info->ti_hca, ret); in eibnx_setup_txbufs()
478 eibnx_rb_setup_txbufs(info); in eibnx_setup_txbufs()
514 eibnx_setup_rxbufs(eibnx_thr_info_t *info) in eibnx_setup_rxbufs() argument
516 eibnx_rx_t *rcv_p = &info->ti_rcv; in eibnx_setup_rxbufs()
523 uint_t mtu = (128 << info->ti_pi->p_mtu); in eibnx_setup_rxbufs()
537 if ((ret = ibt_register_mr(info->ti_hca, info->ti_pd, &attr, in eibnx_setup_rxbufs()
573 eibnx_setup_bufs(eibnx_thr_info_t *info) in eibnx_setup_bufs() argument
575 eibnx_rx_t *rcv_p = &info->ti_rcv; in eibnx_setup_bufs()
580 if (eibnx_setup_txbufs(info) != ENX_E_SUCCESS) in eibnx_setup_bufs()
583 if (eibnx_setup_rxbufs(info) != ENX_E_SUCCESS) { in eibnx_setup_bufs()
584 eibnx_rb_setup_txbufs(info); in eibnx_setup_bufs()
594 ret = ibt_post_recv(info->ti_chan, &(rwqe->qe_wr.recv), 1, in eibnx_setup_bufs()
601 "failed, ret=%d", info->ti_chan, ret); in eibnx_setup_bufs()
603 ret = ibt_flush_channel(info->ti_chan); in eibnx_setup_bufs()
607 info->ti_chan, ret); in eibnx_setup_bufs()
610 eibnx_rb_setup_rxbufs(info); in eibnx_setup_bufs()
611 eibnx_rb_setup_txbufs(info); in eibnx_setup_bufs()
624 eibnx_setup_cq_handler(eibnx_thr_info_t *info) in eibnx_setup_cq_handler() argument
636 rv = ddi_intr_add_softint(ss->nx_dip, &info->ti_softint_hdl, in eibnx_setup_cq_handler()
637 EIB_SOFTPRI_ADM, eibnx_comp_handler, info); in eibnx_setup_cq_handler()
643 ibt_set_cq_handler(info->ti_cq_hdl, eibnx_comp_intr, info); in eibnx_setup_cq_handler()
645 ret = ibt_enable_cq_notify(info->ti_cq_hdl, IBT_NEXT_COMPLETION); in eibnx_setup_cq_handler()
648 "failed, ret=%d", info->ti_cq_hdl, ret); in eibnx_setup_cq_handler()
649 if (info->ti_softint_hdl) { in eibnx_setup_cq_handler()
650 (void) ddi_intr_remove_softint(info->ti_softint_hdl); in eibnx_setup_cq_handler()
651 info->ti_softint_hdl = NULL; in eibnx_setup_cq_handler()
663 eibnx_join_solicit_mcg(eibnx_thr_info_t *info) in eibnx_join_solicit_mcg() argument
665 ib_gid_t rgid = info->ti_pi->p_sgid_tbl[0]; in eibnx_join_solicit_mcg()
676 mcg_attr.mc_flow = info->ti_solicit_mcg->mc_adds_vect.av_flow; in eibnx_join_solicit_mcg()
677 mcg_attr.mc_tclass = info->ti_solicit_mcg->mc_adds_vect.av_tclass; in eibnx_join_solicit_mcg()
678 mcg_attr.mc_sl = info->ti_solicit_mcg->mc_adds_vect.av_srvl; in eibnx_join_solicit_mcg()
698 if (info->ti_solicit_mcg) { in eibnx_join_solicit_mcg()
699 bcopy(&mcg_info, info->ti_solicit_mcg, in eibnx_join_solicit_mcg()
711 eibnx_join_advertise_mcg(eibnx_thr_info_t *info) in eibnx_join_advertise_mcg() argument
713 ib_gid_t rgid = info->ti_pi->p_sgid_tbl[0]; in eibnx_join_advertise_mcg()
718 if (info->ti_chan == NULL) in eibnx_join_advertise_mcg()
727 mcg_attr.mc_flow = info->ti_advertise_mcg->mc_adds_vect.av_flow; in eibnx_join_advertise_mcg()
728 mcg_attr.mc_tclass = info->ti_advertise_mcg->mc_adds_vect.av_tclass; in eibnx_join_advertise_mcg()
729 mcg_attr.mc_sl = info->ti_advertise_mcg->mc_adds_vect.av_srvl; in eibnx_join_advertise_mcg()
745 if (info->ti_advertise_mcg) { in eibnx_join_advertise_mcg()
746 bcopy(&mcg_info, info->ti_advertise_mcg, in eibnx_join_advertise_mcg()
754 ret = ibt_attach_mcg(info->ti_chan, info->ti_advertise_mcg); in eibnx_join_advertise_mcg()
757 "advt_mcg=0x%llx) failed, ret=%d", info->ti_chan, in eibnx_join_advertise_mcg()
758 info->ti_advertise_mcg, ret); in eibnx_join_advertise_mcg()
769 eibnx_join_mcgs(eibnx_thr_info_t *info) in eibnx_join_mcgs() argument
771 mutex_enter(&info->ti_mcg_lock); in eibnx_join_mcgs()
776 if ((info->ti_mcg_status & ENX_MCGS_FOUND) == 0) { in eibnx_join_mcgs()
777 mutex_exit(&info->ti_mcg_lock); in eibnx_join_mcgs()
784 if ((info->ti_mcg_status & ENX_MCGS_JOINED) == ENX_MCGS_JOINED) { in eibnx_join_mcgs()
785 mutex_exit(&info->ti_mcg_lock); in eibnx_join_mcgs()
792 if (eibnx_join_advertise_mcg(info) != ENX_E_SUCCESS) { in eibnx_join_mcgs()
793 mutex_exit(&info->ti_mcg_lock); in eibnx_join_mcgs()
796 if (eibnx_join_solicit_mcg(info) != ENX_E_SUCCESS) { in eibnx_join_mcgs()
797 eibnx_rb_join_advertise_mcg(info); in eibnx_join_mcgs()
798 mutex_exit(&info->ti_mcg_lock); in eibnx_join_mcgs()
802 info->ti_mcg_status |= ENX_MCGS_JOINED; in eibnx_join_mcgs()
803 mutex_exit(&info->ti_mcg_lock); in eibnx_join_mcgs()
809 eibnx_rejoin_mcgs(eibnx_thr_info_t *info) in eibnx_rejoin_mcgs() argument
814 eibnx_rb_join_mcgs(info); in eibnx_rejoin_mcgs()
815 eibnx_rb_find_mgroups(info); in eibnx_rejoin_mcgs()
817 if (eibnx_find_mgroups(info) != ENX_E_SUCCESS) in eibnx_rejoin_mcgs()
820 if (eibnx_join_mcgs(info) != ENX_E_SUCCESS) in eibnx_rejoin_mcgs()
912 eibnx_rb_find_mgroups(eibnx_thr_info_t *info) in eibnx_rb_find_mgroups() argument
914 mutex_enter(&info->ti_mcg_lock); in eibnx_rb_find_mgroups()
915 if ((info->ti_mcg_status & ENX_MCGS_FOUND) == ENX_MCGS_FOUND) { in eibnx_rb_find_mgroups()
916 if (info->ti_advertise_mcg) { in eibnx_rb_find_mgroups()
917 ibt_free_mcg_info(info->ti_advertise_mcg, 1); in eibnx_rb_find_mgroups()
918 info->ti_advertise_mcg = NULL; in eibnx_rb_find_mgroups()
920 if (info->ti_solicit_mcg) { in eibnx_rb_find_mgroups()
921 ibt_free_mcg_info(info->ti_solicit_mcg, 1); in eibnx_rb_find_mgroups()
922 info->ti_solicit_mcg = NULL; in eibnx_rb_find_mgroups()
924 info->ti_mcg_status &= (~ENX_MCGS_FOUND); in eibnx_rb_find_mgroups()
926 mutex_exit(&info->ti_mcg_lock); in eibnx_rb_find_mgroups()
930 eibnx_rb_setup_cq(eibnx_thr_info_t *info) in eibnx_rb_setup_cq() argument
934 if (info->ti_wc && info->ti_cq_sz) in eibnx_rb_setup_cq()
935 kmem_free(info->ti_wc, sizeof (ibt_wc_t) * info->ti_cq_sz); in eibnx_rb_setup_cq()
937 info->ti_cq_sz = 0; in eibnx_rb_setup_cq()
938 info->ti_wc = NULL; in eibnx_rb_setup_cq()
940 if (info->ti_cq_hdl) { in eibnx_rb_setup_cq()
941 ret = ibt_free_cq(info->ti_cq_hdl); in eibnx_rb_setup_cq()
944 "failed, ret=%d", info->ti_cq_hdl, ret); in eibnx_rb_setup_cq()
946 info->ti_cq_hdl = NULL; in eibnx_rb_setup_cq()
951 eibnx_rb_setup_ud_channel(eibnx_thr_info_t *info) in eibnx_rb_setup_ud_channel() argument
955 if ((ret = ibt_free_channel(info->ti_chan)) != IBT_SUCCESS) { in eibnx_rb_setup_ud_channel()
957 "failed, ret=%d", info->ti_chan, ret); in eibnx_rb_setup_ud_channel()
959 info->ti_chan = NULL; in eibnx_rb_setup_ud_channel()
960 info->ti_qpn = 0; in eibnx_rb_setup_ud_channel()
964 eibnx_rb_setup_txbufs(eibnx_thr_info_t *info) in eibnx_rb_setup_txbufs() argument
966 eibnx_tx_t *snd_p = &info->ti_snd; in eibnx_rb_setup_txbufs()
970 uint_t mtu = (128 << info->ti_pi->p_mtu); in eibnx_rb_setup_txbufs()
1004 if ((ret = ibt_deregister_mr(info->ti_hca, in eibnx_rb_setup_txbufs()
1007 "mr=0x%llx) failed, ret=%d", info->ti_hca, in eibnx_rb_setup_txbufs()
1025 eibnx_rb_setup_rxbufs(eibnx_thr_info_t *info) in eibnx_rb_setup_rxbufs() argument
1027 eibnx_rx_t *rcv_p = &info->ti_rcv; in eibnx_rb_setup_rxbufs()
1030 uint_t mtu = (128 << info->ti_pi->p_mtu); in eibnx_rb_setup_rxbufs()
1041 if ((ret = ibt_deregister_mr(info->ti_hca, in eibnx_rb_setup_rxbufs()
1044 "mr=0x%llx) failed, ret=%d", info->ti_hca, in eibnx_rb_setup_rxbufs()
1055 eibnx_rb_setup_bufs(eibnx_thr_info_t *info) in eibnx_rb_setup_bufs() argument
1059 if ((ret = ibt_flush_channel(info->ti_chan)) != IBT_SUCCESS) { in eibnx_rb_setup_bufs()
1061 "failed, ret=%d", info->ti_chan, ret); in eibnx_rb_setup_bufs()
1064 eibnx_rb_setup_rxbufs(info); in eibnx_rb_setup_bufs()
1066 eibnx_rb_setup_txbufs(info); in eibnx_rb_setup_bufs()
1070 eibnx_rb_setup_cq_handler(eibnx_thr_info_t *info) in eibnx_rb_setup_cq_handler() argument
1072 ibt_set_cq_handler(info->ti_cq_hdl, NULL, NULL); in eibnx_rb_setup_cq_handler()
1074 if (info->ti_softint_hdl) { in eibnx_rb_setup_cq_handler()
1075 (void) ddi_intr_remove_softint(info->ti_softint_hdl); in eibnx_rb_setup_cq_handler()
1076 info->ti_softint_hdl = NULL; in eibnx_rb_setup_cq_handler()
1081 eibnx_rb_join_solicit_mcg(eibnx_thr_info_t *info) in eibnx_rb_join_solicit_mcg() argument
1083 ib_gid_t rgid = info->ti_pi->p_sgid_tbl[0]; in eibnx_rb_join_solicit_mcg()
1100 eibnx_rb_join_advertise_mcg(eibnx_thr_info_t *info) in eibnx_rb_join_advertise_mcg() argument
1102 ib_gid_t rgid = info->ti_pi->p_sgid_tbl[0]; in eibnx_rb_join_advertise_mcg()
1106 ret = ibt_detach_mcg(info->ti_chan, info->ti_advertise_mcg); in eibnx_rb_join_advertise_mcg()
1110 info->ti_chan, info->ti_advertise_mcg, ret); in eibnx_rb_join_advertise_mcg()
1126 eibnx_rb_join_mcgs(eibnx_thr_info_t *info) in eibnx_rb_join_mcgs() argument
1128 mutex_enter(&info->ti_mcg_lock); in eibnx_rb_join_mcgs()
1129 if ((info->ti_mcg_status & ENX_MCGS_JOINED) == ENX_MCGS_JOINED) { in eibnx_rb_join_mcgs()
1130 eibnx_rb_join_solicit_mcg(info); in eibnx_rb_join_mcgs()
1131 eibnx_rb_join_advertise_mcg(info); in eibnx_rb_join_mcgs()
1133 info->ti_mcg_status &= (~ENX_MCGS_JOINED); in eibnx_rb_join_mcgs()
1135 mutex_exit(&info->ti_mcg_lock); in eibnx_rb_join_mcgs()