Command submission / completion refactor, making retry logic common#154
Merged
Conversation
Contributor
|
Thanks for the refactor |
We're a MCTP Control Protocol implementation, all our messages will be the control protocol type. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Our arguments for endpoint_query_* are getting large; create a struct to represent the command/response pair, and pass that around instead. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
We have a number of separate retry loops when querying peer properties. Instead, use a common retry loop in the endpoint_query_addr path, which can be disabled by a new 'disable_retry' member on struct mctp_ctrl_cmd. This now enables retries for all commands, except the Get Endpoint ID probe during a recover. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Add a test to verify that Control Protocol IIDs are re-used on a command retry. [This is based on an originial commit from Freddie Jheng <Freddie.Jheng@quantatw.com>, containing the test cases from that commit. Minor modifications from Jeremy Kerr <jk@codeconstruct.com.au>] Signed-off-by: Freddie Jheng <Freddie.Jheng@quantatw.com> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Avoid multiple timeouts while polling downstream bridge endpoints. We'll continue to poll on a command timeout anyway. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
d616ab5 to
4186b5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A bit of a refactor to the MCTP command submission path, which allows us to implement a common retry mechanism (rather than having each top-level command caller implement its own retry logic).
Commands are now represented via a new struct:
- which encapsulates the request & response buf/length, and retry behaviour.
This PR is based on functionality requested in #152; we want to re-use the command IID for retries.