Skip to content

Commit

Permalink
remove set/get egress port for mirror
Browse files Browse the repository at this point in the history
Summary: As titled, remove set/get egress port for mirror

Reviewed By: jasmeetbagga

Differential Revision: D61443900

fbshipit-source-id: bf31b72de783c6dec30a0381a0244414f5c98b64
  • Loading branch information
srikrishnagopu authored and facebook-github-bot committed Aug 20, 2024
1 parent 85dfb9b commit e41e06d
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 58 deletions.
7 changes: 3 additions & 4 deletions fboss/agent/ApplyThriftConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4841,14 +4841,13 @@ std::shared_ptr<Mirror> ThriftConfigApplier::updateMirror(
newMirror->getTunnelUdpPorts() == orig->getTunnelUdpPorts() &&
newMirror->getTruncate() == orig->getTruncate() &&
(!newMirror->configHasEgressPort() ||
newMirror->getEgressPort() == orig->getEgressPort())) {
newMirror->getEgressPortDesc() == orig->getEgressPortDesc())) {
if (orig->getMirrorTunnel()) {
newMirror->setMirrorTunnel(orig->getMirrorTunnel().value());
}
if (orig->getEgressPort()) {
newMirror->setEgressPort(orig->getEgressPort().value());
if (orig->getEgressPortDesc()) {
newMirror->setEgressPortDesc(
PortDescriptor(orig->getEgressPort().value()));
PortDescriptor(orig->getEgressPortDesc().value()));
}
}
if (*newMirror == *orig) {
Expand Down
2 changes: 0 additions & 2 deletions fboss/agent/MirrorManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ std::shared_ptr<Mirror> MirrorManagerImpl<AddrT>::updateMirror(
nexthop,
entry,
newMirror->getTunnelUdpPorts()));
newMirror->setEgressPort(egressPortDesc.value().phyPortID());
newMirror->setEgressPortDesc(egressPortDesc.value());
break;
}
Expand All @@ -157,7 +156,6 @@ std::shared_ptr<Mirror> MirrorManagerImpl<AddrT>::updateMirror(
if (newMirror && newMirror->type() == Mirror::Type::SFLOW &&
asic->isSupported(HwAsic::Feature::EVENTOR_PORT_FOR_SFLOW)) {
auto eventorPort = getEventorPortForSflowMirror(mirror->getSwitchId());
newMirror->setEgressPort(eventorPort);
newMirror->setEgressPortDesc(PortDescriptor(eventorPort));
newMirror->setDestinationMac(
getEventorPortInterfaceMac(state, eventorPort));
Expand Down
6 changes: 3 additions & 3 deletions fboss/agent/hw/sai/hw_test/HwTestMirrorUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void verifyResolvedLocalMirror(
const std::shared_ptr<facebook::fboss::Mirror>& mirror,
SaiMirrorHandle* mirrorHandle) {
auto portHandle = saiSwitch->managerTable()->portManager().getPortHandle(
mirror->getEgressPort().value());
mirror->getEgressPortDesc().value().phyPortID());
ASSERT_NE(portHandle, nullptr);
auto monitorPort = SaiApiTable::getInstance()->mirrorApi().getAttribute(
mirrorHandle->adapterKey(),
Expand All @@ -77,7 +77,7 @@ static void verifyResolvedErspanMirror(
const std::shared_ptr<facebook::fboss::Mirror>& mirror,
SaiMirrorHandle* mirrorHandle) {
auto portHandle = saiSwitch->managerTable()->portManager().getPortHandle(
mirror->getEgressPort().value());
mirror->getEgressPortDesc().value().phyPortID());
ASSERT_NE(portHandle, nullptr);
auto monitorPort = SaiApiTable::getInstance()->mirrorApi().getAttribute(
mirrorHandle->adapterKey(),
Expand Down Expand Up @@ -130,7 +130,7 @@ static void verifyResolvedSflowMirror(
const std::shared_ptr<facebook::fboss::Mirror>& mirror,
SaiMirrorHandle* mirrorHandle) {
auto portHandle = saiSwitch->managerTable()->portManager().getPortHandle(
mirror->getEgressPort().value());
mirror->getEgressPortDesc().value().phyPortID());
ASSERT_NE(portHandle, nullptr);
auto monitorPort = SaiApiTable::getInstance()->mirrorApi().getAttribute(
mirrorHandle->adapterKey(),
Expand Down
31 changes: 0 additions & 31 deletions fboss/agent/hw/test/HwMirrorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ TYPED_TEST(HwMirrorTest, ResolvedErspanMirror) {
mirror->getEgressPortDesc(),
mirror->getDestinationIp(),
mirror->getSrcIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -307,7 +306,6 @@ TYPED_TEST(HwMirrorTest, ResolvedSflowMirror) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -419,7 +417,6 @@ TYPED_TEST(HwMirrorTest, ResolvedToResolvedUpdate) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
resolvedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
resolvedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
resolvedMirror->setMirrorTunnel(MirrorTunnel(
Expand All @@ -434,7 +431,6 @@ TYPED_TEST(HwMirrorTest, ResolvedToResolvedUpdate) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
updatedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
updatedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
updatedMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -469,7 +465,6 @@ TYPED_TEST(HwMirrorTest, ResolvedToUnresolvedUpdate) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
resolvedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
resolvedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
resolvedMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -544,7 +539,6 @@ TYPED_TEST(HwMirrorTest, PortMirroringIfResolved) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
updatedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
updatedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
updatedMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -596,7 +590,6 @@ TYPED_TEST(HwMirrorTest, PortMirrorUpdateIfMirrorUpdate) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
updatedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
updatedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
updatedMirror->setMirrorTunnel(MirrorTunnel(
Expand All @@ -611,7 +604,6 @@ TYPED_TEST(HwMirrorTest, PortMirrorUpdateIfMirrorUpdate) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
updatedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
updatedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
updatedMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -658,7 +650,6 @@ TYPED_TEST(HwMirrorTest, PortMirror) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -705,7 +696,6 @@ TYPED_TEST(HwMirrorTest, UpdatePortMirror) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -774,7 +764,6 @@ TYPED_TEST(HwMirrorTest, RemovePortMirror) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -850,7 +839,6 @@ TYPED_TEST(HwMirrorTest, HwResolvedMirrorStat) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand All @@ -868,7 +856,6 @@ TYPED_TEST(HwMirrorTest, HwResolvedMirrorStat) {
sflowMirror->getDestinationIp(),
sflowMirror->getSrcIp(),
sflowMirror->getTunnelUdpPorts());
newSflowMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newSflowMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newSflowMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -919,7 +906,6 @@ TYPED_TEST(HwMirrorTest, HwUnresolvedMirrorStat) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
resolvedMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
resolvedMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
resolvedMirror->setMirrorTunnel(MirrorTunnel(
Expand All @@ -937,7 +923,6 @@ TYPED_TEST(HwMirrorTest, HwUnresolvedMirrorStat) {
sflowMirror->getDestinationIp(),
sflowMirror->getSrcIp(),
sflowMirror->getTunnelUdpPorts());
newSflowMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newSflowMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newSflowMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1000,7 +985,6 @@ TYPED_TEST(HwMirrorTest, AclMirror) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1042,7 +1026,6 @@ TYPED_TEST(HwMirrorTest, UpdateAclMirror) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1096,7 +1079,6 @@ TYPED_TEST(HwMirrorTest, RemoveAclMirror) {
mirror->getID(),
mirror->getEgressPortDesc(),
mirror->getDestinationIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[1]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[1]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1172,7 +1154,6 @@ TYPED_TEST(HwMirrorTest, SampleOnePort) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1228,7 +1209,6 @@ TYPED_TEST(HwMirrorTest, SampleAllPorts) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1298,7 +1278,6 @@ TYPED_TEST(HwMirrorTest, SflowMirrorWithErspanMirror) {
mirror->getEgressPortDesc(),
mirror->getDestinationIp(),
mirror->getSrcIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(
Expand Down Expand Up @@ -1403,7 +1382,6 @@ TYPED_TEST(HwMirrorTest, SflowMirrorWithErspanMirrorOnePortSflow) {
mirror->getEgressPortDesc(),
mirror->getDestinationIp(),
mirror->getSrcIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(
Expand Down Expand Up @@ -1514,7 +1492,6 @@ TYPED_TEST(HwMirrorTest, SflowMirrorWithErspanMirrorNoPortSflow) {
mirror->getEgressPortDesc(),
mirror->getDestinationIp(),
mirror->getSrcIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));

Expand Down Expand Up @@ -1613,7 +1590,6 @@ TYPED_TEST(HwMirrorTest, SampleAllPortsMirrorUnresolved) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1682,7 +1658,6 @@ TYPED_TEST(HwMirrorTest, SampleAllPortsMirrorUnresolvedResolved) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1767,7 +1742,6 @@ TYPED_TEST(HwMirrorTest, SampleAllPortsMirrorUpdate) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1819,7 +1793,6 @@ TYPED_TEST(HwMirrorTest, SampleAllPortsMirrorUpdate) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1861,7 +1834,6 @@ TYPED_TEST(HwMirrorTest, RemoveSampleAllPorts) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1920,7 +1892,6 @@ TYPED_TEST(HwMirrorTest, RemoveSampleAllPortsAfterWarmBoot) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -1995,7 +1966,6 @@ TYPED_TEST(HwMirrorTest, SampleAllPortsReloadConfig) {
mirror->getDestinationIp(),
mirror->getSrcIp(),
mirror->getTunnelUdpPorts());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down Expand Up @@ -2049,7 +2019,6 @@ TYPED_TEST(HwMirrorTest, ResolvedErspanMirrorOnTrunk) {
mirror->getEgressPortDesc(),
mirror->getDestinationIp(),
mirror->getSrcIp());
newMirror->setEgressPort(PortID(this->masterLogicalPortIds()[0]));
newMirror->setEgressPortDesc(
PortDescriptor(this->masterLogicalPortIds()[0]));
newMirror->setMirrorTunnel(MirrorTunnel(
Expand Down
11 changes: 0 additions & 11 deletions fboss/agent/state/Mirror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ std::string Mirror::getID() const {
return get<switch_state_tags::name>()->cref();
}

std::optional<PortID> Mirror::getEgressPort() const {
if (auto port = get<switch_state_tags::egressPort>()) {
return PortID(port->cref());
}
return std::nullopt;
}

std::optional<PortDescriptor> Mirror::getEgressPortDesc() const {
if (auto portDesc = get<switch_state_tags::egressPortDesc>()) {
return PortDescriptor::fromThrift(portDesc->toThrift());
Expand Down Expand Up @@ -96,10 +89,6 @@ void Mirror::setTruncate(bool truncate) {
set<switch_state_tags::truncate>(truncate);
}

void Mirror::setEgressPort(PortID egressPort) {
set<switch_state_tags::egressPort>(egressPort);
}

void Mirror::setEgressPortDesc(const PortDescriptor& egressPortDesc) {
set<switch_state_tags::egressPortDesc>(egressPortDesc.toThrift());
}
Expand Down
2 changes: 0 additions & 2 deletions fboss/agent/state/Mirror.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,13 @@ class Mirror : public ThriftStructNode<Mirror, state::MirrorFields> {
bool truncate = false);
enum Type { SPAN = 1, ERSPAN = 2, SFLOW = 3 };
std::string getID() const;
std::optional<PortID> getEgressPort() const;
std::optional<folly::IPAddress> getDestinationIp() const;
std::optional<folly::IPAddress> getSrcIp() const;
std::optional<TunnelUdpPorts> getTunnelUdpPorts() const;
std::optional<MirrorTunnel> getMirrorTunnel() const;
uint8_t getDscp() const;
bool getTruncate() const;
void setTruncate(bool truncate);
void setEgressPort(PortID egressPort);
void setMirrorTunnel(const MirrorTunnel& tunnel);
void setSwitchId(SwitchID switchId);
void setDestinationMac(const folly::MacAddress& dstMac);
Expand Down
2 changes: 1 addition & 1 deletion fboss/agent/state/tests/MirrorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ TEST_F(MirrorTest, ToAndFromThrift) {
auto unresolved = state_->getMirrors()->getNodeIf("unresolved");
auto with_dscp = state_->getMirrors()->getNodeIf("with_dscp");
auto resolved = state_->getMirrors()->getNodeIf("resolved");
resolved->setEgressPort(MirrorTest::egressPort);
resolved->setEgressPortDesc(PortDescriptor(MirrorTest::egressPort));
resolved->setMirrorTunnel(MirrorTunnel(
folly::IPAddress("1.1.1.1"),
folly::IPAddress("2.2.2.2"),
Expand Down
6 changes: 3 additions & 3 deletions fboss/agent/state/tests/MultiSwitchMapDeltaTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ TEST_F(MultiSwitchMapDeltaTest, ChangeMirror) {
auto mirrors = state2->getMirrors()->modify(&state2);
auto mirrorA = mirrors->getNodeIf("mirror012_a");
mirrorA = mirrorA->clone();
mirrorA->setEgressPort(PortID(2));
mirrorA->setEgressPortDesc(PortDescriptor(PortID(2)));
mirrors->updateNode(mirrorA, getMatcher012());

auto mirrorB = mirrors->getNodeIf("mirror023_c");
mirrorB = mirrorB->clone();
mirrorB->setEgressPort(PortID(2));
mirrorB->setEgressPortDesc(PortDescriptor(PortID(2)));
mirrors->updateNode(mirrorB, getMatcher023());

auto mirrors0 = state1->getMirrors();
Expand Down Expand Up @@ -190,7 +190,7 @@ TEST_F(MultiSwitchMapDeltaTest, AddRemoveUpdate) {
auto addedMirror = mirrors->getNodeIf("mirror012_d");
auto changedOld = mirrors->getNodeIf("mirror023_c");
auto mirror23c = mirrors->getNodeIf("mirror023_c")->clone();
mirror23c->setEgressPort(PortID(2));
mirror23c->setEgressPortDesc(PortDescriptor(PortID(2)));
mirrors->updateNode(mirror23c, getMatcher023());
auto changedNew = mirrors->getNodeIf("mirror023_c");
state2->publish();
Expand Down
2 changes: 1 addition & 1 deletion fboss/agent/test/SwSwitchUpdateProcessingTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class SwSwitchUpdateProcessingTest : public ::testing::TestWithParam<bool> {
auto newState = state->clone();
auto mirrors = newState->getMirrors()->modify(&newState);
auto mirror = mirrors->getNode("foo")->clone();
mirror->setEgressPort(PortID(1));
mirror->setEgressPortDesc(PortDescriptor(PortID(1)));
mirrors->updateNode(mirror, HwSwitchMatcher::defaultHwSwitchMatcher());
return newState;
}
Expand Down

0 comments on commit e41e06d

Please sign in to comment.