Lines Matching refs:nes_ucontext

654 	struct nes_ucontext *nes_ucontext;  in nes_alloc_ucontext()  local
678 nes_ucontext = kzalloc(sizeof *nes_ucontext, GFP_KERNEL); in nes_alloc_ucontext()
679 if (!nes_ucontext) in nes_alloc_ucontext()
682 nes_ucontext->nesdev = nesdev; in nes_alloc_ucontext()
683 nes_ucontext->mmap_wq_offset = uresp.max_pds; in nes_alloc_ucontext()
684 nes_ucontext->mmap_cq_offset = nes_ucontext->mmap_wq_offset + in nes_alloc_ucontext()
690 kfree(nes_ucontext); in nes_alloc_ucontext()
694 INIT_LIST_HEAD(&nes_ucontext->cq_reg_mem_list); in nes_alloc_ucontext()
695 INIT_LIST_HEAD(&nes_ucontext->qp_reg_mem_list); in nes_alloc_ucontext()
696 atomic_set(&nes_ucontext->usecnt, 1); in nes_alloc_ucontext()
697 return &nes_ucontext->ibucontext; in nes_alloc_ucontext()
708 struct nes_ucontext *nes_ucontext = to_nesucontext(context); in nes_dealloc_ucontext() local
710 if (!atomic_dec_and_test(&nes_ucontext->usecnt)) in nes_dealloc_ucontext()
712 kfree(nes_ucontext); in nes_dealloc_ucontext()
726 struct nes_ucontext *nes_ucontext; in nes_mmap() local
729 nes_ucontext = to_nesucontext(context); in nes_mmap()
732 if (vma->vm_pgoff >= nes_ucontext->mmap_wq_offset) { in nes_mmap()
733 index = (vma->vm_pgoff - nes_ucontext->mmap_wq_offset) * PAGE_SIZE; in nes_mmap()
736 if (!test_bit(index, nes_ucontext->allocated_wqs)) { in nes_mmap()
740 nesqp = nes_ucontext->mmap_nesqp[index]; in nes_mmap()
756 if (!test_bit(index, nes_ucontext->allocated_doorbells)) in nes_mmap()
762 ((nes_ucontext->mmap_db_index[index] - nesdev->base_doorbell_index) * 4096)) in nes_mmap()
765 vma->vm_private_data = nes_ucontext; in nes_mmap()
783 struct nes_ucontext *nesucontext; in nes_alloc_pd()
845 struct nes_ucontext *nesucontext; in nes_dealloc_pd()
1121 struct nes_ucontext *nes_ucontext; in nes_create_qp() local
1203 nes_ucontext = to_nesucontext(ibpd->uobject->context); in nes_create_qp()
1206 list_for_each_entry(nespbl, &nes_ucontext->qp_reg_mem_list, list) { in nes_create_qp()
1224 nes_ucontext = to_nesucontext(ibpd->uobject->context); in nes_create_qp()
1226 find_next_zero_bit(nes_ucontext->allocated_wqs, in nes_create_qp()
1227 NES_MAX_USER_WQ_REGIONS, nes_ucontext->first_free_wq); in nes_create_qp()
1242 set_bit(nesqp->mmap_sq_db_index, nes_ucontext->allocated_wqs); in nes_create_qp()
1243 nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = nesqp; in nes_create_qp()
1244 nes_ucontext->first_free_wq = nesqp->mmap_sq_db_index + 1; in nes_create_qp()
1467 struct nes_ucontext *nes_ucontext; in nes_destroy_qp() local
1505 nes_ucontext = to_nesucontext(ibqp->uobject->context); in nes_destroy_qp()
1506 clear_bit(nesqp->mmap_sq_db_index, nes_ucontext->allocated_wqs); in nes_destroy_qp()
1507 nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = NULL; in nes_destroy_qp()
1508 if (nes_ucontext->first_free_wq > nesqp->mmap_sq_db_index) { in nes_destroy_qp()
1509 nes_ucontext->first_free_wq = nesqp->mmap_sq_db_index; in nes_destroy_qp()
1542 struct nes_ucontext *nes_ucontext = NULL; in nes_create_cq() local
1578 nes_ucontext = to_nesucontext(context); in nes_create_cq()
1584 nesvnic->mcrq_ucontext = nes_ucontext; in nes_create_cq()
1585 nes_ucontext->mcrqf = req.mcrqf; in nes_create_cq()
1586 if (nes_ucontext->mcrqf) { in nes_create_cq()
1587 if (nes_ucontext->mcrqf & 0x80000000) in nes_create_cq()
1588 nescq->hw_cq.cq_number = nesvnic->nic.qp_id + 28 + 2 * ((nes_ucontext->mcrqf & 0xf) - 1); in nes_create_cq()
1589 else if (nes_ucontext->mcrqf & 0x40000000) in nes_create_cq()
1590 nescq->hw_cq.cq_number = nes_ucontext->mcrqf & 0xffff; in nes_create_cq()
1592 nescq->hw_cq.cq_number = nesvnic->mcrq_qp_id + nes_ucontext->mcrqf-1; in nes_create_cq()
1593 nescq->mcrqf = nes_ucontext->mcrqf; in nes_create_cq()
1599 list_for_each_entry(nespbl, &nes_ucontext->cq_reg_mem_list, list) { in nes_create_cq()
1729 nes_ucontext->mmap_db_index[0]); in nes_create_cq()
2316 struct nes_ucontext *nes_ucontext; in nes_reg_user_mr() local
2585 nes_ucontext = to_nesucontext(pd->uobject->context); in nes_reg_user_mr()
2634 list_add_tail(&nespbl->list, &nes_ucontext->qp_reg_mem_list); in nes_reg_user_mr()
2636 list_add_tail(&nespbl->list, &nes_ucontext->cq_reg_mem_list); in nes_reg_user_mr()