Lines Matching refs:bind

63     hermon_bind_info_t *bind, hermon_mrhdl_t *mrhdl, hermon_mr_options_t *op,
66 hermon_pdhdl_t pd, hermon_bind_info_t *bind, hermon_mrhdl_t *mrhdl_new,
69 hermon_bind_info_t *bind, hermon_mr_options_t *op, uint64_t *mtt_addr,
72 hermon_bind_info_t *bind, uint_t *mtt_pgsize);
73 static int hermon_mr_mem_bind(hermon_state_t *state, hermon_bind_info_t *bind,
76 hermon_bind_info_t *bind);
78 hermon_bind_info_t *bind, uint32_t mtt_pgsize_bits);
107 hermon_bind_info_t bind; in hermon_mr_register() local
118 bind.bi_type = HERMON_BINDHDL_VADDR; in hermon_mr_register()
119 bind.bi_addr = mr_attr->mr_vaddr; in hermon_mr_register()
120 bind.bi_len = mr_attr->mr_len; in hermon_mr_register()
121 bind.bi_as = mr_attr->mr_as; in hermon_mr_register()
122 bind.bi_flags = mr_attr->mr_flags; in hermon_mr_register()
123 status = hermon_mr_common_reg(state, pd, &bind, mrhdl, op, in hermon_mr_register()
138 hermon_bind_info_t bind; in hermon_mr_register_buf() local
153 bind.bi_type = HERMON_BINDHDL_BUF; in hermon_mr_register_buf()
154 bind.bi_buf = buf; in hermon_mr_register_buf()
156 bind.bi_addr = mr_attr->mr_vaddr; in hermon_mr_register_buf()
158 bind.bi_addr = (uint64_t)(uintptr_t)buf->b_un.b_addr; in hermon_mr_register_buf()
160 bind.bi_as = NULL; in hermon_mr_register_buf()
161 bind.bi_len = (uint64_t)buf->b_bcount; in hermon_mr_register_buf()
162 bind.bi_flags = mr_attr->mr_flags; in hermon_mr_register_buf()
163 status = hermon_mr_common_reg(state, pd, &bind, mrhdl, op, mpt_type); in hermon_mr_register_buf()
180 hermon_bind_info_t *bind; in hermon_mr_register_shared() local
322 bind = &mr->mr_bindinfo; in hermon_mr_register_shared()
323 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_register_shared()
339 bind->bi_addr = ((mr_attr->mr_vaddr & ~pgsize_msk) | in hermon_mr_register_shared()
359 mpt_entry.start_addr = bind->bi_addr; in hermon_mr_register_shared()
360 mpt_entry.reg_win_len = bind->bi_len; in hermon_mr_register_shared()
449 hermon_bind_info_t bind; in hermon_mr_alloc_fmr() local
536 bind.bi_addr = 0; in hermon_mr_alloc_fmr()
538 bind.bi_len = fmr_pool->fmr_max_pages << PAGESHIFT; in hermon_mr_alloc_fmr()
539 nummtt = hermon_mr_nummtt_needed(state, &bind, &mtt_pgsize_bits); in hermon_mr_alloc_fmr()
620 (void) memcpy(&mr->mr_bindinfo, &bind, sizeof (hermon_bind_info_t)); in hermon_mr_alloc_fmr()
752 hermon_bind_info_t *bind; in hermon_mr_deregister() local
781 bind = &mr->mr_bindinfo; in hermon_mr_deregister()
899 hermon_mr_mem_unbind(state, bind); in hermon_mr_deregister()
1080 hermon_bind_info_t bind; in hermon_mr_reregister() local
1091 bind.bi_type = HERMON_BINDHDL_VADDR; in hermon_mr_reregister()
1092 bind.bi_addr = mr_attr->mr_vaddr; in hermon_mr_reregister()
1093 bind.bi_len = mr_attr->mr_len; in hermon_mr_reregister()
1094 bind.bi_as = mr_attr->mr_as; in hermon_mr_reregister()
1095 bind.bi_flags = mr_attr->mr_flags; in hermon_mr_reregister()
1096 status = hermon_mr_common_rereg(state, mr, pd, &bind, mrhdl_new, op); in hermon_mr_reregister()
1110 hermon_bind_info_t bind; in hermon_mr_reregister_buf() local
1125 bind.bi_type = HERMON_BINDHDL_BUF; in hermon_mr_reregister_buf()
1126 bind.bi_buf = buf; in hermon_mr_reregister_buf()
1128 bind.bi_addr = mr_attr->mr_vaddr; in hermon_mr_reregister_buf()
1130 bind.bi_addr = (uint64_t)(uintptr_t)buf->b_un.b_addr; in hermon_mr_reregister_buf()
1132 bind.bi_len = (uint64_t)buf->b_bcount; in hermon_mr_reregister_buf()
1133 bind.bi_flags = mr_attr->mr_flags; in hermon_mr_reregister_buf()
1134 bind.bi_as = NULL; in hermon_mr_reregister_buf()
1135 status = hermon_mr_common_rereg(state, mr, pd, &bind, mrhdl_new, op); in hermon_mr_reregister_buf()
1469 hermon_bind_info_t *bind, hermon_mrhdl_t *mrhdl, hermon_mr_options_t *op, in hermon_mr_common_reg() argument
1508 flags = bind->bi_flags; in hermon_mr_common_reg()
1516 if ((bind->bi_len == 0) || (bind->bi_len > max_sz)) { in hermon_mr_common_reg()
1605 mr_is_umem = (((bind->bi_as != NULL) && (bind->bi_as != &kas)) ? 1 : 0); in hermon_mr_common_reg()
1607 umem_len = ptob(btopr(bind->bi_len + in hermon_mr_common_reg()
1608 ((uintptr_t)bind->bi_addr & PAGEOFFSET))); in hermon_mr_common_reg()
1609 umem_addr = (caddr_t)((uintptr_t)bind->bi_addr & ~PAGEOFFSET); in hermon_mr_common_reg()
1619 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_common_reg()
1620 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind->bi_buf)) in hermon_mr_common_reg()
1622 bind->bi_buf = ddi_umem_iosetup(umem_cookie, 0, umem_len, in hermon_mr_common_reg()
1624 if (bind->bi_buf == NULL) { in hermon_mr_common_reg()
1628 bind->bi_type = HERMON_BINDHDL_UBUF; in hermon_mr_common_reg()
1629 bind->bi_buf->b_flags |= B_READ; in hermon_mr_common_reg()
1631 _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*bind->bi_buf)) in hermon_mr_common_reg()
1632 _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_common_reg()
1648 bcopy(bind, bh, sizeof (hermon_bind_info_t)); in hermon_mr_common_reg()
1657 bind->bi_type = bh->bi_type; in hermon_mr_common_reg()
1795 bind->bi_type = bh->bi_type; in hermon_mr_common_reg()
1806 if (bind->bi_type == HERMON_BINDHDL_UBUF) { in hermon_mr_common_reg()
1807 freerbuf(bind->bi_buf); in hermon_mr_common_reg()
1808 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_common_reg()
1809 bind->bi_type = HERMON_BINDHDL_NONE; in hermon_mr_common_reg()
1810 _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_common_reg()
2266 hermon_mr_mtt_bind(hermon_state_t *state, hermon_bind_info_t *bind, in hermon_mr_mtt_bind() argument
2279 sleep = (bind->bi_flags & IBT_MR_NOSLEEP) ? in hermon_mr_mtt_bind()
2298 status = hermon_mr_mem_bind(state, bind, bind_dmahdl, sleep, is_buffer); in hermon_mr_mtt_bind()
2310 nummtt = hermon_mr_nummtt_needed(state, bind, mtt_pgsize_bits); in hermon_mr_mtt_bind()
2330 status = hermon_mr_fast_mtt_write(state, *mtt, bind, *mtt_pgsize_bits); in hermon_mr_mtt_bind()
2348 hermon_mr_mem_unbind(state, bind); in hermon_mr_mtt_bind()
2359 hermon_mr_mtt_unbind(hermon_state_t *state, hermon_bind_info_t *bind, in hermon_mr_mtt_unbind() argument
2366 hermon_mr_mem_unbind(state, bind); in hermon_mr_mtt_unbind()
2379 hermon_pdhdl_t pd, hermon_bind_info_t *bind, hermon_mrhdl_t *mrhdl_new, in hermon_mr_common_rereg() argument
2391 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_common_rereg()
2409 flags = bind->bi_flags; in hermon_mr_common_rereg()
2561 status = hermon_mr_rereg_xlat_helper(state, mr, bind, op, in hermon_mr_common_rereg()
2697 hermon_bind_info_t *bind, hermon_mr_options_t *op, uint64_t *mtt_addr, in hermon_mr_rereg_xlat_helper() argument
2727 if ((bind->bi_len == 0) || (bind->bi_len > max_sz)) { in hermon_mr_rereg_xlat_helper()
2745 nummtt_needed = hermon_mr_nummtt_needed(state, bind, &mtt_pgsize_bits); in hermon_mr_rereg_xlat_helper()
2780 if (HERMON_MR_REUSE_DMAHDL(mr, bind->bi_flags)) { in hermon_mr_rereg_xlat_helper()
2801 bind->bi_bypass = bind_type; in hermon_mr_rereg_xlat_helper()
2802 status = hermon_mr_mem_bind(state, bind, dmahdl, sleep, 1); in hermon_mr_rereg_xlat_helper()
2823 bind->bi_free_dmahdl = 1; in hermon_mr_rereg_xlat_helper()
2831 status = hermon_mr_fast_mtt_write(state, mtt, bind, in hermon_mr_rereg_xlat_helper()
2846 hermon_mr_mem_unbind(state, bind); in hermon_mr_rereg_xlat_helper()
2859 mr->mr_bindinfo = *bind; in hermon_mr_rereg_xlat_helper()
2880 if (HERMON_MR_REUSE_DMAHDL(mr, bind->bi_flags)) { in hermon_mr_rereg_xlat_helper()
2905 bind->bi_bypass = bind_type; in hermon_mr_rereg_xlat_helper()
2906 status = hermon_mr_mem_bind(state, bind, dmahdl, sleep, 1); in hermon_mr_rereg_xlat_helper()
2927 bind->bi_free_dmahdl = 1; in hermon_mr_rereg_xlat_helper()
2948 hermon_mr_mem_unbind(state, bind); in hermon_mr_rereg_xlat_helper()
2983 hermon_mr_mem_unbind(state, bind); in hermon_mr_rereg_xlat_helper()
3002 status = hermon_mr_fast_mtt_write(state, mtt, bind, in hermon_mr_rereg_xlat_helper()
3022 hermon_mr_mem_unbind(state, bind); in hermon_mr_rereg_xlat_helper()
3045 mr->mr_bindinfo = *bind; in hermon_mr_rereg_xlat_helper()
3071 hermon_mr_nummtt_needed(hermon_state_t *state, hermon_bind_info_t *bind, in hermon_mr_nummtt_needed() argument
3085 pg_offset = bind->bi_addr & pg_offset_mask; in hermon_mr_nummtt_needed()
3086 tmp_length = pg_offset + (bind->bi_len - 1); in hermon_mr_nummtt_needed()
3096 hermon_mr_mem_bind(hermon_state_t *state, hermon_bind_info_t *bind, in hermon_mr_mem_bind() argument
3104 ASSERT(bind->bi_type == HERMON_BINDHDL_VADDR || in hermon_mr_mem_bind()
3105 bind->bi_type == HERMON_BINDHDL_BUF || in hermon_mr_mem_bind()
3106 bind->bi_type == HERMON_BINDHDL_UBUF); in hermon_mr_mem_bind()
3108 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_mem_bind()
3120 if (bind->bi_bypass == HERMON_BINDMEM_BYPASS) { in hermon_mr_mem_bind()
3127 if (! (bind->bi_flags & IBT_MR_DISABLE_RO)) { in hermon_mr_mem_bind()
3128 if ((bind->bi_type != HERMON_BINDHDL_UBUF) && in hermon_mr_mem_bind()
3134 if (((bind->bi_type == HERMON_BINDHDL_UBUF) && in hermon_mr_mem_bind()
3145 callback, NULL, &bind->bi_dmahdl); in hermon_mr_mem_bind()
3149 bind->bi_free_dmahdl = 1; in hermon_mr_mem_bind()
3152 bind->bi_dmahdl = dmahdl; in hermon_mr_mem_bind()
3153 bind->bi_free_dmahdl = 0; in hermon_mr_mem_bind()
3163 if (bind->bi_type == HERMON_BINDHDL_VADDR) { in hermon_mr_mem_bind()
3164 status = ddi_dma_addr_bind_handle(bind->bi_dmahdl, NULL, in hermon_mr_mem_bind()
3165 (caddr_t)(uintptr_t)bind->bi_addr, bind->bi_len, in hermon_mr_mem_bind()
3167 &bind->bi_dmacookie, &bind->bi_cookiecnt); in hermon_mr_mem_bind()
3171 status = ddi_dma_buf_bind_handle(bind->bi_dmahdl, in hermon_mr_mem_bind()
3172 bind->bi_buf, (DDI_DMA_RDWR | DDI_DMA_CONSISTENT), callback, in hermon_mr_mem_bind()
3173 NULL, &bind->bi_dmacookie, &bind->bi_cookiecnt); in hermon_mr_mem_bind()
3176 if (bind->bi_free_dmahdl != 0) { in hermon_mr_mem_bind()
3177 ddi_dma_free_handle(&bind->bi_dmahdl); in hermon_mr_mem_bind()
3191 hermon_mr_mem_unbind(hermon_state_t *state, hermon_bind_info_t *bind) in hermon_mr_mem_unbind() argument
3195 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_mem_unbind()
3197 if (bind->bi_type == HERMON_BINDHDL_LKEY) in hermon_mr_mem_unbind()
3206 _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_mem_unbind()
3207 if (bind->bi_type == HERMON_BINDHDL_UBUF) { in hermon_mr_mem_unbind()
3208 freerbuf(bind->bi_buf); in hermon_mr_mem_unbind()
3209 bind->bi_type = HERMON_BINDHDL_NONE; in hermon_mr_mem_unbind()
3211 _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*bind)) in hermon_mr_mem_unbind()
3222 status = ddi_dma_unbind_handle(bind->bi_dmahdl); in hermon_mr_mem_unbind()
3229 if (bind->bi_free_dmahdl != 0) { in hermon_mr_mem_unbind()
3230 ddi_dma_free_handle(&bind->bi_dmahdl); in hermon_mr_mem_unbind()
3241 hermon_bind_info_t *bind, uint32_t mtt_pgsize_bits) in hermon_mr_fast_mtt_write() argument
3271 dmacookie = bind->bi_dmacookie; in hermon_mr_fast_mtt_write()
3272 cookie_cnt = bind->bi_cookiecnt; in hermon_mr_fast_mtt_write()
3342 ddi_dma_nextcookie(bind->bi_dmahdl, &dmacookie); in hermon_mr_fast_mtt_write()