Lines Matching refs:sw

590  * the adjacent switch nodes to sw along paths
591 * that do not go through sw. do calculation by
595 static int get_switch_metric(lash_t *p_lash, int sw)
601 switch_t *s = p_lash->switches[sw];
634 if (sw3 == sw)
674 static void classify_switch(lash_t *p_lash, mesh_t *mesh, int sw)
678 switch_t *s = p_lash->switches[sw];
696 mesh->class_type[mesh->num_class] = sw;
709 static void classify_mesh_type(lash_t *p_lash, int sw)
713 switch_t *s = p_lash->switches[sw];
746 int sw;
752 for (sw = 0; sw < p_lash->num_switches; sw++) {
753 n = p_lash->switches[sw]->node;
763 p_lash->switches[sw]->p_sw->p_node->print_desc);
781 int sw;
786 for (sw = 0; sw < p_lash->num_switches; sw++) {
791 if (p_lash->switches[sw]->node->num_links > MAX_DEGREE)
794 if (get_switch_metric(p_lash, sw)) {
798 classify_mesh_type(p_lash, sw);
803 for (sw = 0; sw < p_lash->num_switches; sw++) {
804 if (p_lash->switches[sw]->node->type < 0)
806 classify_switch(p_lash, mesh, sw);
814 static void print_axis(lash_t *p_lash, char *p, int sw, int port)
816 mesh_node_t *node = p_lash->switches[sw]->node;
817 char *name = p_lash->switches[sw]->p_sw->p_node->print_desc;
838 static void seed_axes(lash_t *p_lash, int sw)
841 mesh_node_t *node = p_lash->switches[sw]->node;
882 print_axis(p_lash, p, sw, i);
925 static void make_geometry(lash_t *p_lash, int sw)
936 s = p_lash->switches[sw];
944 seed_axes(p_lash, sw);
945 seed = p_lash->switches[sw];
1134 static int reorder_node_links(lash_t *p_lash, mesh_t *mesh, int sw)
1137 switch_t *s = p_lash->switches[sw];
1215 int sw;
1224 for (sw = 0; sw < num_switches; sw++) {
1225 s = p_lash->switches[sw];
1236 s->node->coord[i] = (sw == seed) ? 0 : LARGE;
1251 for (sw = 0; sw < num_switches; sw++) {
1252 s = p_lash->switches[sw];
1290 int sw;
1315 for (sw = 0; sw < num_switches; sw++) {
1316 s = p_lash->switches[sw];
1360 int sw;
1365 for (sw = 0; sw < num_switches; sw++) {
1366 if (reorder_node_links(p_lash, mesh, sw)) {
1499 void osm_mesh_node_delete(lash_t *p_lash, switch_t *sw)
1503 mesh_node_t *node = sw->node;
1504 unsigned num_ports = sw->p_sw->num_ports;
1532 sw->node = NULL;
1541 int osm_mesh_node_create(lash_t *p_lash, switch_t *sw)
1546 unsigned num_ports = sw->p_sw->num_ports;
1550 if (!(node = sw->node = calloc(1, sizeof(mesh_node_t) + num_ports * sizeof(link_t *))))
1568 osm_mesh_node_delete(p_lash, sw);
1578 int sw;
1587 for (sw = 0; sw < num_switches; sw++) {
1588 s = p_lash->switches[sw];