Skip to content

Commit

Permalink
use both port and port descriptors in swswitch for mirror
Browse files Browse the repository at this point in the history
Summary: As titled, set both port and port descriptor while resolving mirror in sw switch. Subsequent diffs will transition away from using egress port and move everything to use port descriptor.

Reviewed By: jasmeetbagga

Differential Revision: D61224824

fbshipit-source-id: bc60051b1570b15373e3574529dac616a49a6f8f
  • Loading branch information
srikrishnagopu authored and facebook-github-bot committed Aug 16, 2024
1 parent 1a80c73 commit 7e2fe07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fboss/agent/ApplyThriftConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4842,6 +4842,8 @@ std::shared_ptr<Mirror> ThriftConfigApplier::updateMirror(
}
if (orig->getEgressPort()) {
newMirror->setEgressPort(orig->getEgressPort().value());
newMirror->setEgressPortDesc(
PortDescriptor(orig->getEgressPort().value()));
}
}
if (*newMirror == *orig) {
Expand Down
2 changes: 2 additions & 0 deletions fboss/agent/MirrorManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ std::shared_ptr<Mirror> MirrorManagerImpl<AddrT>::updateMirror(
entry,
newMirror->getTunnelUdpPorts()));
newMirror->setEgressPort(egressPort.value());
newMirror->setEgressPortDesc(PortDescriptor(egressPort.value()));
break;
}

Expand All @@ -155,6 +156,7 @@ std::shared_ptr<Mirror> MirrorManagerImpl<AddrT>::updateMirror(
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

0 comments on commit 7e2fe07

Please sign in to comment.