[Openib-windows] [PATCH] MT23108: Fix large buffer memoryregistration
Fabian Tillier
ftillier at silverstorm.com
Thu May 11 06:48:01 PDT 2006
Hi Guy,
On 5/11/06, Guy Corem <guyc at voltaire.com> wrote:
> Hi Fab & Leonid,
>
> Fab's patch is broking something else:
You're quite right. Looking at it, while the patch rounds down the
seg_va to start on a page boundary (which makes seg_size an integral
number of pages), I forgot to increment the remaining data count to
account for the change in starting address.
Here's a new patch that hopefully solves the issue.
- Fab
Index: hw/mt23108/vapi/mlxsys/mosal/os_dep/win/mosal_iobuf.c
===================================================================
--- hw/mt23108/vapi/mlxsys/mosal/os_dep/win/mosal_iobuf.c (revision 337)
+++ hw/mt23108/vapi/mlxsys/mosal/os_dep/win/mosal_iobuf.c (working copy)
@@ -297,6 +297,12 @@
MOSAL_dlist_init_head( &new_iobuf->seg_que );
new_iobuf->seg_num = 0;
+ // Round the seg_va down to a page boundary so that we always get a seg_size
+ // that is an integral number of pages.
+ seg_va &= (~0Ui64 << PAGE_SHIFT);
+ // Since we rounded down the seg_va, we need to round up the rdc.
+ rdc += (seg_va & (PAGE_SIZE - 1));
+
// allocate segments
while (rdc > 0) {
// map a segment
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mt23108_iobuf.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060511/13190ab3/attachment.ksh>
More information about the ofw
mailing list