mctpd: Improve sequencing of Set Endpoint ID responses in endpoint mode#157
Open
jk-ozlabs wants to merge 3 commits into
Open
mctpd: Improve sequencing of Set Endpoint ID responses in endpoint mode#157jk-ozlabs wants to merge 3 commits into
jk-ozlabs wants to merge 3 commits into
Conversation
setup_added_peer() does a few things: - adds the local route - queries the peer for UUID and message types - publishes the peer to dbus We will need the local route established earlier in some cases, so move this out of setup_added_peer. We have five current callers: - peer_endpoint_poll(), which already relies on a bridge pool route to be present - the endpoint Set Endpoint ID handler, where we add a new add_peer_route() - endpoint_assign_eid(), which already has an add_peer_route() - get_endpoint_peer(), which only needs a route added in some cases, where the endpoint was not previously known (the change_peer_eid() will also set up the new route) - method_setup_endpoint, where we add a new add_peer_route() This involves correcting the route counts in a couple of test cases: these are was expecting two routes to be present (assumed to be the local route and the new peer route), but they are duplicates, as a result of the existing add_peer_route(), setup_added_peer() in the existing Set Endpoint ID handler. Conveniently, the setup_added_peer()'s comment will now match the implementation. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
The peer setup will issue queries to the (bus owner) peer, and we will block waiting on responses to those. Respond to the Set Endpoint ID command first, then perform the queries. Reported-by: Nidhin MS <nidhin.ms@intel.com> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
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.
When running in endpoint mode, mctpd's Set Endpoint ID command handler will trigger an enumeration of the peer (ie, the bus owner that issued the Set Endpoint ID command).
Currently, that enumeration occurs before we send the Set Endpoint ID response, which is a little unexpected: at that point, the bus owner has not received any indication that the command completed successfully. Also, the wait on the set of peer-enumeration commands may delay the Set Endpoint ID response beyond a command timeout.
So, respond to the Set Endpoint ID command first, then perform peer enumeration. This requires a minor rework to the
setup_endpoint_peer()process, as we will need to establish routes beforehand.