Nicolas Morey Chaisemartin wrote:
Yevgeny Kliteynik wrote:
Hi Nicolas,

/* foreach down-going port group (in indexing order) */
-    i = p_sw->down_port_groups_idx;
+    i = (p_sw->down_port_groups_idx +
+         p_sw->down_port_groups_num) % p_sw->down_port_groups_num;

Perhaps it would be simpler just to init the down_port_groups_idx to 0 instead of -1?
Something like this:

diff --git a/opensm/opensm/osm_ucast_ftree.c b/opensm/opensm/osm_ucast_ftree.c
index 4e65c87..eae1ed8 100644
--- a/opensm/opensm/osm_ucast_ftree.c
+++ b/opensm/opensm/osm_ucast_ftree.c
@@ -563,7 +563,7 @@ static ftree_sw_t *__osm_ftree_sw_create(IN ftree_fabric_t * p_ftree,
     /* initialize lft buffer */
     memset(p_osm_sw->new_lft, OSM_NO_PATH, IB_LID_UCAST_END_HO + 1);

-    p_sw->down_port_groups_idx = -1;
+    p_sw->down_port_groups_idx = 0;

     return p_sw;
 }                /* __osm_ftree_sw_create() */

Sure. I wanted to ensure that whatever happens to the index it would always be in the right interval but after checking I doubt anything else than initialization could set it outside its normal interval.
Do you want me to make the patch and send it or will you just push yours?

I'm ok with both options.
I can send a clean patch to Sasha tomorrow (I'm OOO today), or you can do it 
today.

-- Yevgeny

Nicolas


_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to