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

Guy Corem guyc at voltaire.com
Thu May 11 01:57:24 PDT 2006


Hi Fab & Leonid,

Fab's patch is broking something else:


<1> MDT(2):
d:\projects\win-ibhost\trunk\hw\mt23108\vapi\hca\hcahal\tavor\mrwm\tmrwm
.c[904]: Number of pages returned from MOSAL_iobuf_get_tpt_seg () is
different from expected ()
<1> MDT(1): THH_mrwm_register_mr: rc=HH_EFATAL
~1:mlnx_register_mr() !ERROR!: file
d:\projects\win-ibhost\trunk\hw\mt23108\kernel\hca_memory.c line 123
~1:mlnx_register_mr() !ERROR!: completes with ERROR status 39
~0:reg_mem() !ERROR!: unable to register memory: IB_ERROR
~0:reg_mem() ]


Please don't apply it yet, I'm working on a fix to the fix.

Guy

-----Original Message-----
From: openib-windows-bounces at openib.org
[mailto:openib-windows-bounces at openib.org] On Behalf Of Fab Tillier
Sent: Thursday, May 11, 2006 2:57 AM
To: Leonid Keller
Cc: openib-windows at openib.org
Subject: [Openib-windows] [PATCH] MT23108: Fix large buffer
memoryregistration

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



More information about the ofw mailing list