netvsp: always wait for coordinator to process messages from the primary worker #2370
+216
−153
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.
There have been several issues with starting the primary worker before the last message was processed (specifically the message to switch the data path). These have been resolved as discovered, but there is still at least one race, and generally this should be made harder to get wrong. Change the protocol to put the primary worker in a "waiting" state, and only after the message has been processed is it returned to 'ready'. The state is used to determine if it should be restarted, so it should never actually start running in the 'waiting' state, but just in case that will pend instead of running the main_loop.
I was not able to hit the latest race condition via unit test, but the test code has been updated with fixes and behavior updates that more closely match real devices.