[Openib-windows] [PATCH] MT23108: Fix large buffer memoryregistration

Guy Corem guyc at voltaire.com
Thu May 11 07:18:23 PDT 2006


Thanks again.

Question: I know that MDL wise there won't be a problem, since you're
locking the same pages.
But there won't be a problem somewhere else with the va displacement?

Guy 

-----Original Message-----
From: ftillier.sst at gmail.com [mailto:ftillier.sst at gmail.com] On Behalf
Of Fabian Tillier
Sent: Thursday, May 11, 2006 4:48 PM
To: Guy Corem
Cc: Leonid Keller; openib-windows at openib.org
Subject: Re: [Openib-windows] [PATCH] MT23108: Fix large buffer
memoryregistration

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



More information about the ofw mailing list