Repository navigation
API/UCP/UCT/IODEMO: Add functions to query the ucp and uct endpoints - #7020
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
bot:pipe:retest |
yosefe
left a comment
There was a problem hiding this comment.
pls also add gtest for UCP and UCT query
| if (!ucs_sockaddr_is_known_af(src_addr)) { | ||
| memset(dst_addr, 0, sizeof(*dst_addr)); | ||
| } else { | ||
| status = ucs_sockaddr_copy(dst_addr, src_addr); | ||
| ucs_assert_always(status == UCS_OK); | ||
| } |
There was a problem hiding this comment.
if AF not known ucs_sockaddr_copy would fail anyway
There was a problem hiding this comment.
@yosefe Yes, so ucs_sockaddr_copy is called only when AF is known. What we should change here?
There was a problem hiding this comment.
@yosefe Or do you mean no need to check the condition ucs_sockaddr_is_known_af(src_addr), just do ucs_sockaddr_copy() anyway?
There was a problem hiding this comment.
yes, no need to define ucp_sockaddr_copy_always() function
also it's ucs function so should have been ucs_sockaddr_copy_always
|
bot:pipe:retest |
| if (!ucs_sockaddr_is_known_af(src_addr)) { | ||
| memset(dst_addr, 0, sizeof(*dst_addr)); | ||
| } else { | ||
| status = ucs_sockaddr_copy(dst_addr, src_addr); | ||
| ucs_assert_always(status == UCS_OK); | ||
| } |
There was a problem hiding this comment.
yes, no need to define ucp_sockaddr_copy_always() function
also it's ucs function so should have been ucs_sockaddr_copy_always
|
bot:pipe:retest |
|
@shamisp @tonycurtis can you pls take a look? |
| * @return ip_str if the sock_addr has a valid IP address or 'Invalid address' | ||
| * otherwise. |
There was a problem hiding this comment.
minor: it returns UCS_OK if sock_addr has a valid IP address
| self->ops = ops; | ||
| self->component = component; | ||
| self->iface.super.ops = *iface_ops; | ||
| self->iface.internal_ops = internal_ops; | ||
| self->iface.worker = ucs_derived_of(worker, uct_priv_worker_t); | ||
|
|
||
| self->iface.md = NULL; | ||
| self->iface.am->arg = NULL; | ||
| self->iface.am->flags = 0; | ||
| self->iface.am->cb = (uct_am_callback_t)ucs_empty_function_return_unsupported; | ||
| self->iface.am_tracer = NULL; | ||
| self->iface.am_tracer_arg = NULL; | ||
| self->iface.err_handler = NULL; |
There was a problem hiding this comment.
this whole block can be moved one space left, as it was before
| * Local socket address for this endpoint. Valid only for endpoints created | ||
| * by connecting to a socket address. | ||
| */ | ||
| struct sockaddr_storage local_sockaddr; |
There was a problem hiding this comment.
what happens if ep is not connected to a socket address ?
There was a problem hiding this comment.
So the API is valid for all endpoint and if the socket was not connected using socket cm UCS_ERR_NOT_CONNECTED is not returned. This has to be properly documented.
There was a problem hiding this comment.
@shamisp I guess there is some misunderstanding here. We always use socket address to connect. But the EP's status can have two cases:
- If the EP is connected, then the API is valid to get local sockaddr and remote sockaddr as documented above, and return UCS_OK.
- If the EP is not connected, then return UCS_ERR_NOT_CONNECTED as the error status.
I added this description according to @yosefe 's comment #7020 (comment).
@yosefe Please correct me if I made any misunderstanding about the description.
There was a problem hiding this comment.
there are cases when ep is connecting to worker address (not socket address) so there is no CM lane and we are returning UCS_ERR_NOT_CONNECTED. That's why we wrote "Valid only for endpoints created by connecting to a socket address." Perhaps should add "If this field is specified for an endpoint not connected to a socket address, the behavior is undefined" or ".. UCS_ERR_NOT_CONNECTED will be returned"
There was a problem hiding this comment.
@yosefe "behavior is undefined" is the worse ...
There was a problem hiding this comment.
@shamisp I added "If this field is specified for an endpoint not connected to a socket address, UCS_ERR_NOT_CONNECTED will be returned."
There was a problem hiding this comment.
@shamisp Could please approve this PR? Let me know please if you have any more comments. Thanks!
|
I'm a bit concerned that we are exposing an API that is only useful for "some" endpoints connected using CM or sockets. Can you please clarify your use case beyond: |
@shamisp We provided this API to one customer in an separate branch before. Recently another Chinese customer also needs this API. Their argument is that socket has similar API getsockname(). Generally, I agree this API is useful for most of users. |
|
@tonycurtis can you please review documentation. thanks |
ad5a4e6 to
62cde3a
Compare
@yosefe Done |
What
Add functions to query the ucp and uct endpoints
Why ?
Sometimes users need API to get remote and local IP/port per endpoint
How ?
Get the remote and local IP/port through RDMA_CM