Skip to content
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

Merged

Conversation

pavel-shirshov
Copy link
Contributor

@pavel-shirshov pavel-shirshov commented Jun 6, 2018

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.

@pavel-shirshov pavel-shirshov requested a review from lguohan June 6, 2018 23:56
@pavel-shirshov pavel-shirshov self-assigned this Jun 6, 2018
@pavel-shirshov pavel-shirshov changed the title [portsorch]: Bring the physical ports are only after buffer configuration was applied [portsorch]: Bring the physical ports up are only after buffer configuration was applied Jun 7, 2018
bool result = true;
for (const auto& key: list_of_keys)
{
result &= m_ready_list.at(key);
Copy link
Contributor

@qiluo-msft qiluo-msft Jun 7, 2018

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;
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_ready_list.find()
m_ready_list[]


In reply to: 193597878 [](ancestors = 193597878)

Copy link
Contributor Author

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;
Copy link
Contributor

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

@qiluo-msft qiluo-msft requested a review from stcheng June 7, 2018 00:28
@pavel-shirshov pavel-shirshov merged commit 2176688 into sonic-net:master Jun 8, 2018
@pavel-shirshov pavel-shirshov deleted the pavelsh/up_after_qos branch June 8, 2018 23:46
lguohan pushed a commit that referenced this pull request Jun 25, 2018
…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
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…onic-net#515)

* If fast-reboot-dump gives an error, don't continue with fast-reboot
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
* Add warm boot support with removed/created port

* Fix aspell

* Update sai_warmboot.bin location to local folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants