[Openib-windows] [PATCH] MT23108: Fix large buffer memory registration

Fab Tillier ftillier at silverstorm.com
Wed May 10 16:57:21 PDT 2006


Hi Leonid,

After looking into Guy's reported memory corruption, as well as symptoms seen by
Microsoft, I'm certain the memory registration code is the MT23108 driver is
broken.

The following trivial patch solves it.  Please apply as soon as possible as this
is a critical issue.

Thanks,

- 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 334)
+++ hw/mt23108/vapi/mlxsys/mosal/os_dep/win/mosal_iobuf.c	(working copy)
@@ -297,6 +297,10 @@
   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 &= (~0 << PAGE_SHIFT);
+
   // allocate segments
   while (rdc > 0) {
   	// map a segment
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mt23108_iobuf.patch
Type: application/octet-stream
Size: 598 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060510/e023d726/attachment.obj>


More information about the ofw mailing list