<br><br>
<div><span class="gmail_quote">On 5/15/07, <b class="gmail_sendername">Roland Dreier</b> <<a href="mailto:rdreier@cisco.com">rdreier@cisco.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">> First I should add the case that triggered his patch: the userspace code<br>> calculated a smaller buffer size than the kernel code, which caused
<br>> get_user_pages() to fail since part of the buffer did not belong to the<br>> process's address space.<br><br>OK, in this case it seems the bug is in the kernel -- since it is<br>overestimating the size of the WQEs needed. So we might as well fix
<br>it in the kernel.<br><br>> As Mihcael said in a subsequent post, we still need this code both in<br>> user and in kernel.<br><br>Yes, but I think this issue really convinces me that we should<br>decouple the two calculations, so the kernel code is only used for
<br>kernel QPs. And then change the mlx4 ABI so that userspace tells the<br>kernel the wqe buffer size and rq/sq wqe shift/offset. That will<br>allow for different SQ BB sizes and also make things more robust<br>against bugs like this.
<br><br>- R.</blockquote>
<div> </div>
<div>So it looks like we can start by:</div>
<div>1. Change the user code to pass the size to kernel</div>
<div>2. Fix calculations in kernel.</div>
<div> </div>
<div>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?</div><br> </div>