Command submission / completion refactor, making retry logic common#154
Open
jk-ozlabs wants to merge 8 commits into
Open
Command submission / completion refactor, making retry logic common#154jk-ozlabs wants to merge 8 commits into
jk-ozlabs wants to merge 8 commits into
Conversation
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>
We're currently reporting a failure from a Get Endpoint UUID command through query_peer_properties, which will prevent endpoint setup. Instead, don't return an error if the Get Endpoint UUID command fails; this makes query_peer_properties() infallible, so change the return type to void, and remove caller error handling. Reported-by: Freddie Jheng <Freddie.Jheng@quantatw.com> 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>
…t setup The three peer query commands (Get Message Type Support, Get VDM Support, and Get Endpoint UUID) may be unimplemented, but that shouldn't prevent endpoint setup. Add a test for failures of these three commands. In this case, "failure" may take two forms: the command response reports ERROR_UNSUPPORTED_CMD, or the command is dropped altogether (not ideal, but a lot of endpoints seem to do this). Check that either behaviour is accepted. 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>
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.