Open pavel-shirshov opened 6 years ago
portstat show counter's value in two mode, namely absolute mode and relative mode .
When running command portstat -c, the value of counters will be saved in tmp file and portstat run into relative mode. In relative mode , portstat will show the diff between counters' current value and old value saved in tmp file, namely print(current - old)
. When running command portstat -D, portstat will clear tmp file and run into absolute mode. In this mode, portstat will show the absolute value of current counters, namely print(current)
.
So, portstat shows negative counter because it's in relative mode and its current value is smaller than old value saved in tmp file . There are two logical possiblities, one is the RX_OK's value is lagger than uint64 and integer overflow happends in sonic-syncd, which is very unlikely. The other is the RX_OK's value provided by SAI is less than uint64 and integer overflow happends in SAI or SDK, which is very likely. So you may check the register's bit width provided by SAI and SDK.