Skip to content

Commit

Permalink
core: Require using libfabric APIs to allocate fi_info structures
Browse files Browse the repository at this point in the history
Disallow users hand-crafting or hand-copying their own fi_info structs.
This allows the library to allocate hidden fields for internal use.
Plus, there's no need to apps to do this, given that the API call is
way easier to use.

Signed-off-by: Sean Hefty <[email protected]>
  • Loading branch information
shefty authored and j-xiong committed Apr 29, 2024
1 parent 0393904 commit a77882b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions man/fi_domain.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ int fi_set_ops(struct fid *domain, const char *name, uint64_t flags,
*info*
: Fabric information, including domain capabilities and attributes.
The struct fi_info must have been obtained using either fi_getinfo()
or fi_dupinfo().
*domain*
: An opened access domain.
Expand Down
5 changes: 3 additions & 2 deletions man/fi_endpoint.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ DEPRECATED ssize_t fi_tx_size_left(struct fid_ep *ep);
associated resource.
*info*
: Details about the fabric interface endpoint to be opened, obtained
from fi_getinfo.
: Details about the fabric interface endpoint to be opened.
The struct fi_info must have been obtained using either fi_getinfo()
or fi_dupinfo().
*ep*
: A fabric endpoint.
Expand Down
9 changes: 8 additions & 1 deletion man/fi_getinfo.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ struct fi_info *fi_dupinfo(const struct fi_info *info);
*hints*
: Reference to an fi_info structure that specifies criteria for
selecting the returned fabric information.
selecting the returned fabric information. The fi_info hints
structure must be allocated using either fi_allocinfo() or fi_dupinfo().
*info*
: A pointer to a linked list of fi_info structures containing response
Expand Down Expand Up @@ -688,6 +689,12 @@ via fi_freeinfo().

# NOTES

Various libfabric calls, including fi_getinfo, take a struct fi_info as
input. Applications must use libfabric allocated fi_info structures.
A zeroed struct fi_info can be allocated using fi_allocinfo, which may
then be initialized by the user. A struct fi_info may be copied for
modification using the fi_dupinfo() call.

If hints are provided, the operation will be controlled by the values
that are supplied in the various fields (see section on _fi_info_).
Applications that require specific communication interfaces, domains,
Expand Down

0 comments on commit a77882b

Please sign in to comment.