ehca: remove do_mmap()
PATCH 3/4 ehca: remove do_mmap()
This patch removes do_mmap() from ehca:
- Call remap_pfn_range() for hardware register block
- Use vm_insert_page() to register memory allocated for completion queues and queue pairs
- The actual mmap() call/trigger is now controlled by user space, ie. libehca
Thanks
Nam
Signed-off-by Hoang-Nam Nguyen <[email protected]>
---
ehca_classes.h | 15 +- ehca_cq.c | 65 ++------- ehca_iverbs.h | 8 - ehca_main.c | 6 ehca_qp.c | 78 ++--------- ehca_uverbs.c | 395 +++++++++++++++++++++++---------------------------------- 6 files changed, 204 insertions(+), 363 deletions(-)
drivers/infiniband/hw/ehca/ehca_classes.h +7 -8
@@ -119,13 +119,14 @@ struct ehca_qp {struct ipz_qp_handle ipz_qp_handle;struct ehca_pfqp pf;struct ib_qp_init_attr init_attr; -u64 uspace_squeue; -u64 uspace_rqueue; -u64 uspace_fwh;struct ehca_cq *send_cq;struct ehca_cq *recv_cq;unsigned int sqerr_purgeflag;struct hlist_node list_entries; +/* mmap counter for resources mapped into user space */ +u32 mm_count_squeue; +u32 mm_count_rqueue; +u32 mm_count_galpa; };/* must be power of 2 */
@@ -142,13 +143,14 @@ struct ehca_cq {struct ipz_cq_handle ipz_cq_handle;struct ehca_pfcq pf;spinlock_t cb_lock; -u64 uspace_queue; -u64 uspace_fwh;struct hlist_head qp_hashtab[QP_HASHTAB_LEN ];struct list_head entry;u32 nr_callbacks;spinlock_t task_lock;u32 ownpid; +/* mmap counter for resources mapped into user space */ +u32 mm_count_queue; +u32 mm_count_galpa; };enum ehca_mr_flag {
@@ -283,7 +285,6 @@ extern int ehca_port_act_time;extern int ehca_use_hp_mr;struct ipzu_queue_resp { -u64 queue;/* points to first queue entry */ u32 qe_size;/* queue entry size */ u32 act_nr_of_sg;u32 queue_length;/* queue length allocated in bytes */
@@ -296,7 +297,6 @@ struct ehca_create_cq_resp {u32 cq_number;u32 token;struct ipzu_queue_resp ipz_queue; -struct h_galpas galpas; };struct ehca_create_qp_resp {
@@ -309,7 +309,6 @@ struct ehca_create_qp_resp {u32 dummy;/* padding for 8 byte alignment */ struct ipzu_queue_resp ipz_squeue;struct ipzu_queue_resp ipz_rqueue; -struct h_galpas galpas; };struct ehca_alloc_cq_parms {
drivers/infiniband/hw/ehca/ehca_cq.c +16 -49
108 lines not on this page · raw message
drivers/infiniband/hw/ehca/ehca_iverbs.h +0 -8
@@ -171,14 +171,6 @@ int ehca_mmap(struct ib_ucontext *contexvoid ehca_poll_eqs (unsigned long data); -int ehca_mmap_nopage (u64 foffset,u64 length,void **mapped, -struct vm_area_struct **vma); - -int ehca_mmap_register (u64 physical,void **mapped, -struct vm_area_struct **vma); - -int ehca_munmap (unsigned long addr,size_t len); -#ifdef CONFIG_PPC_64K_PAGES void *ehca_alloc_fw_ctrlblock (gfp_t flags);void ehca_free_fw_ctrlblock (void *ptr);
drivers/infiniband/hw/ehca/ehca_main.c +3 -3
@@ -52,7 +52,7 @@MODULE_LICENSE ("Dual BSD/GPL" );MODULE_AUTHOR ("Christoph Raisch <[email protected]>" );MODULE_DESCRIPTION ("IBM eServer HCA InfiniBand Device Driver" ); -MODULE_VERSION ("SVNEHCA_0019" ); +MODULE_VERSION ("SVNEHCA_0020" );int ehca_open_aqp1 =0 ;int ehca_debug_level =0 ;
@@ -288,7 +288,7 @@ int ehca_init_device(struct ehca_shca *sstrlcpy (shca->ib_device.name,"ehca%d" ,IB_DEVICE_NAME_MAX ); shca->ib_device.owner =THIS_MODULE ; - shca->ib_device.uverbs_abi_ver =5 ; + shca->ib_device.uverbs_abi_ver =6 ; shca->ib_device.uverbs_cmd_mask = (1ull <<IB_USER_VERBS_CMD_GET_CONTEXT ) | (1ull << IB_USER_VERBS_CMD_QUERY_DEVICE) |
@@ -790,7 +790,7 @@ int __init ehca_module_init(void)int ret;printk (KERN_INFO "eHCA Infiniband Device Driver " -"(Rel.: SVNEHCA_0019)\n" ); +"(Rel.: SVNEHCA_0020)\n" );idr_init (&ehca_qp_idr);idr_init (&ehca_cq_idr);spin_lock_init (&ehca_qp_idr_lock);
drivers/infiniband/hw/ehca/ehca_qp.c +14 -64
122 lines not on this page · raw message
drivers/infiniband/hw/ehca/ehca_uverbs.c +164 -231
447 lines not on this page · raw message