Commit 4aab1921 authored by Leigh Stoller's avatar Leigh Stoller

Add explicit support for NS nobwshaping and use that instead of

best_effort. When given, do not set uselinkdelay in the CM. This is a
first commit, this will change slightly in subsequent commit.
parent ce717396
......@@ -1361,6 +1361,7 @@ sub new($$$$)
"best_effort" => undef,
"shared_vlan" => undef,
"force_shaping" => undef,
"force_nobwshaping" => undef,
"trivial_ok" => undef,
"vlan_tagging" => undef,
"link_multiplexing" => undef,
......@@ -1585,6 +1586,10 @@ sub addLink($$$)
$link->{'force_shaping'} = 1;
last SWITCH;
};
/^force_nobwshaping$/i && do {
$link->{'force_nobwshaping'} = 1;
last SWITCH;
};
/^trivial_ok$/i && do {
$link->{'trivial_ok'} = 1;
last SWITCH;
......@@ -1658,7 +1663,7 @@ sub Compare($$)
/^(best_effort|shared_vlan|force_shaping|trivial_ok)$/i ||
/^(vlan_tagging|link_multiplexing|interswitch)$/i ||
/^(vlan_tagging|link_multiplexing|interswitch)$/i ||
/^(nomac_learning|jacks_site)$/i) && do {
/^(nomac_learning|jacks_site|force_nobwshaping)$/i) && do {
return 1
if (APT_Rspec::CompareValues("Link: $client_id: $key",
$val1, $val2));
......
......@@ -461,7 +461,10 @@ for child in tree.getroot():
if row.find("nobwshaping") != None:
nobwshaping = int(row.find("nobwshaping").text)
if nobwshaping:
lan.best_effort = True
if not lansets[vname].has_key("nobwshaping"):
lan.setNoBandwidthShaping()
pass
lansets[vname]["nobwshaping"] = True
pass
pass
if row.find("mustdelay") != None:
......
......@@ -495,6 +495,9 @@ sub GenerateLinkStatements($)
if (defined($link->{'force_shaping'})) {
$link->addTagStatement("setForceShaping()");
}
if (defined($link->{'force_nobwshaping'})) {
$link->addTagStatement("setNoBandwidthShaping()");
}
if (defined($link->{'trivial_ok'})) {
$link->addTagStatement("trivial_ok = True");
}
......
......@@ -2283,6 +2283,7 @@ sub GetTicketAuxAux($$$$$$$$$$$)
#
my $besteffort = 0;
my $forcedelay = 0;
my $nobwshaping= 0;
if (GeniXML::HasBestEffortSetting($linkref)) {
$besteffort = 1;
......@@ -2290,6 +2291,9 @@ sub GetTicketAuxAux($$$$$$$$$$$)
if (GeniXML::HasForceShapingSetting($linkref)) {
$forcedelay = 1;
}
if (GeniXML::HasNoBandwidthShapingSetting($linkref)) {
$nobwshaping = 1;
}
# Ditto for new direct link option.
my $nointerswitch = GeniXML::NoInterSwitch($linkref);
......@@ -2608,7 +2612,8 @@ sub GetTicketAuxAux($$$$$$$$$$$)
}
elsif (GeniXML::GetLinkProperties($linkref)) {
my @properties = GeniXML::GetLinkProperties($linkref);
$uselinkdelay = 1;
$uselinkdelay = 1
if (!$nobwshaping);
#
# Links (two nodes) and Lans (more then two nodes) are very
......@@ -2685,6 +2690,7 @@ sub GetTicketAuxAux($$$$$$$$$$$)
$rlatency = 0.0;
$lossrate = 0.0;
$rlossrate = 0.0;
$nobwshaping= 1;
}
my $virtlan =
......@@ -2695,7 +2701,7 @@ sub GetTicketAuxAux($$$$$$$$$$$)
"vindex" => $vindex,
"trivial_ok" => $trivial_ok,
"emulated" => $emulated,
"nobwshaping" => $besteffort,
"nobwshaping" => $nobwshaping,
"nointerswitch" => $nointerswitch,
"ip" => $ip,
"delay" => $latency,
......
......@@ -1205,6 +1205,14 @@ sub HasForceShapingSetting($)
return scalar(@foo);
}
sub HasNoBandwidthShapingSetting($)
{
my ($link) = @_;
my @foo = FindNodesNS("n:force_nobwshaping", $link,
$EMULAB_NS)->get_nodelist();
return scalar(@foo);
}
sub HasTrivialSetting($)
{
my ($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