[portsorch] don't set serdes attributes when there's no change #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Fixing an issue when setting some port attribute in APPL_DB triggers serdes parameters to be re-programmed with port toggling.
I removed the code that cached serdes attributes into
m_preemphasis
when LT is on, since serdes attributes are always inpCfg
and setting them only when LT is off.Why I did it
To fix an issue seen on warm-reboot. After orchagent reconciles, portmgrd sends another update to APPL_DB PORT_TABLE to sync. Usually all the parameters are expected to be the same. e.g. speed, mtu, serdes attributes etc. unless a configuration change occurs or cable is reconnected. Normally that shouldn't happen during warm-reboot, so portsorch has a logic behind every attributes that if the cached value of the attribute is the same as the new one from the update then no operation is performed. This is how speed set is protected during warm-reboot, so that no port flapping occurs.
However, serdes attributes didn't have such protection check and unconditionally re-set serdes attributes on any port attribute change, e.g.:
How I verified it
By changing mtu of the interface I verified there was not port toggling and running warm-reboot test on T0 topology.
Details if related