UCP: Add user_data to ucp_ep_query #9988
Merged
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.
What
This addition to the endpoint query API adds a new field_mask value that
will instruct ucp_ep_query to return the endpoint's user_data pointer.
Why ?
The UCP API allows the user to register a user_data pointer inside of an
endpoint. Currently this pointer is only exposed back to the user in
the error callback and via ucp_stream_worker_poll.
When working in a code base that has many endpoints associated with a
single worker, the application needs to create a mapping data structure
between endpoints and user data that it accesses in the AM callback.
This is an extra overhead that can be avoided by simply adding a way
to extract the user_data pointer out of the endpoint.