Skip to content

Commit a5dba95

Browse files
daiwei1983meta-codesync[bot]
authored andcommitted
fix sai hw test running with hyper port on viper J3/C0
Summary: as titled, otherwise sai hw test (not agent hw test) will complain 1) unable to find port profile for speed 3.2Tbps and 2) port id outside allowed portIdRange. Differential Revision: D86159745 Privacy Context Container: L1297311 fbshipit-source-id: 8eff75b5fed86066c23722f1fbd6d4e66cf44af4
1 parent 30a0388 commit a5dba95

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

fboss/agent/hw/test/ConfigFactory.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ void setPortToDefaultProfileIDMap(
4848
for (const auto& portMap : std::as_const(*ports)) {
4949
for (const auto& port : std::as_const(*portMap.second)) {
5050
auto profileID = port.second->getProfileID();
51+
cfg::PortType portType = port.second->getPortType();
5152
// In case the profileID learnt from HW is using default, then use speed
5253
// to get the real profileID
53-
if (profileID == cfg::PortProfileID::PROFILE_DEFAULT) {
54+
if (profileID == cfg::PortProfileID::PROFILE_DEFAULT &&
55+
portType != cfg::PortType::HYPER_PORT) {
5456
profileID = platformMapping->getProfileIDBySpeed(
5557
port.second->getID(), port.second->getSpeed());
5658
}

fboss/agent/hw/test/HwSwitchEnsemble.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,8 @@ void HwSwitchEnsemble::setupEnsemble(
639639
cfg::Range64 portIdRange;
640640
portIdRange.minimum() =
641641
cfg::switch_config_constants::DEFAULT_PORT_ID_RANGE_MIN();
642-
portIdRange.maximum() =
643-
cfg::switch_config_constants::DEFAULT_PORT_ID_RANGE_MAX();
642+
portIdRange.maximum() = cfg::switch_config_constants::
643+
DEFAULT_DUAL_STAGE_3Q_2Q_PORT_ID_RANGE_MAX();
644644
switchInfo.portIdRange() = portIdRange;
645645
auto switchIdToSwitchInfo = std::map<int64_t, cfg::SwitchInfo>(
646646
{{asic->getSwitchId() ? *asic->getSwitchId() : 0, switchInfo}});

fboss/agent/test/utils/ConfigUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ cfg::SwitchConfig genPortVlanCfg(
811811
cfg::Range64 portIdRange;
812812
portIdRange.minimum() =
813813
cfg::switch_config_constants::DEFAULT_PORT_ID_RANGE_MIN();
814-
portIdRange.maximum() =
815-
cfg::switch_config_constants::DEFAULT_PORT_ID_RANGE_MAX();
814+
portIdRange.maximum() = cfg::switch_config_constants::
815+
DEFAULT_DUAL_STAGE_3Q_2Q_PORT_ID_RANGE_MAX();
816816
switchInfo.portIdRange() = portIdRange;
817817
switchInfo.switchIndex() = 0;
818818
switchInfo.switchType() = switchType;

0 commit comments

Comments
 (0)