Skip to content

Commit 9d38663

Browse files
[chassis] Fixed bug in Fabric monitor capacity (#4057)
What I did sonic-net/sonic-buildimage#24828 Fixed a bug in updateFabricCapacity for fabric monitor feature . Without this fix, the show fabric monitor shows wrong operating links and also raises the false alarm in the syslog which could trigger the monitoring tool to isolate the chassis in the production. In the below output, only 1 port was isolated out of 24 ports, however the operating links shows only 5. image Why I did it When the fabric port sees CRC/FEC-Uncorrectable error, the Fabric monitor feature Isolates the port and sets the ISOALTED=1 and also AUTO_ISOLATED=1 in the STATE_DB for that port in the FABRIC_PORT_TABLE. The field ISOLATED and CONFIG_ISOLATED are always present for all the fabric ports in FABRIC_PORT_TABLE. However the field AUTO_ISOLATED is not present always and added only when the port is auto ISOLATED. So due to the bug in the updateFabricCapacity function, the operating_links is calculated wrong, and the syslog is printed even if 1 link is isolated and didn't reach the threshold.
1 parent 8aca780 commit 9d38663

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

orchagent/fabricportsorch.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,6 @@ void FabricPortsOrch::updateFabricCapacity()
10471047
// Init value for fabric capacity monitoring
10481048
int capacity = 0;
10491049
int downCapacity = 0;
1050-
string lnkStatus = "down";
1051-
string configIsolated = "0";
1052-
string isolated = "0";
1053-
string autoIsolated = "0";
10541050
int operating_links = 0;
10551051
int total_links = 0;
10561052
int threshold = 100;
@@ -1088,6 +1084,10 @@ void FabricPortsOrch::updateFabricCapacity()
10881084
string key = FABRIC_PORT_PREFIX + to_string(lane);
10891085
std::vector<FieldValueTuple> values;
10901086
string valuePt;
1087+
string lnkStatus = "down";
1088+
string configIsolated = "0";
1089+
string isolated = "0";
1090+
string autoIsolated = "0";
10911091

10921092
// Get fabric serdes link status from STATE_DB
10931093
bool exist = m_stateTable->get(key, values);

0 commit comments

Comments
 (0)