[Openib-windows] SRP in x86 machinise

Yossi Leybovich sleybo at mellanox.co.il
Mon Sep 4 04:13:29 PDT 2006


Fab
 
The patch for the former problem indeed help 
( I guess that that the fact you are not calling to srp_free_hca solve
the double freeing, I also did not understand fully why ).
Still I was left with the LOCAL_PROTECTION_ERR , the reason for that is
casting issue in 32 bit machines
Because SRP register kernel memory the cast from 32 bit to 64 bit use
sign extension and :
0x89830000 move to 0xffffffff89830000
 
this change solve tyhe problem (its just suggestion but the idea is to
force the cast to ignore sign of the address)
 
 
Index: kernel/srp_descriptors.c
===================================================================
--- kernel/srp_descriptors.c (revision 1647)
+++ kernel/srp_descriptors.c (working copy)
@@ -91,10 +91,12 @@
  }
 
  /* Register the data segments array memory */
- mr_create.vaddr = p_descriptors->p_recv_data_segments_array;
+ mr_create.vaddr = (void*
__ptr64)(uint64_t)(ULONG_PTR)p_descriptors->p_recv_data_segments_array;
  mr_create.length = p_descriptors->recv_descriptor_count *
p_descriptors->recv_data_segment_size;
  mr_create.access_ctrl = IB_AC_LOCAL_WRITE;
@@ -124,7 +126,7 @@
   p_descriptor->wr.num_ds = 1;
   p_descriptor->wr.ds_array = p_descriptor->ds;
 
-  p_descriptor->ds[0].vaddr = (uint64_t)((void*
__ptr64)p_data_segment);
+  p_descriptor->ds[0].vaddr = (uint64_t)(ULONG_PTR)p_data_segment;
   p_descriptor->ds[0].length = p_descriptors->recv_data_segment_size;
   p_descriptor->ds[0].lkey = p_descriptors->recv_lkey;
 

 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060904/e450d644/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srp_desc.patch
Type: application/octet-stream
Size: 964 bytes
Desc: srp_desc.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060904/e450d644/attachment.obj>


More information about the ofw mailing list