-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[portsorch]: Bring the physical ports up are only after buffer configuration was applied #515
[portsorch]: Bring the physical ports up are only after buffer configuration was applied #515
Conversation
orchagent/bufferorch.cpp
Outdated
bool result = true; | ||
for (const auto& key: list_of_keys) | ||
{ | ||
result &= m_ready_list.at(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&= [](start = 15, length = 2)
Better not use bitwise operator on bool. #Closed
|
||
if (m_ready_list.find(key) != m_ready_list.end()) | ||
{ | ||
m_ready_list[key] = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_ready_list [](start = 8, length = 12)
search the key twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please elaborate on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (m_ready_list.find(key) != m_ready_list.end())
{
m_ready_list[key] = true;
vs
auto ready_list_it = m_ready_list.find(key);
if (ready_list_it != m_ready_list.end())
{
*ready_list_it = true;
I think first case is more readable, although it might be slightly slower in case the compiler will not optimize it.
That code is not on he hot path, so I preferred to use better readability here.
|
||
if (m_ready_list.find(key) != m_ready_list.end()) | ||
{ | ||
m_ready_list[key] = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_ready_list [](start = 8, length = 12)
the same
…uration was applied (#515) * Don't up ports, until buffer configuration is applied * Set MTU first, then set port state to UP * Introduce the test * Use logical operator && for boolean values
…onic-net#515) * If fast-reboot-dump gives an error, don't continue with fast-reboot
* Add warm boot support with removed/created port * Fix aspell * Update sai_warmboot.bin location to local folder
What I did
I created an extra logic to bring the ports UP only after the buffer configuration was applied. If there is no any buffer configuration on the device, orchagent brings the ports UP immediately. This change suppose all buffer configuration on the disk before SONiC starts orch agent.
As a side change I put changing MTU operation before changing MTU state operation.
Why I did it
It's possible to create a deadlock in ASIC pipeline when we change buffer configurations with ports which are active
How I verified it
Build and run on DUT. Ensure that /var/log/swss/sairedis.rec contains ADMIN_STATE = true attribute after BUFFER_PROFILE application to the ports.
Details if related
The test is not comprehensive. vs docker already has buffer configuration, so it's impossible to test the container without any buffers.