[portsorch]: Rewrite validatePortSpeed() method. Use true lazy approach#506
Merged
pavel-shirshov merged 4 commits intosonic-net:masterfrom May 17, 2018
Merged
Conversation
…true for erross also. Even we receive an error, we could move further. It's not critical
lguohan
reviewed
May 17, 2018
|
|
||
| } | ||
|
|
||
| PortSupportedSpeeds &supp_speeds = m_portSupportedSpeeds[port_id]; |
Contributor
There was a problem hiding this comment.
m_portSupportedSpeeds [](start = 39, length = 21)
we need to remove the port_id from m_portSupprtedSpeeds when the port is removed. but this is seems like a bug exist already.
oleksandrivantsiv
pushed a commit
to oleksandrivantsiv/sonic-swss
that referenced
this pull request
Mar 1, 2023
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…ch (sonic-net#506) * We have enough logging inside of the method. Remove the excessive one * Rewrite portsorch::validatespeed. Use true lazy approach to minimize SAI get operations on each port * Restore the missed attr.id * Rename validatePortSpeed to isSpeedSupported. Change logic to return true for erross also. Even we receive an error, we could move further. It's not critical
jianyuewu
pushed a commit
to jianyuewu/sonic-swss
that referenced
this pull request
Dec 24, 2025
…name. (sonic-net#506) **Why I did it** The getLinkByName may fail because of the outdated netlink cache **How I did it** Refill the netlink cache when we fail to get link object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
I've overwritten validatePortSpeed() method of PortsOrch class. Also I've rename it to more suitable
isSpeedSupported.Previously:
speedis not found in the list of speeds.Now:
speednot in the list of successfully returned supported speeds. Otherwise it's always true.Why I did it
Because this method slowed fast-reboot operations down (multiple get operations).
Also this method gave a noise with false ERRORs in the syslog.
How I verified it
Build and run on my DUT
Details if related