[openib-general] [PATCH] osm: osm_vendor_umad osm_vendor_get_all_port_attr bug

Eitan Zahavi eitan at mellanox.co.il
Sun Aug 21 00:32:37 PDT 2005


Hi Hal

osm_vendor_get_all_port_attr returns incorrect LID and state for 
device ports. This bug was caused by the fact that if a device port
was skipped due to that fact it does not exist (HCA port 0). The 
lid and state pointers used as indexes into their corresponding
return value arrays were not advancing to the next port index.

So the return for a single HCA was mixing LID and state for the first
port and displayed non initialized memory for the second port.

The following simple patch fixes this bug. It assumes the previous
patch named:"osm_vendor_umad to provide port state" was previously 
applied.

Thanks

Eitan

I tested the patch on :
2.6.12.3-smp SuSE Linux 9.3 (i586)

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

Index: osm/libvendor/osm_vendor_ibumad.c
===================================================================
--- osm/libvendor/osm_vendor_ibumad.c	(revision 3128)
+++ osm/libvendor/osm_vendor_ibumad.c	(working copy) 
@@ -527,8 +529,10 @@ osm_vendor_get_all_port_attr(
 			for (j = 0; j <= ca.numports; j++) {
 				if (ca.ports[j]) {
 					*p_lid = ca.ports[j]->base_lid; 
-					p_lid++;
-					p_linkstates++;
 				}
+				p_lid++; 
+				p_linkstates++;
 			}
 		}
 	}




More information about the general mailing list