[ofa-general] Re: [PATCH] libmlx4: WQE shift calculation

Eli Cohen eli at dev.mellanox.co.il
Tue May 15 14:05:44 PDT 2007


On 5/15/07, Roland Dreier <rdreier at cisco.com> wrote:
>
> > First I should add the case that triggered his patch: the userspace code
> > calculated a smaller buffer size than the kernel code, which caused
> > get_user_pages() to fail since part of the buffer did not belong to the
> > process's address space.
>
> OK, in this case it seems the bug is in the kernel -- since it is
> overestimating the size of the WQEs needed.  So we might as well fix
> it in the kernel.
>
> > As Mihcael said in a subsequent post, we still need this code both in
> > user and in kernel.
>
> Yes, but I think this issue really convinces me that we should
> decouple the two calculations, so the kernel code is only used for
> kernel QPs.  And then change the mlx4 ABI so that userspace tells the
> kernel the wqe buffer size and rq/sq wqe shift/offset.  That will
> allow for different SQ BB sizes and also make things more robust
> against bugs like this.
>
> - R.


So it looks like we can start by:
1. Change the user code to pass the size to kernel
2. Fix calculations in kernel.

Would like me to send patches or do you prefer to add your code? If you
prefer to code this can you tell when that would be?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20070516/25ceb843/attachment.html>


More information about the general mailing list