-
Notifications
You must be signed in to change notification settings - Fork 694
Tune consumer order in BufferOrch::doTask() based on dependency for warm start #590
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
Changes from 4 commits
8bda1b5
8614d39
3b86fda
46ba706
b456b57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -635,6 +635,38 @@ task_process_status BufferOrch::processEgressBufferProfileList(Consumer &consume | |
| return task_process_status::task_success; | ||
| } | ||
|
|
||
| void BufferOrch::doTask() | ||
| { | ||
| // The hidden dependency tree: | ||
| // ref: https://github.com/opencomputeproject/SAI/blob/master/doc/QOS/SAI-Proposal-buffers-Ver4.docx | ||
| // 2 SAI model | ||
| // 3.1 Ingress priority group (PG) configuration | ||
| // 3.2.1 Buffer profile configuration | ||
| // | ||
| // buffer poll | ||
| // └── buffer profile | ||
| // ├── buffer port ingress profile list | ||
| // ├── buffer port egress profile list | ||
| // ├── buffer queue | ||
| // └── buffer pq table | ||
|
|
||
| auto pool_consumer = getExecutor((CFG_BUFFER_POOL_TABLE_NAME)); | ||
| pool_consumer->drain(); | ||
|
|
||
| auto profile_consumer = getExecutor(CFG_BUFFER_PROFILE_TABLE_NAME); | ||
| profile_consumer->drain(); | ||
|
|
||
| for(auto &it : m_consumerMap) | ||
| { | ||
| auto consumer = it.second.get(); | ||
| if (consumer == profile_consumer) | ||
| continue; | ||
| if (consumer == pool_consumer) | ||
| continue; | ||
| consumer->drain(); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean the configuration for other buffer tables like CFG_BUFFER_QUEUE_TABLE_NAME, CFG_BUFFER_PG_TABLE_NAME, CFG_BUFFER_PORT_INGRESS_PROFILE_LIST_NAME and CFG_BUFFER_PORT_EGRESS_PROFILE_LIST_NAME have dependency on CFG_BUFFER_PROFILE_TABLE_NAME & CFG_BUFFER_POOL_TABLE_NAME? CFG_BUFFER_PROFILE_TABLE_NAME has dependency on CFG_BUFFER_POOL_TABLE_NAME? I didn't see existing code checking that dependency. #Resolved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly, so I added comments. The ground truth is inside SAI design doc. In reply to: 212513136 [](ancestors = 212513136)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is dependency, the exact dependency chain should be clarified and the problem should be fixed in normal code logic which applies to cold boot too. #Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is difficult to do this in the normal boot since the input sequence is unknown. we need to get the dependency at the entry level and then dispatched to task. in warmboot, since we have all the data, we can just solve the dependency at the table level.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. During cold start, the task_process_status::task_need_retry handles dependency correctly, ie. anything missing will postpone task processing. So there is no problem to fix. In reply to: 212527615 [](ancestors = 212527615) |
||
| } | ||
|
|
||
| void BufferOrch::doTask(Consumer &consumer) | ||
| { | ||
| SWSS_LOG_ENTER(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,7 +264,11 @@ bool OrchDaemon::init() | |
|
|
||
| if (WarmStart::isWarmStart()) | ||
| { | ||
| warmRestoreAndSyncUp(); | ||
| bool suc = warmRestoreAndSyncUp(); | ||
| if (!suc) | ||
| { | ||
| return false; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from line 265 - 274 it could be ine one line
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is equivalent. I prefer no change for easy reading. #Closed |
||
| } | ||
|
|
||
| return true; | ||
|
|
@@ -336,7 +340,7 @@ void OrchDaemon::start() | |
| * Try to perform orchagent state restore and dynamic states sync up if | ||
| * warm start reqeust is detected. | ||
| */ | ||
| void OrchDaemon::warmRestoreAndSyncUp() | ||
| bool OrchDaemon::warmRestoreAndSyncUp() | ||
| { | ||
| WarmStart::setWarmStartState("orchagent", WarmStart::INIT); | ||
|
|
||
|
|
@@ -366,7 +370,12 @@ void OrchDaemon::warmRestoreAndSyncUp() | |
| * orchagent should be in exact same state of pre-shutdown. | ||
| * Perform restore validation as needed. | ||
| */ | ||
| warmRestoreValidation(); | ||
| bool suc = warmRestoreValidation(); | ||
| if (!suc) | ||
| { | ||
| SWSS_LOG_ERROR("Orchagent state restore failed"); | ||
| return false; | ||
| } | ||
|
|
||
| SWSS_LOG_NOTICE("Orchagent state restore done"); | ||
|
|
||
|
|
@@ -377,6 +386,7 @@ void OrchDaemon::warmRestoreAndSyncUp() | |
| * The "RECONCILED" state of orchagent doesn't mean the state related to neighbor is up to date. | ||
| */ | ||
| WarmStart::setWarmStartState("orchagent", WarmStart::RECONCILED); | ||
| return true; | ||
| } | ||
|
|
||
| /* | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
buffer pool #Resolved