Lines Matching defs:nes_ucontext
652 struct nes_ucontext *nes_ucontext;
676 nes_ucontext = kzalloc(sizeof *nes_ucontext, GFP_KERNEL);
677 if (!nes_ucontext)
680 nes_ucontext->nesdev = nesdev;
681 nes_ucontext->mmap_wq_offset = uresp.max_pds;
682 nes_ucontext->mmap_cq_offset = nes_ucontext->mmap_wq_offset +
688 kfree(nes_ucontext);
692 INIT_LIST_HEAD(&nes_ucontext->cq_reg_mem_list);
693 INIT_LIST_HEAD(&nes_ucontext->qp_reg_mem_list);
694 atomic_set(&nes_ucontext->usecnt, 1);
695 return &nes_ucontext->ibucontext;
706 struct nes_ucontext *nes_ucontext = to_nesucontext(context);
708 if (!atomic_dec_and_test(&nes_ucontext->usecnt))
710 kfree(nes_ucontext);
724 struct nes_ucontext *nes_ucontext;
727 nes_ucontext = to_nesucontext(context);
730 if (vma->vm_pgoff >= nes_ucontext->mmap_wq_offset) {
731 index = (vma->vm_pgoff - nes_ucontext->mmap_wq_offset) * PAGE_SIZE;
734 if (!test_bit(index, nes_ucontext->allocated_wqs)) {
738 nesqp = nes_ucontext->mmap_nesqp[index];
754 if (!test_bit(index, nes_ucontext->allocated_doorbells))
760 ((nes_ucontext->mmap_db_index[index] - nesdev->base_doorbell_index) * 4096))
763 vma->vm_private_data = nes_ucontext;
781 struct nes_ucontext *nesucontext;
843 struct nes_ucontext *nesucontext;
1119 struct nes_ucontext *nes_ucontext;
1201 nes_ucontext = to_nesucontext(ibpd->uobject->context);
1204 list_for_each_entry(nespbl, &nes_ucontext->qp_reg_mem_list, list) {
1222 nes_ucontext = to_nesucontext(ibpd->uobject->context);
1224 find_next_zero_bit(nes_ucontext->allocated_wqs,
1225 NES_MAX_USER_WQ_REGIONS, nes_ucontext->first_free_wq);
1240 set_bit(nesqp->mmap_sq_db_index, nes_ucontext->allocated_wqs);
1241 nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = nesqp;
1242 nes_ucontext->first_free_wq = nesqp->mmap_sq_db_index + 1;
1465 struct nes_ucontext *nes_ucontext;
1503 nes_ucontext = to_nesucontext(ibqp->uobject->context);
1504 clear_bit(nesqp->mmap_sq_db_index, nes_ucontext->allocated_wqs);
1505 nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = NULL;
1506 if (nes_ucontext->first_free_wq > nesqp->mmap_sq_db_index) {
1507 nes_ucontext->first_free_wq = nesqp->mmap_sq_db_index;
1540 struct nes_ucontext *nes_ucontext = NULL;
1576 nes_ucontext = to_nesucontext(context);
1582 nesvnic->mcrq_ucontext = nes_ucontext;
1583 nes_ucontext->mcrqf = req.mcrqf;
1584 if (nes_ucontext->mcrqf) {
1585 if (nes_ucontext->mcrqf & 0x80000000)
1586 nescq->hw_cq.cq_number = nesvnic->nic.qp_id + 28 + 2 * ((nes_ucontext->mcrqf & 0xf) - 1);
1587 else if (nes_ucontext->mcrqf & 0x40000000)
1588 nescq->hw_cq.cq_number = nes_ucontext->mcrqf & 0xffff;
1590 nescq->hw_cq.cq_number = nesvnic->mcrq_qp_id + nes_ucontext->mcrqf-1;
1591 nescq->mcrqf = nes_ucontext->mcrqf;
1597 list_for_each_entry(nespbl, &nes_ucontext->cq_reg_mem_list, list) {
1727 nes_ucontext->mmap_db_index[0]);
2314 struct nes_ucontext *nes_ucontext;
2583 nes_ucontext = to_nesucontext(pd->uobject->context);
2632 list_add_tail(&nespbl->list, &nes_ucontext->qp_reg_mem_list);
2634 list_add_tail(&nespbl->list, &nes_ucontext->cq_reg_mem_list);