Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions fboss/agent/AclNexthopHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,27 @@ AclEntry* FOLLY_NULLABLE AclNexthopHandler::updateAcl(
const auto& origAclAction = origAclEntry->getAclAction();
if (origAclAction &&
origAclAction->cref<switch_state_tags::redirectToNextHop>()) {
// Tunnel encap nexthops are resolved by the HW pipeline via a second
// routing lookup on the outer header, so they don't need RIB resolution.
// Tunnel encap and SRv6 encap nexthops are resolved by the HW pipeline;
// they do not need RIB resolution.
auto redirectAction =
origAclAction->cref<switch_state_tags::redirectToNextHop>()
->cref<switch_state_tags::action>();
auto redirectNhops =
redirectAction->cref<switch_config_tags::redirectNextHops>();
bool allTunnelEncap = !redirectNhops->empty();
bool allTunnelRedirect = !redirectNhops->empty();
for (const auto& nh : std::as_const(*redirectNhops)) {
const auto& tunnelType = nh->cref<switch_config_tags::tunnelType>();
if (!tunnelType.has_value() ||
tunnelType->toThrift() != TunnelType::IP_IN_IP_ENCAP) {
allTunnelEncap = false;
if (!tunnelType.has_value()) {
allTunnelRedirect = false;
break;
}
auto tt = tunnelType->toThrift();
if (tt != TunnelType::IP_IN_IP_ENCAP && tt != TunnelType::SRV6_ENCAP) {
allTunnelRedirect = false;
break;
}
}
if (allTunnelEncap) {
if (allTunnelRedirect) {
return nullptr;
}

Expand Down
9 changes: 8 additions & 1 deletion fboss/agent/ApplyThriftConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4133,7 +4133,8 @@ std::shared_ptr<AclMap> ThriftConfigApplier::updateAclsImpl(
bool hasTunnelRedirect = false;
for (const auto& nh : *redirectToNextHop->redirectNextHops()) {
if (nh.tunnelType().has_value() &&
nh.tunnelType().value() == TunnelType::IP_IN_IP_ENCAP) {
(nh.tunnelType().value() == TunnelType::IP_IN_IP_ENCAP ||
nh.tunnelType().value() == TunnelType::SRV6_ENCAP)) {
hasTunnelRedirect = true;
break;
}
Expand Down Expand Up @@ -4406,6 +4407,12 @@ shared_ptr<AclEntry> ThriftConfigApplier::createAcl(
if (auto dscp = config->dscp()) {
newAcl->setDscp(*dscp);
}
if (auto tc = config->tc()) {
newAcl->setTrafficClass(*tc);
}
if (auto routeDst = config->routeDst()) {
newAcl->setRouteDst(*routeDst);
}
if (auto dstMac = config->dstMac()) {
newAcl->setDstMac(MacAddress(*dstMac));
}
Expand Down
29 changes: 29 additions & 0 deletions fboss/agent/ThriftHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,9 @@ AclEntryThrift populateAclEntryThrift(const AclEntry& aclEntry) {
if (aclEntry.getDscp()) {
aclEntryThrift.dscp() = aclEntry.getDscp().value();
}
if (aclEntry.getTrafficClass()) {
aclEntryThrift.tc() = aclEntry.getTrafficClass().value();
}
if (aclEntry.getTtl()) {
aclEntryThrift.ttl() = aclEntry.getTtl().value().getValue();
}
Expand Down Expand Up @@ -3113,6 +3116,32 @@ void ThriftHandler::setSdkRegDumpEnabled(bool enabled) {
}
}

void ThriftHandler::setSdkRegDumpEnabled(bool enabled) {
auto log = LOG_THRIFT_CALL_WITH_STATS(DBG1, sw_->stats());
ensureConfigured(__func__);
if (sw_->isRunModeMonolithic()) {
sw_->getMonolithicHwSwitchHandler()->setSdkRegDumpEnabled(enabled);
return;
}
// Multi-switch: apply to every switch best-effort so that one unsupported or
// unreachable switch does not prevent updating the others. Collect failures
// and surface them together.
std::string failures;
for (const auto& switchId : sw_->getSwitchInfoTable().getSwitchIDs()) {
try {
sw_->getHwSwitchThriftClientTable()->setSdkRegDumpEnabled(
switchId, enabled);
} catch (const std::exception& ex) {
failures += folly::to<std::string>(
failures.empty() ? "" : "; ", switchId, ": ", ex.what());
}
}
if (!failures.empty()) {
throw FbossError(
"Failed to set SDK register dump on switch(es): ", failures);
}
}

void ThriftHandler::getPlatformMapping(cfg::PlatformMapping& ret) {
ret = sw_->getPlatformMapping()->toThrift();
}
Expand Down
Loading