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

Roland Dreier rdreier at cisco.com
Thu Jun 15 14:56:48 PDT 2006


    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.

    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.

 - R.




More information about the general mailing list