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

Leonid Keller leonid at mellanox.co.il
Thu May 11 02:44:24 PDT 2006


Yes, on the first look it isn't successful. 
I'd suggest to correct the algorithm so, that it would divide the large
buffer into page-aligned segments of integral number of pages size. It
doesn't enlarge MDLs, nor increase their number.
One needs only to see that this patch doesn't influence other functions
of this module or to fix them correspondently.
I'm going to do that as soon as I have time. 

> -----Original Message-----
> From: Guy Corem [mailto:guyc at voltaire.com] 
> Sent: Thursday, May 11, 2006 11:57 AM
> To: Fab Tillier; Leonid Keller
> Cc: openib-windows at openib.org
> Subject: RE: [Openib-windows] [PATCH] MT23108: Fix large 
> buffer memoryregistration
> 
> 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