[Openib-windows] [PATCH] query_ca

Yossi Leybovich sleybo at mellanox.co.il
Thu Oct 20 10:18:23 PDT 2005


Fab

inorder to support AV with GRH we still need to copy the ca attr and update
the internal pointers in the struct 
here is patch for that 

10x
Yossi 


Singed-off-by: Yossi Leybovich
Index: hw/mt23108/user/mlnx_ual_ca.c
===================================================================
--- hw/mt23108/user/mlnx_ual_ca.c (revision 603)
+++ hw/mt23108/user/mlnx_ual_ca.c (working copy)
@@ -192,16 +192,48 @@
  IN    size_t      byte_count,
  IN    ci_umv_buf_t    *p_umv_buf )
 {
+
  FUNC_ENTER;
 
  CL_ASSERT(h_uvp_ca);
  CL_ASSERT(p_umv_buf);
+ 
 
  if ( ioctl_status == IB_SUCCESS && p_ca_attr &&
   byte_count && !h_uvp_ca->p_hca_attr )
  {
+
+  ib_ca_attr_t* p_dest = NULL;
+  ib_ca_attr_t* p_src = NULL;
+  uint8_t   i;
+  uintn_t   offset ;
+  ib_port_attr_t  *p_tmp_port_attr = NULL;
+  
+  
   h_uvp_ca->p_hca_attr = p_umv_buf->p_inout_buf;
-  cl_memcpy(h_uvp_ca->p_hca_attr, p_ca_attr, byte_count);
+
+  p_dest = h_uvp_ca->p_hca_attr;
+  p_src = p_ca_attr;
+  offset = (uintn_t)h_uvp_ca->p_hca_attr - (uintn_t)p_ca_attr;
+   
+  cl_memcpy(p_dest, p_src, byte_count);
+  /* Fix up the pointers to point within the destination buffer. */
+  p_dest->p_page_size =
+   (uint32_t* __ptr64)(((uint8_t* __ptr64)p_dest->p_page_size) + offset);
+
+  p_tmp_port_attr =
+   (ib_port_attr_t* __ptr64)(((uint8_t* __ptr64)p_dest->p_port_attr) +
offset);
+
+  /* Fix up each port attribute's gid and pkey table pointers. */
+  for( i = 0; i < p_dest->num_ports; i++ )
+  {
+   p_tmp_port_attr[i].p_gid_table = (ib_gid_t* __ptr64)
+    (((uint8_t* __ptr64)p_tmp_port_attr[i].p_gid_table) + offset);
+
+   p_tmp_port_attr[i].p_pkey_table =(ib_net16_t* __ptr64)
+    (((uint8_t* __ptr64)p_tmp_port_attr[i].p_pkey_table) + offset);
+  }
+  p_dest->p_port_attr = p_tmp_port_attr;
  }
  else if (p_umv_buf->p_inout_buf) 
  {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051020/fbeb10ac/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: query_ca_2.patch
Type: application/octet-stream
Size: 1631 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051020/fbeb10ac/attachment.obj>


More information about the ofw mailing list