[ofa-general] Re: [PATCH] libmlx4: WQE shift calculation
Roland Dreier
rdreier at cisco.com
Tue May 15 08:58:19 PDT 2007
> 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.
More information about the general
mailing list