Re: [PATCH/RFC 2.6.21 2/5] ehca: ehca_uverbs.c: "proper" use of mmap

2007-01-12 Thread Christoph Raisch
Roland Dreier wrote on 11.01.2007 20:54:58: > > > int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) > > > { > > > > Can you split this monster routine into individual functions for > > each type of mmap please? With two helpers to get and verify the cq/qp > > shared

Re: [PATCH/RFC 2.6.21 2/5] ehca: ehca_uverbs.c: "proper" use of mmap

2007-01-11 Thread Roland Dreier
> > int ehca_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) > > { > > Can you split this monster routine into individual functions for > each type of mmap please? With two helpers to get and verify the cq/qp > shared by the individual sub-variants, that would also help to g

Re: [PATCH/RFC 2.6.21 2/5] ehca: ehca_uverbs.c: "proper" use of mmap

2007-01-11 Thread Christoph Hellwig
On Thu, Jan 11, 2007 at 08:08:15PM +0100, Hoang-Nam Nguyen wrote: > +static void mm_open(struct vm_area_struct *vma) This should be name ehca_vma_open, dito for mm_close/ehca_vma_close and vm_ops/ehca_vm_ops. > + u32 *count = (u32*)vma->vm_private_data; No need for the cast here (both in the

[PATCH/RFC 2.6.21 2/5] ehca: ehca_uverbs.c: "proper" use of mmap

2007-01-11 Thread Hoang-Nam Nguyen
Hello Roland and Christoph H.! This is a patch for ehca_uverbs.c. It implements ehca-specific mmap in the following way (as recommended by Christoph H.): - Call remap_pfn_range() for hardware register block - Use vm_insert_page() to register memory allocated for completion queues and queue pairs -