Skip to content

Commit

Permalink
Verify FEC tail in UTs
Browse files Browse the repository at this point in the history
Summary: Updated the Fake eeprom and put some valid values for FEC tails and then verified them in the tests

Reviewed By: xanabani

Differential Revision: D61341636

fbshipit-source-id: e8e9392e5d66e22ed8f09a26e55c9db5553e062e
  • Loading branch information
Harshit Gulati authored and facebook-github-bot committed Aug 15, 2024
1 parent 5b68df5 commit f7cc586
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 11 deletions.
38 changes: 38 additions & 0 deletions fboss/qsfp_service/module/tests/CmisTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,16 @@ TEST_F(CmisTest, cmis2x400GFr4TransceiverVdmTest) {
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x24));
EXPECT_EQ(vdmLocationInfo.vdmValOffset, 208);
EXPECT_EQ(vdmLocationInfo.vdmValLength, 16);
vdmLocationInfo = xcvr->getVdmDiagsValLocation(FEC_TAIL_MEDIA_IN_MAX);
EXPECT_TRUE(vdmLocationInfo.vdmConfImplementedByModule);
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x24));
EXPECT_EQ(vdmLocationInfo.vdmValOffset, 224);
EXPECT_EQ(vdmLocationInfo.vdmValLength, 16);
vdmLocationInfo = xcvr->getVdmDiagsValLocation(FEC_TAIL_MEDIA_IN_CURR);
EXPECT_TRUE(vdmLocationInfo.vdmConfImplementedByModule);
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x24));
EXPECT_EQ(vdmLocationInfo.vdmValOffset, 240);
EXPECT_EQ(vdmLocationInfo.vdmValLength, 16);
vdmLocationInfo = xcvr->getVdmDiagsValLocation(SNR_HOST_IN);
EXPECT_TRUE(vdmLocationInfo.vdmConfImplementedByModule);
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x25));
Expand All @@ -827,6 +837,16 @@ TEST_F(CmisTest, cmis2x400GFr4TransceiverVdmTest) {
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x25));
EXPECT_EQ(vdmLocationInfo.vdmValOffset, 208);
EXPECT_EQ(vdmLocationInfo.vdmValLength, 16);
vdmLocationInfo = xcvr->getVdmDiagsValLocation(FEC_TAIL_HOST_IN_MAX);
EXPECT_TRUE(vdmLocationInfo.vdmConfImplementedByModule);
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x25));
EXPECT_EQ(vdmLocationInfo.vdmValOffset, 224);
EXPECT_EQ(vdmLocationInfo.vdmValLength, 16);
vdmLocationInfo = xcvr->getVdmDiagsValLocation(FEC_TAIL_HOST_IN_CURR);
EXPECT_TRUE(vdmLocationInfo.vdmConfImplementedByModule);
EXPECT_EQ(vdmLocationInfo.vdmValPage, static_cast<CmisPages>(0x25));
EXPECT_EQ(vdmLocationInfo.vdmValOffset, 240);
EXPECT_EQ(vdmLocationInfo.vdmValLength, 16);
vdmLocationInfo =
xcvr->getVdmDiagsValLocation(PAM4_LEVEL0_STANDARD_DEVIATION_LINE);
EXPECT_TRUE(vdmLocationInfo.vdmConfImplementedByModule);
Expand Down Expand Up @@ -967,6 +987,24 @@ TEST_F(CmisTest, cmis2x400GFr4TransceiverVdmTest) {
.value() *
100),
132);
EXPECT_EQ(
newInfo.tcvrStats()
->vdmPerfMonitorStatsForOds()
->mediaPortVdmStats()
.value()
.begin()
->second.fecTailMax()
.value(),
2);
EXPECT_EQ(
newInfo.tcvrStats()
->vdmPerfMonitorStatsForOds()
->hostPortVdmStats()
.value()
.begin()
->second.fecTailMax()
.value(),
3);

EXPECT_EQ(
newInfo.tcvrStats()
Expand Down
22 changes: 11 additions & 11 deletions fboss/qsfp_service/module/tests/FakeTransceiverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,8 @@ std::array<uint8_t, 128> kCmis2x400GFr4Page20 = {
0x34, 0x13, 0x35, 0x13, 0x36, 0x13, 0x37, 0x13, 0x30, 0x15, 0x31, 0x15,
0x32, 0x15, 0x33, 0x15, 0x34, 0x15, 0x35, 0x15, 0x36, 0x15, 0x37, 0x15,
0x40, 0x6a, 0x41, 0x6a, 0x42, 0x6a, 0x43, 0x6a, 0x44, 0x6a, 0x45, 0x6a,
0x46, 0x6a, 0x47, 0x6a, 0x40, 0x6a, 0x41, 0x6a, 0x42, 0x6a, 0x43, 0x6a,
0x44, 0x6a, 0x45, 0x6a, 0x46, 0x6a, 0x47, 0x6a};
0x46, 0x6a, 0x47, 0x6a, 0x40, 0x6b, 0x41, 0x6b, 0x42, 0x6b, 0x43, 0x6b,
0x44, 0x6b, 0x45, 0x6b, 0x46, 0x6b, 0x47, 0x6b};

std::array<uint8_t, 128> kCmis2x400GFr4Page21 = {
0x0, 0x6, 0x1, 0x6, 0x2, 0x6, 0x3, 0x6, 0x4, 0x6, 0x5, 0x6,
Expand All @@ -968,9 +968,9 @@ std::array<uint8_t, 128> kCmis2x400GFr4Page21 = {
0x26, 0xe, 0x27, 0xe, 0x30, 0x14, 0x31, 0x14, 0x32, 0x14, 0x33, 0x14,
0x34, 0x14, 0x35, 0x14, 0x36, 0x14, 0x37, 0x14, 0x30, 0x16, 0x31, 0x16,
0x32, 0x16, 0x33, 0x16, 0x34, 0x16, 0x35, 0x16, 0x36, 0x16, 0x37, 0x16,
0x40, 0x6b, 0x41, 0x6b, 0x42, 0x6b, 0x43, 0x6b, 0x44, 0x6b, 0x45, 0x6b,
0x46, 0x6b, 0x47, 0x6b, 0x40, 0x6b, 0x41, 0x6b, 0x42, 0x6b, 0x43, 0x6b,
0x44, 0x6b, 0x45, 0x6b, 0x46, 0x6b, 0x47, 0x6b};
0x40, 0x6c, 0x41, 0x6c, 0x42, 0x6c, 0x43, 0x6c, 0x44, 0x6c, 0x45, 0x6c,
0x46, 0x6c, 0x47, 0x6c, 0x40, 0x6d, 0x41, 0x6d, 0x42, 0x6d, 0x43, 0x6d,
0x44, 0x6d, 0x45, 0x6d, 0x46, 0x6d, 0x47, 0x6d};

std::array<uint8_t, 128> kCmis2x400GFr4Page22 = {
0x00, 0x64, 0x01, 0x64, 0x02, 0x64, 0x03, 0x64, 0x04, 0x64, 0x05, 0x64,
Expand All @@ -994,9 +994,9 @@ std::array<uint8_t, 128> kCmis2x400GFr4Page24 = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
0x0, 0x2, 0x0, 0x2, 0x0, 0x2, 0x0, 0x2, 0x0, 0x2, 0x0, 0x2,
0x0, 0x2, 0x0, 0x2, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1,
0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1};

std::array<uint8_t, 128> kCmis2x400GFr4Page25 = {
0x17, 0xde, 0x17, 0xde, 0x16, 0xc0, 0x17, 0x80, 0x18, 0xc0, 0x17, 0x9e,
Expand All @@ -1007,9 +1007,9 @@ std::array<uint8_t, 128> kCmis2x400GFr4Page25 = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3,
0x0, 0x3, 0x0, 0x3, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1,
0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1};

std::array<uint8_t, 128> kCmis2x400GFr4Page26 = {
0xae, 0x83, 0xae, 0x92, 0xae, 0xc4, 0xae, 0xf7, 0xae, 0xa6, 0xaf, 0x36,
Expand Down

0 comments on commit f7cc586

Please sign in to comment.