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