Commit b37b819f authored by Robert Ricci's avatar Robert Ricci

Add a no_interswitch flag to virtual links

When set, assign is not allowed to map this link to an interswitch link;
this is to force a link to be resolved by two nodes connected to the
same switch.

Part of ticket #64
parent 566c0d4a
......@@ -292,6 +292,7 @@ int parse_top(tb_vgraph &vg, istream& input)
l->allow_trivial = false;
#endif
l->emulated = false;
l->allow_interswitch = true;
l->fix_src_iface = false;
l->fix_dst_iface = false;
......@@ -304,6 +305,8 @@ int parse_top(tb_vgraph &vg, istream& input)
l->emulated = true;
} else if (parsed_line[i] == string("trivial_ok")) {
l->allow_trivial = true;
} else if (parsed_line[i] == string("no_interswitch")) {
l->allow_interswitch = false;
} else if (stag == string("fixsrciface")) {
l->fix_src_iface = true;
l->src_iface = svalue;
......
......@@ -359,6 +359,13 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
<< endl);
}
}
// If we're not allowed to use interswitch links for this vlink, just
// skip all of the attempts to find interswitch links
if (!vlink->allow_interswitch){
// Bad Rob, no GOTO
goto skip_interswitch_links;
}
for (pvertex_set::iterator source_switch_it = pnode->switches.begin();
source_switch_it != pnode->switches.end();
++source_switch_it) {
......@@ -487,6 +494,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
}
}
skip_interswitch_links:
return total_weight;
}
......
......@@ -211,6 +211,7 @@ public:
// but isn't.
bool allow_delayed; // can this vlink by a delayed link
bool allow_trivial; // can this vlink be a trivial link?
bool allow_interswitch; // can this vlink be an interswitch link?
vvertex src, dst; // Source and destination for this link
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment