From ef329b049f18eef587d538fcb813a98ac627edda Mon Sep 17 00:00:00 2001 From: Chet Powers Date: Tue, 20 Aug 2024 15:24:10 -0700 Subject: [PATCH] Add port 65 to the BSP mapping Summary: DVT units now have 65 ports (new management port was added). Port 65 was missing from the platform mapping, so we weren't tracking this port in qsfp_service. This was causing some issues in CLIs that expected this port to exist in the qsfp CLIs (since it exists in the agent CLIs) Reviewed By: harshitgulati18 Differential Revision: D61502040 fbshipit-source-id: 289463fb12669b37e4f8fc3a5b642f6c2ef310a5 --- .../bspmapping/input/Montblanc_BspMapping.csv | 1 + .../montblanc/MontblancBspPlatformMapping.cpp | 37 +++++++++++++++++++ .../qsfp_service/test/BspPlatformMapTest.cpp | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/fboss/lib/bsp/bspmapping/input/Montblanc_BspMapping.csv b/fboss/lib/bsp/bspmapping/input/Montblanc_BspMapping.csv index b863a26afb34e..049bb2888a1da 100644 --- a/fboss/lib/bsp/bspmapping/input/Montblanc_BspMapping.csv +++ b/fboss/lib/bsp/bspmapping/input/Montblanc_BspMapping.csv @@ -127,3 +127,4 @@ TcvrId,TcvrLaneIdList,PimId,AccessControllerId,AccessControlType,ResetPath,Reset 63,5 6 7 8,1,63,CPLD,/run/devmap/xcvrs/xcvr_63/xcvr_reset_63,1,1,/run/devmap/xcvrs/xcvr_63/xcvr_present_63,1,0,63,I2C,/run/devmap/i2c-busses/XCVR_63,126,/sys/class/leds/port63_led2:blue:status,/sys/class/leds/port63_led2:yellow:status 64,1 2 3 4,1,64,CPLD,/run/devmap/xcvrs/xcvr_64/xcvr_reset_64,1,1,/run/devmap/xcvrs/xcvr_64/xcvr_present_64,1,0,64,I2C,/run/devmap/i2c-busses/XCVR_64,127,/sys/class/leds/port64_led1:blue:status,/sys/class/leds/port64_led1:yellow:status 64,5 6 7 8,1,64,CPLD,/run/devmap/xcvrs/xcvr_64/xcvr_reset_64,1,1,/run/devmap/xcvrs/xcvr_64/xcvr_present_64,1,0,64,I2C,/run/devmap/i2c-busses/XCVR_64,128,/sys/class/leds/port64_led2:blue:status,/sys/class/leds/port64_led2:yellow:status +65,1 2 3 4,1,65,CPLD,/run/devmap/xcvrs/xcvr_65/xcvr_reset_65,1,1,/run/devmap/xcvrs/xcvr_65/xcvr_present_65,1,0,65,I2C,/run/devmap/i2c-busses/XCVR_65,129,/sys/class/leds/port65_led1:blue:status,/sys/class/leds/port65_led1:yellow:status diff --git a/fboss/lib/bsp/montblanc/MontblancBspPlatformMapping.cpp b/fboss/lib/bsp/montblanc/MontblancBspPlatformMapping.cpp index 55b7300a36ece..8d2a48a06b022 100644 --- a/fboss/lib/bsp/montblanc/MontblancBspPlatformMapping.cpp +++ b/fboss/lib/bsp/montblanc/MontblancBspPlatformMapping.cpp @@ -2254,6 +2254,37 @@ constexpr auto kJsonBspPlatformMappingStr = R"( "7": 128, "8": 128 } + }, + "65": { + "tcvrId": 65, + "accessControl": { + "controllerId": "65", + "type": 1, + "reset": { + "sysfsPath": "/run/devmap/xcvrs/xcvr_65/xcvr_reset_65", + "mask": 1, + "gpioOffset": 0, + "resetHoldHi": 1 + }, + "presence": { + "sysfsPath": "/run/devmap/xcvrs/xcvr_65/xcvr_present_65", + "mask": 1, + "gpioOffset": 0, + "presentHoldHi": 0 + }, + "gpioChip": "" + }, + "io": { + "controllerId": "65", + "type": 1, + "devicePath": "/run/devmap/i2c-busses/XCVR_65" + }, + "tcvrLaneToLedId": { + "1": 129, + "2": 129, + "3": 129, + "4": 129 + } } }, "phyMapping": {}, @@ -3026,6 +3057,12 @@ constexpr auto kJsonBspPlatformMappingStr = R"( "bluePath": "/sys/class/leds/port64_led2:blue:status", "yellowPath": "/sys/class/leds/port64_led2:yellow:status", "transceiverId": 64 + }, + "129": { + "id": 129, + "bluePath": "/sys/class/leds/port65_led1:blue:status", + "yellowPath": "/sys/class/leds/port65_led1:yellow:status", + "transceiverId": 65 } } } diff --git a/fboss/qsfp_service/test/BspPlatformMapTest.cpp b/fboss/qsfp_service/test/BspPlatformMapTest.cpp index e4e7296e3d51b..778556d2baf8b 100644 --- a/fboss/qsfp_service/test/BspPlatformMapTest.cpp +++ b/fboss/qsfp_service/test/BspPlatformMapTest.cpp @@ -19,7 +19,7 @@ TEST_F(BspPlatformMapTest, checkNumPimTransceivers) { // Check Montblanc auto mbBspPlatformMap = MontblancBspPlatformMapping(); EXPECT_EQ(mbBspPlatformMap.numPims(), 1); - EXPECT_EQ(mbBspPlatformMap.numTransceivers(), 64); + EXPECT_EQ(mbBspPlatformMap.numTransceivers(), 65); // Check Kamet auto m400bfuBspPlatformMap = Meru400bfuBspPlatformMapping(); EXPECT_EQ(m400bfuBspPlatformMap.numPims(), 1);