db_tab 352 drivers/infiniband/hw/mthca/mthca_dev.h struct mthca_db_table *db_tab; db_tab 447 drivers/infiniband/hw/mthca/mthca_memfree.c struct mthca_user_db_table *db_tab, int index, u64 uaddr) db_tab 459 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_lock(&db_tab->mutex); db_tab 463 drivers/infiniband/hw/mthca/mthca_memfree.c if ((db_tab->page[i].refcount >= MTHCA_DB_REC_PER_PAGE) || db_tab 464 drivers/infiniband/hw/mthca/mthca_memfree.c (db_tab->page[i].uvirt && db_tab->page[i].uvirt != uaddr) || db_tab 470 drivers/infiniband/hw/mthca/mthca_memfree.c if (db_tab->page[i].refcount) { db_tab 471 drivers/infiniband/hw/mthca/mthca_memfree.c ++db_tab->page[i].refcount; db_tab 480 drivers/infiniband/hw/mthca/mthca_memfree.c sg_set_page(&db_tab->page[i].mem, pages[0], MTHCA_ICM_PAGE_SIZE, db_tab 483 drivers/infiniband/hw/mthca/mthca_memfree.c ret = pci_map_sg(dev->pdev, &db_tab->page[i].mem, 1, PCI_DMA_TODEVICE); db_tab 489 drivers/infiniband/hw/mthca/mthca_memfree.c ret = mthca_MAP_ICM_page(dev, sg_dma_address(&db_tab->page[i].mem), db_tab 492 drivers/infiniband/hw/mthca/mthca_memfree.c pci_unmap_sg(dev->pdev, &db_tab->page[i].mem, 1, PCI_DMA_TODEVICE); db_tab 493 drivers/infiniband/hw/mthca/mthca_memfree.c put_user_page(sg_page(&db_tab->page[i].mem)); db_tab 497 drivers/infiniband/hw/mthca/mthca_memfree.c db_tab->page[i].uvirt = uaddr; db_tab 498 drivers/infiniband/hw/mthca/mthca_memfree.c db_tab->page[i].refcount = 1; db_tab 501 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_unlock(&db_tab->mutex); db_tab 506 drivers/infiniband/hw/mthca/mthca_memfree.c struct mthca_user_db_table *db_tab, int index) db_tab 516 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_lock(&db_tab->mutex); db_tab 518 drivers/infiniband/hw/mthca/mthca_memfree.c --db_tab->page[index / MTHCA_DB_REC_PER_PAGE].refcount; db_tab 520 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_unlock(&db_tab->mutex); db_tab 525 drivers/infiniband/hw/mthca/mthca_memfree.c struct mthca_user_db_table *db_tab; db_tab 533 drivers/infiniband/hw/mthca/mthca_memfree.c db_tab = kmalloc(struct_size(db_tab, page, npages), GFP_KERNEL); db_tab 534 drivers/infiniband/hw/mthca/mthca_memfree.c if (!db_tab) db_tab 537 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_init(&db_tab->mutex); db_tab 539 drivers/infiniband/hw/mthca/mthca_memfree.c db_tab->page[i].refcount = 0; db_tab 540 drivers/infiniband/hw/mthca/mthca_memfree.c db_tab->page[i].uvirt = 0; db_tab 541 drivers/infiniband/hw/mthca/mthca_memfree.c sg_init_table(&db_tab->page[i].mem, 1); db_tab 544 drivers/infiniband/hw/mthca/mthca_memfree.c return db_tab; db_tab 548 drivers/infiniband/hw/mthca/mthca_memfree.c struct mthca_user_db_table *db_tab) db_tab 556 drivers/infiniband/hw/mthca/mthca_memfree.c if (db_tab->page[i].uvirt) { db_tab 558 drivers/infiniband/hw/mthca/mthca_memfree.c pci_unmap_sg(dev->pdev, &db_tab->page[i].mem, 1, PCI_DMA_TODEVICE); db_tab 559 drivers/infiniband/hw/mthca/mthca_memfree.c put_user_page(sg_page(&db_tab->page[i].mem)); db_tab 563 drivers/infiniband/hw/mthca/mthca_memfree.c kfree(db_tab); db_tab 575 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_lock(&dev->db_tab->mutex); db_tab 582 drivers/infiniband/hw/mthca/mthca_memfree.c end = dev->db_tab->max_group1; db_tab 590 drivers/infiniband/hw/mthca/mthca_memfree.c start = dev->db_tab->npages - 1; db_tab 591 drivers/infiniband/hw/mthca/mthca_memfree.c end = dev->db_tab->min_group2; db_tab 601 drivers/infiniband/hw/mthca/mthca_memfree.c if (dev->db_tab->page[i].db_rec && db_tab 602 drivers/infiniband/hw/mthca/mthca_memfree.c !bitmap_full(dev->db_tab->page[i].used, db_tab 604 drivers/infiniband/hw/mthca/mthca_memfree.c page = dev->db_tab->page + i; db_tab 609 drivers/infiniband/hw/mthca/mthca_memfree.c if (!dev->db_tab->page[i].db_rec) { db_tab 610 drivers/infiniband/hw/mthca/mthca_memfree.c page = dev->db_tab->page + i; db_tab 614 drivers/infiniband/hw/mthca/mthca_memfree.c if (dev->db_tab->max_group1 >= dev->db_tab->min_group2 - 1) { db_tab 620 drivers/infiniband/hw/mthca/mthca_memfree.c ++dev->db_tab->max_group1; db_tab 622 drivers/infiniband/hw/mthca/mthca_memfree.c --dev->db_tab->min_group2; db_tab 624 drivers/infiniband/hw/mthca/mthca_memfree.c page = dev->db_tab->page + end; db_tab 659 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_unlock(&dev->db_tab->mutex); db_tab 672 drivers/infiniband/hw/mthca/mthca_memfree.c page = dev->db_tab->page + i; db_tab 674 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_lock(&dev->db_tab->mutex); db_tab 677 drivers/infiniband/hw/mthca/mthca_memfree.c if (i >= dev->db_tab->min_group2) db_tab 682 drivers/infiniband/hw/mthca/mthca_memfree.c i >= dev->db_tab->max_group1 - 1) { db_tab 689 drivers/infiniband/hw/mthca/mthca_memfree.c if (i == dev->db_tab->max_group1) { db_tab 690 drivers/infiniband/hw/mthca/mthca_memfree.c --dev->db_tab->max_group1; db_tab 693 drivers/infiniband/hw/mthca/mthca_memfree.c if (i == dev->db_tab->min_group2) db_tab 694 drivers/infiniband/hw/mthca/mthca_memfree.c ++dev->db_tab->min_group2; db_tab 697 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_unlock(&dev->db_tab->mutex); db_tab 707 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab = kmalloc(sizeof *dev->db_tab, GFP_KERNEL); db_tab 708 drivers/infiniband/hw/mthca/mthca_memfree.c if (!dev->db_tab) db_tab 711 drivers/infiniband/hw/mthca/mthca_memfree.c mutex_init(&dev->db_tab->mutex); db_tab 713 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->npages = dev->uar_table.uarc_size / MTHCA_ICM_PAGE_SIZE; db_tab 714 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->max_group1 = 0; db_tab 715 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->min_group2 = dev->db_tab->npages - 1; db_tab 717 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->page = kmalloc_array(dev->db_tab->npages, db_tab 718 drivers/infiniband/hw/mthca/mthca_memfree.c sizeof(*dev->db_tab->page), db_tab 720 drivers/infiniband/hw/mthca/mthca_memfree.c if (!dev->db_tab->page) { db_tab 721 drivers/infiniband/hw/mthca/mthca_memfree.c kfree(dev->db_tab); db_tab 725 drivers/infiniband/hw/mthca/mthca_memfree.c for (i = 0; i < dev->db_tab->npages; ++i) db_tab 726 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->page[i].db_rec = NULL; db_tab 744 drivers/infiniband/hw/mthca/mthca_memfree.c for (i = 0; i < dev->db_tab->npages; ++i) { db_tab 745 drivers/infiniband/hw/mthca/mthca_memfree.c if (!dev->db_tab->page[i].db_rec) db_tab 748 drivers/infiniband/hw/mthca/mthca_memfree.c if (!bitmap_empty(dev->db_tab->page[i].used, MTHCA_DB_REC_PER_PAGE)) db_tab 754 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->page[i].db_rec, db_tab 755 drivers/infiniband/hw/mthca/mthca_memfree.c dev->db_tab->page[i].mapping); db_tab 758 drivers/infiniband/hw/mthca/mthca_memfree.c kfree(dev->db_tab->page); db_tab 759 drivers/infiniband/hw/mthca/mthca_memfree.c kfree(dev->db_tab); db_tab 166 drivers/infiniband/hw/mthca/mthca_memfree.h struct mthca_user_db_table *db_tab, int index, u64 uaddr); db_tab 168 drivers/infiniband/hw/mthca/mthca_memfree.h struct mthca_user_db_table *db_tab, int index); db_tab 171 drivers/infiniband/hw/mthca/mthca_memfree.h struct mthca_user_db_table *db_tab); db_tab 325 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab = mthca_init_user_db_tab(to_mdev(ibdev)); db_tab 326 drivers/infiniband/hw/mthca/mthca_provider.c if (IS_ERR(context->db_tab)) { db_tab 327 drivers/infiniband/hw/mthca/mthca_provider.c err = PTR_ERR(context->db_tab); db_tab 333 drivers/infiniband/hw/mthca/mthca_provider.c mthca_cleanup_user_db_tab(to_mdev(ibdev), &context->uar, context->db_tab); db_tab 346 drivers/infiniband/hw/mthca/mthca_provider.c to_mucontext(context)->db_tab); db_tab 424 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, ucmd.db_index, db_tab 439 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, ucmd.db_index); db_tab 462 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, to_msrq(srq)->db_index); db_tab 497 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 505 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 510 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 530 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 534 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 592 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 596 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 628 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, ucmd.set_db_index, db_tab 634 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, ucmd.arm_db_index, db_tab 670 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, ucmd.arm_db_index); db_tab 675 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, ucmd.set_db_index); db_tab 812 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 816 drivers/infiniband/hw/mthca/mthca_provider.c context->db_tab, db_tab 67 drivers/infiniband/hw/mthca/mthca_provider.h struct mthca_user_db_table *db_tab;