Skip to content

portsorch ports init done flag should means buffer, autoneg, speed, m…#747

Merged
lguohan merged 3 commits intosonic-net:masterfrom
jipanyang:pending_config_port_set
Jan 30, 2019
Merged

portsorch ports init done flag should means buffer, autoneg, speed, m…#747
lguohan merged 3 commits intosonic-net:masterfrom
jipanyang:pending_config_port_set

Conversation

@jipanyang
Copy link
Contributor

…tu, fec and other port level initial config done too.

Signed-off-by: Jipan Yang jipan.yang@alibaba-inc.com

What I did

Make sure physical port config is done before proceeding to other configurations which have dependency on physical port.

Why I did it
Other high level objects like lag, vlan, interface, acl, copp, pfc, mirror, qos, tunnel, route, and etc. check gPortsOrch->isInitDone() before proceeding their tasks.

The change in #515 altered the meaning of gPortsOrch->isInitDone(), and caused the possibility that physical port parameter setting may not be done though gPortsOrch->isInitDone() had become true, that introduced potential instability.

How I verified it

Details if related

@jipanyang jipanyang force-pushed the pending_config_port_set branch 3 times, most recently from 2ce2a2e to 85da18b Compare January 17, 2019 16:56
@jipanyang jipanyang force-pushed the pending_config_port_set branch from 85da18b to 1da89c7 Compare January 18, 2019 06:32
@qiluo-msft
Copy link
Contributor

qiluo-msft commented Jan 24, 2019

You mentioned 'potential instability', do you have a vs unit test case to cover it? Actually it is hard to understand the instability, could you elaborate? #Closed

@jipanyang
Copy link
Contributor Author

jipanyang commented Jan 24, 2019

@qiluo-msft Currently most orches in orchagent wait for gPortsOrch->isInitDone() signal to start their processing.

Port level attributes like pfc_asym, fec mode, admin, mtu, speed, autoneg won't be applied until bufferorch finishes its job.

Before this change, at system initialization phase, all the orches like pfcorch, aclorch, copporch, fdborch, intfsorch, tunnorch, routorch, qosorch will race with bufferorch to run the task once they saw gPortsOrch->isInitDone() is ready.

Then pfc_asym, fec mode, admin, mtu, speed, autoneg may be set after pfcorch, intforch and others have done the first initialization.

Since those port level config is the very fundamental attributes for the whole system config, one example is the mtu, if intforch has used the default mtu to create router interface, the rif mtu has to be changed again to match the configured mtu, it is better to have the right mtu ready at the very beginning to avoid the flapping, especially during system initialization.

I'm not sure whether pfc_asym, fec, speed, autoneg and admin have similar impact on current or even future orch objects. But having a deterministic startup order helps to remove the unnecessary sai operation and avoid potential dependency problems.

#Resolved

…tu, fec and other port level initial config done too.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang force-pushed the pending_config_port_set branch from 1da89c7 to 89f4a88 Compare January 25, 2019 05:39
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang force-pushed the pending_config_port_set branch from 89f4a88 to d5447e7 Compare January 25, 2019 07:16
@@ -386,10 +386,17 @@ void PortsOrch::removeDefaultBridgePorts()
}

bool PortsOrch::isInitDone()
Copy link
Contributor

Choose a reason for hiding this comment

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

isInitDone [](start = 16, length = 10)

The names of functions and member variables are confusing. Suggest:

bool PortsOrch::isPortReady()
{
    return m_initDone && m_pendingPortSet.empty();
}

/* Upon receiving PortInitDone, all the configured ports have been created*/
bool PortsOrch::isInitDone()
{
    return m_initDone;
}

@qiluo-msft
Copy link
Contributor

Could you add a vs test?

Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

As comments

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang force-pushed the pending_config_port_set branch from eb6d592 to 7e1e151 Compare January 28, 2019 20:07
@jipanyang
Copy link
Contributor Author

@qiluo-msft It is kind of hard to design VS test for the swss orchagent objects initialization order. Maybe we could think more about it in KVM test setup.

@lguohan lguohan merged commit 316ae6c into sonic-net:master Jan 30, 2019
@yxieca
Copy link
Contributor

yxieca commented Feb 5, 2019

This change has merge conflict with 201811 branch. Cannot be cherry-picked directly.

yxieca added a commit to yxieca/sonic-swss that referenced this pull request Feb 5, 2019
sonic-net#747)

* portsorch ports init done flag should means buffer, autoneg, speed, mtu, fec and other port level initial config done too.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Change to four iterations for warm data restore with ordered port init

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Rename port readiness check functions to avoid confusion.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
yxieca added a commit that referenced this pull request Feb 5, 2019
#747) (#783)

* portsorch ports init done flag should means buffer, autoneg, speed, mtu, fec and other port level initial config done too.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Change to four iterations for warm data restore with ordered port init

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Rename port readiness check functions to avoid confusion.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang deleted the pending_config_port_set branch June 10, 2019 23:36
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
The PR implements the handling of the sairedis rec filename passed to the orchagent.
Corresponding swss pr : sonic-net#1546
This change is mainly to be used for multi asic devices where each asic.

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
sonic-net#747)

* portsorch ports init done flag should means buffer, autoneg, speed, mtu, fec and other port level initial config done too.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Change to four iterations for warm data restore with ordered port init

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>

* Rename port readiness check functions to avoid confusion.

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
jianyuewu pushed a commit to jianyuewu/sonic-swss that referenced this pull request Dec 24, 2025
The path to the sairedis test binary (for `setcap`) has changed after
sonic-net/sonic-sairedis#1197. Update the path here.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
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.

4 participants