Lines Matching refs:hops
62 if (!p_sw->hops[lid_ho]) {
63 p_sw->hops[lid_ho] = malloc(p_sw->num_ports);
64 if (!p_sw->hops[lid_ho])
66 memset(p_sw->hops[lid_ho], OSM_NO_PATH, p_sw->num_ports);
69 p_sw->hops[lid_ho][port_num] = num_hops;
70 if (p_sw->hops[lid_ho][0] > num_hops)
71 p_sw->hops[lid_ho][0] = num_hops;
151 if (p_sw->hops) {
153 if (p_sw->hops[i])
154 free(p_sw->hops[i]);
155 free(p_sw->hops);
279 uint8_t hops;
338 4. the port has min-hops to the target (avoid loops)
355 hops =
369 if (hops == least_hops)
385 do not always follow least hops.
386 So we must abort if not least hops.
427 /* If not update the least hops for this case */
440 /* If not update the least hops for this case */
512 if (p_sw->hops[i])
513 memset(p_sw->hops[i], OSM_NO_PATH, p_sw->num_ports);
521 uint8_t **hops;
535 if (!p_sw->hops) {
536 hops = malloc((max_lids + 1) * sizeof(hops[0]));
537 if (!hops)
539 memset(hops, 0, (max_lids + 1) * sizeof(hops[0]));
540 p_sw->hops = hops;
545 hops = malloc((max_lids + 1) * sizeof(hops[0]));
546 if (!hops)
548 memcpy(hops, p_sw->hops, p_sw->num_hops * sizeof(hops[0]));
549 memset(hops + p_sw->num_hops, 0,
550 (max_lids + 1 - p_sw->num_hops) * sizeof(hops[0]));
551 old_hops = p_sw->hops;
552 p_sw->hops = hops;
576 uint8_t hops;
583 hops = osm_switch_get_least_hops(p_sw, cl_ntoh16(lid));
584 return hops != OSM_NO_PATH ? hops + 1 : OSM_NO_PATH;
597 uint8_t hops;
638 hops =
640 if (hops != OSM_NO_PATH)