Commit 6481f6b2 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Ack, last revision was poorly thought out; redo so that control net

interfaces still get a real speed (although this does not actually
matter to anything, lets be pedantic, shall we).
parent fa289d46
......@@ -210,7 +210,7 @@ NODE: foreach my $node_id (@node_ids) {
#
# Get some more information about this interface type
#
my $iface_query = DBQueryFatal("SELECT full_duplex, " .
my $iface_query = DBQueryFatal("SELECT max_speed, full_duplex, " .
"connector FROM interface_types WHERE type='$iface_type'");
if (!$iface_query->num_rows()) {
warn "Node $node_id failed: Interface $card is of unknown type " .
......@@ -218,7 +218,7 @@ NODE: foreach my $node_id (@node_ids) {
next NODE;
}
my ($full_duplex, $connector) = $iface_query->fetchrow();
my ($max_speed, $full_duplex, $connector) = $iface_query->fetchrow();
#
# Do a sanity check - make sure that we have a switch recorded for all
......@@ -237,7 +237,7 @@ NODE: foreach my $node_id (@node_ids) {
#
# Stash it away...
#
$interfaces{$card} = [$MAC, $iface_type, $full_duplex,
$interfaces{$card} = [$MAC, $iface_type, $max_speed, $full_duplex,
$switch_id, $switch_card, $switch_port, $cable, $len];
}
......@@ -318,7 +318,7 @@ NODE: foreach my $node_id (@node_ids) {
}
while (my ($card, $aref) = each %interfaces) {
my ($MAC, $iface_type, $duplex, $switch_id, $switch_card,
my ($MAC, $iface_type, $max_speed, $duplex, $switch_id, $switch_card,
$switch_port, $cable, $len) = @$aref;
my $iface = "eth$card";
my $iface_IP = "";
......@@ -329,10 +329,14 @@ NODE: foreach my $node_id (@node_ids) {
$wire_type = "Control";
$iface_role = TBDB_IFACEROLE_CONTROL();
}
else {
# Experimental interfaces start with no speed set.
$speed = 0;
}
DBQueryFatal("INSERT INTO interfaces SET node_id='$node_id', " .
"card=$card, port=1, mac='$MAC', IP='$iface_IP', " .
"interface_type='$iface_type', iface='$iface', " .
"current_speed='0', duplex=$duplex, role='$iface_role'");
"current_speed='$speed', duplex=$duplex, role='$iface_role'");
if (!$switch_id) {
print "No switch found for ${node_id}:$iface - skipping\n";
......
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