[openib-general] [PATCH] osm: fix mlx vendor rmpp sender fail to send zero size RMPP

Eitan Zahavi eitan at mellanox.co.il
Thu Jun 8 01:40:30 PDT 2006


Hi Hal

Run into this by chance. Some changes introduced lately to the SA queries 
now sends zero size RMPP (single segment with only headers). It used to send 
them as non-RMPP responses. Anyway, this broke the mlx vendor code that I use 
for simulation.

This patch resolves this new problem.

Eitan

Signed-off-by:  Eitan Zahavi <eitan at mellanox.co.il>

Index: libvendor/osm_vendor_mlx_sar.c
===================================================================
--- libvendor/osm_vendor_mlx_sar.c	(revision 7703)
+++ libvendor/osm_vendor_mlx_sar.c	(working copy)
@@ -91,7 +91,7 @@ osmv_rmpp_sar_get_mad_seg(
     num_segs++;
   }
 
-  if ( seg_idx > num_segs)
+  if ( (seg_idx > num_segs) && (seg_idx != 1) )
   {
     return IB_NOT_FOUND;
   }
@@ -102,18 +102,14 @@ osmv_rmpp_sar_get_mad_seg(
   /* attach header */
   memcpy(p_buf,p_sar->p_arbt_mad,p_sar->hdr_sz);
 
-
   /* fill data */
   p_seg = (char*)p_sar->p_arbt_mad + p_sar->hdr_sz + ((seg_idx-1) * p_sar->data_sz);
   sz_left = p_sar->data_len - ((seg_idx -1) * p_sar->data_sz);
   if (sz_left > p_sar->data_sz)
-  {
     memcpy((char*)p_buf+p_sar->hdr_sz,(char*)p_seg,p_sar->data_sz);
-  }
   else
     memcpy((char*)p_buf+ p_sar->hdr_sz, (char*)p_seg, sz_left);
 
-
   return IB_SUCCESS;
 }
 





More information about the general mailing list