Skip to content

Commit

Permalink
DLB: Workaround to force enable DLB member links
Browse files Browse the repository at this point in the history
Summary:
This is a workaround until CS00012373007 is resolved.
The change basically sets DLB port status as up when the port is configured in loopback mode. A similar update is made for native BCM implementation also using same API used in this diff.

Reviewed By: msomasundaran

Differential Revision: D67256927

fbshipit-source-id: 1a71f5536d6319f448969aa8440cbd54782d807f
  • Loading branch information
Ravi Vantipalli authored and facebook-github-bot committed Jan 3, 2025
1 parent 30ebd93 commit 9538822
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions fboss/agent/hw/sai/hw_test/HwTestFlowletSwitchingUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#include "fboss/agent/hw/sai/switch/SaiSwitch.h"
#include "fboss/agent/hw/sai/switch/SaiSwitchManager.h"
#include "fboss/agent/hw/sai/switch/SaiVirtualRouterManager.h"
#include "fboss/agent/test/TestEnsembleIf.h"

#include "folly/testing/TestUtil.h"

namespace facebook::fboss {
class TestEnsembleIf;
Expand Down Expand Up @@ -226,8 +229,28 @@ bool validateFlowletSwitchingDisabled(const HwSwitch* hw) {
#endif
}

void setEcmpMemberStatus(const TestEnsembleIf* /* unused */) {
// not applicable to SAI
void runCint(TestEnsembleIf* ensemble, const std::string& cintStr) {
folly::test::TemporaryFile file;
XLOG(INFO) << " Cint file " << file.path().c_str();
folly::writeFull(file.fd(), cintStr.c_str(), cintStr.size());
auto cmd = folly::sformat("cint {}\n", file.path().c_str());
std::string out;
ensemble->runDiagCommand(cmd, out, std::nullopt);
}

void setEcmpMemberStatus(const TestEnsembleIf* ensemble) {
constexpr auto kSetEcmpMemberStatus = R"(
cint_reset();
bcm_l3_egress_ecmp_member_status_set(0, 100003, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100004, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100005, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100006, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100007, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100008, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100009, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
bcm_l3_egress_ecmp_member_status_set(0, 100010, BCM_L3_ECMP_DYNAMIC_MEMBER_FORCE_UP);
)";
runCint(const_cast<TestEnsembleIf*>(ensemble), kSetEcmpMemberStatus);
}

bool validateFlowSetTable(
Expand Down

0 comments on commit 9538822

Please sign in to comment.