Commit dffb96dd authored by Leigh B Stoller's avatar Leigh B Stoller

Add special case for bbg, same as we do for spp. This stuff needs to

be generalized in some fashion.

Change to how vlan ecapsulation links are represented in the lans
table. Formerly, we had two links; one was the underlying vlan and the
other was the ecapsulated link running over it. This is required when
*not* using vlan encapsulation since there might be multiple emulated
networks on top of the vlan network.

However, when using vlan ecapsulation, this strictly one to one; there
are multiple vlan links, with the ports in trunk mode. There is no
reason to have two entries in the lans table, and in fact was causing
me grief wrt vlan tag reservations in protogeni, since the name of
link is not the same as the name of the underlying vlan link that was
getting created. And so it was impossible to match up the
reservations.

I pray this does not break 10 other things.
parent 1ef72c51
......@@ -1461,7 +1461,6 @@ sub LoadVirtLans($)
if ($vlanmember->is_accesspoint());
$virtlan->_sharednodes(0);
$virtlan->_geninodes(0);
$virtlan->_needvlan(0);
$virtlan->_implemented_by($implemented_by);
$virtlan->_vpath(undef);
......@@ -1545,10 +1544,10 @@ sub LoadVirtLans($)
# Terrible.
$vlanmember->_reservebw(0);
$vlanmember->_needtrunk(0);
if ($vlanmember->virt_node()->type() eq "sppvm") {
if ($vlanmember->virt_node()->type() eq "sppvm" ||
$vlanmember->virt_node()->type() eq "bbgenivm") {
$vlanmember->_reservebw($bandwidth);
$vlanmember->_needtrunk(1);
$virtlan->_needvlan(1);
$self->printdb(" Forcing $vlanmember to reserve shared bandwidth\n");
}
}
......@@ -4598,9 +4597,10 @@ sub AllocNodes($)
foreach my $vnodename (sort(keys(%{ $self->solution_v2v() }))) {
my $vpnodename = $self->solution_v2v()->{$vnodename};
my $vpnode = $self->pnodes()->{$vpnodename};
my $virtnode = $self->vnodes()->{$vnodename};
if ($vpnode->isjailed() ||
$vpnode->isremotenode() || $vpnode->_onsharednode()) {
$vpnode->isremotenode() || $virtnode->_onsharednode()) {
my $pnodename = $self->solution_v2p()->{$vnodename};
my $pnode = $self->pnodes()->{$pnodename};
my $sshdport;
......@@ -5418,36 +5418,6 @@ sub InterpLinksAux($)
if ($virtlan->usevirtiface()) {
my $protovlan;
#
# When using virtual interfaces we need to create a
# protolan for the underlying vlan, and then another link
# for the endpoints that run over that vlan. Note though
# that there might be multiple emulated links running on
# on this physical link. Once we have everything created
# there is a postpass to merge the vlans into a single
# supervlan since a nodeport can be in just a single vlan.
#
#
if (!$virtlan->_sharednodes() ||
$virtlan->_sharednodes() ||
$virtlan->_needvlan()) {
my $lanid = "v" . "$lan" . $vlanid++;
$protovlan = ProtoLan->Create($experiment, $lanid,
$self->impotent() ||
$self->alloconly());
$protovlan->SetRole("encapsulation");
$protovlan->SetType("vlan");
$protovlan->SetEncapStyle($virtlan->_encapstyle());
$protovlan->SetAttribute("link/lan", $lan);
$protovlans{$lan} = $protovlan;
$protovlan->AddMember($nodeA, $portA)
if (!$protovlan->IsMember($nodeA, $portA));
$protovlan->AddMember($nodeB, $portB)
if (!$protovlan->IsMember($nodeB, $portB));
}
#
# Create some new virtual devices.
#
......@@ -5477,18 +5447,20 @@ sub InterpLinksAux($)
$rbandwidth = $member1->_reservebw();
}
if ($virtnodeA->_onsharednode() &&
$self->printdb(" Reserving shared BW: ".
"$member0,$bandwidth,$virtifaceA\n") &&
if (($virtnodeA->_onsharednode() ||
$member0->_reservebw()) &&
$self->printdb(" Reserving shared BW: $member0,".
"$bandwidth,$virtifaceA\n") &&
!($self->impotent() || $self->alloconly()) &&
$virtifaceA->ReserveSharedBandwidth($bandwidth)) {
tbinfo("Could not reserve shared bandwidth: ".
"$member0,$bandwidth,$virtifaceA\n");
return -1;
}
if ($virtnodeB->_onsharednode() &&
$self->printdb(" Reserving shared BW: ".
"$member1,$rbandwidth,$virtifaceB\n") &&
if (($virtnodeB->_onsharednode() ||
$member1->_reservebw()) &&
$self->printdb(" Reserving shared BW: $member1,".
"$rbandwidth,$virtifaceB\n") &&
!($self->impotent() || $self->alloconly()) &&
$virtifaceB->ReserveSharedBandwidth($rbandwidth)) {
tbinfo("Could not reserve shared bandwidth: ".
......@@ -5496,18 +5468,55 @@ sub InterpLinksAux($)
return -1;
}
}
$portA = $virtifaceA->viface();
$portB = $virtifaceB->viface();
#
# When using virtual interfaces we need to create a
# protolan for the underlying vlan, and then another link
# for the endpoints that run over that vlan. Note though
# that there might be multiple emulated links running on
# on this physical link. Once we have everything created
# there is a postpass to merge the vlans into a single
# supervlan since a nodeport can be in just a single vlan.
# Note that if the encapstype is "vlan" then the previous
# is obviously false, since then the ports are going to
# be in trunk mode, and the nodeports in multiple vlans.
#
if ($virtlan->_encapstyle() ne "vlan") {
my $lanid = "v" . "$lan" . $vlanid++;
$protovlan = ProtoLan->Create($experiment, $lanid,
$self->impotent() ||
$self->alloconly());
$protovlan->SetRole("encapsulation");
$protovlan->SetType("vlan");
$protovlan->SetEncapStyle($virtlan->_encapstyle());
$protovlan->SetAttribute("link/lan", $lan);
$protovlans{$lan} = $protovlan;
$protovlan->AddMember($nodeA, $portA)
if (!$protovlan->IsMember($nodeA, $portA));
$protovlan->AddMember($nodeB, $portB)
if (!$protovlan->IsMember($nodeB, $portB));
}
$protolink = ProtoLan->Create($experiment, $lan,
$self->impotent() ||
$self->alloconly(),
$protovlan);
$protolink->SetType((defined($protovlan) ?
"emulated" : "emulated-shared"));
"emulated" : "vlan"));
$protolink->SetRole("link/lan");
$protolink->AddInterface($nodeA, $vnodeA, $vportA, $portA);
$protolink->AddInterface($nodeB, $vnodeB, $vportB, $portB);
$protolink->AddInterface($nodeA, $vnodeA, $vportA,
$virtifaceA->viface(),
(defined($protovlan) ?
undef : $portA));
$protolink->AddInterface($nodeB, $vnodeB, $vportB,
$virtifaceB->viface(),
(defined($protovlan) ?
undef : $portB));
# For portmap below
$portA = $virtifaceA->viface();
$portB = $virtifaceB->viface();
}
else {
$protolink = ProtoLan->Create($experiment, $lan,
......@@ -5610,9 +5619,7 @@ sub InterpLinksAux($)
#
my $protovlan;
if (!$virtlan->_sharednodes() ||
$virtlan->_sharednodes() ||
$virtlan->_needvlan()) {
if (1) {
if (exists($protovlans{$lan})) {
$protovlan = $protovlans{$lan};
}
......
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