[openib-general] [PATCH] add HW specific data to libibverbs modify QP, SRQ response

Ralph Campbell ralphc at pathscale.com
Thu Jun 15 15:34:58 PDT 2006


On Thu, 2006-06-15 at 14:56 -0700, Roland Dreier wrote:
>     Ralph> libmthca uses a single shared page which is created at
>     Ralph> driver open time.  I'm mmaping vmalloc memory created at
>     Ralph> ibv_create_cq(), qp, srq time so I need a way to return the
>     Ralph> offset to ipathverbs.so to then pass to mmap().
> 
> Hmm... it seems simpler to have userspace allocate the memory with
> mmap() before the resize_cq call, and then pass that new buffer into
> the resize_cq call.  That way you don't have a window where the kernel
> is putting completions into a buffer that userspace doesn't know about.

Perhaps. But this way, the code is the same for kernel and
user allocated queues.

>     Ralph> The new kernel drivers work with the old libibverbs and
>     Ralph> vice versa since only the cqe entry in struct
>     Ralph> ibv_resize_cq_resp is used.  The reserved entry is only
>     Ralph> needed to avoid using "packed" structs if struct
>     Ralph> ibv_resize_cq_resp is included in another struct.
> 
> OK, I guess we're OK, since the kernel isn't checking the size of the
> response buffer.  old libipathverbs does need to bail out on a new ipath
> kernel driver, though, or else you'll get corruption when responses go
> off the end of a buffer.

Or the new kernel driver needs to handle the old way and the new way.

>  - R.
-- 
Ralph Campbell <ralphc at pathscale.com>





More information about the general mailing list