diff --git a/AUTHORS b/AUTHORS index 7c65e7b15a8..c90c1f772e3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -33,6 +33,7 @@ Elad Persiko Eugene Voronov Evgeny Leksikov Fabian Ruhland +Fei Teng Gilbert Lee Gilles Gouaillardet Gonzalo Brito Gadeschi diff --git a/src/uct/api/v2/uct_v2.h b/src/uct/api/v2/uct_v2.h index a1cfb51dc8d..55dcdf70319 100644 --- a/src/uct/api/v2/uct_v2.h +++ b/src/uct/api/v2/uct_v2.h @@ -273,7 +273,11 @@ enum uct_ep_attr_field { /** Enables @ref uct_ep_attr::local_address */ UCT_EP_ATTR_FIELD_LOCAL_SOCKADDR = UCS_BIT(0), /** Enables @ref uct_ep_attr::remote_address */ - UCT_EP_ATTR_FIELD_REMOTE_SOCKADDR = UCS_BIT(1) + UCT_EP_ATTR_FIELD_REMOTE_SOCKADDR = UCS_BIT(1), + /** Enables @ref uct_ep_attr::tx_token */ + UCT_EP_ATTR_FIELD_TX_TOKEN = UCS_BIT(2), + /** Enables @ref uct_ep_attr::rx_token */ + UCT_EP_ATTR_FIELD_RX_TOKEN = UCS_BIT(3) }; @@ -414,6 +418,22 @@ struct uct_ep_attr { * Remote sockaddr the endpoint is connected to. */ struct sockaddr_storage remote_address; + + /** + * Opaque TX token buffer. + * Valid when @ref UCT_EP_ATTR_FIELD_TX_TOKEN is set in @ref field_mask. + * Caller allocates a buffer of @ref uct_iface_attr_v2_t::tx_token_length + * bytes and sets this pointer; callee fills the buffer with the token. + */ + void *tx_token; + + /** + * Opaque RX token buffer. + * Valid when @ref UCT_EP_ATTR_FIELD_RX_TOKEN is set in @ref field_mask. + * Caller allocates a buffer of @ref uct_iface_attr_v2_t::rx_token_length + * bytes and sets this pointer; callee fills the buffer with the token. + */ + void *rx_token; }; @@ -1035,24 +1055,85 @@ typedef enum { /** * @ingroup UCT_RESOURCE - * @brief Interface attribute fields. + * @brief UCT interface v2 attributes field mask. + * + * The enumeration allows specifying which fields in @ref uct_iface_attr_v2_t + * are present, for backward compatibility support. */ enum uct_iface_attr_field { - /* Reserved for future use */ - UCT_IFACE_ATTR_FIELD_RESERVED = 0 + /** Enables @ref uct_iface_attr_v2_t::flags. */ + UCT_IFACE_ATTR_FIELD_FLAGS = UCS_BIT(0), + + /** Enables @ref uct_iface_attr_v2_t::tx_token_length. */ + UCT_IFACE_ATTR_FIELD_TX_TOKEN_LENGTH = UCS_BIT(1), + + /** Enables @ref uct_iface_attr_v2_t::rx_token_length. */ + UCT_IFACE_ATTR_FIELD_RX_TOKEN_LENGTH = UCS_BIT(2), + + /** + * Enables the RX token derivation path. + * Need to be set together with @ref UCT_IFACE_ATTR_FIELD_RX_TOKEN + * When both set, @ref uct_iface_attr_v2_t::tx_token is input (from sender), + * and @ref uct_iface_attr_v2_t::rx_token is output (derived by receiver). + */ + UCT_IFACE_ATTR_FIELD_TX_TOKEN = UCS_BIT(3), + + /** + * Enables the RX token derivation path. + * Need to be set together with @ref UCT_IFACE_ATTR_FIELD_TX_TOKEN, + * when both set, @ref uct_iface_attr_v2_t::tx_token is input (from sender), + * and @ref uct_iface_attr_v2_t::rx_token is output (derived by receiver). + */ + UCT_IFACE_ATTR_FIELD_RX_TOKEN = UCS_BIT(4) }; /** * @ingroup UCT_RESOURCE - * @brief Interface attributes, used by @ref uct_iface_query_v2. + * @brief UCT interface v2 attributes, used by @ref uct_iface_query_v2. */ typedef struct { /** * Mask of valid fields in this structure, using bits from - * @ref uct_iface_attr_field_t. + * @ref uct_iface_attr_field. */ - uint64_t field_mask; + uint64_t field_mask; + + /** + * UCT interface v2 flags (bitmask of UCT_IFACE_ATTR_FIELD_*). + * Valid when @ref UCT_IFACE_ATTR_FIELD_FLAGS is set. + */ + uint64_t flags; + + /** + * Length in bytes of the opaque TX token. + * Valid when @ref UCT_IFACE_ATTR_FIELD_TX_TOKEN_LENGTH is set. + */ + size_t tx_token_length; + + /** + * Length in bytes of the opaque RX token. + * Valid when @ref UCT_IFACE_ATTR_FIELD_RX_TOKEN_LENGTH is set. + */ + size_t rx_token_length; + + /** + * TX token input buffer. + * Valid when @ref UCT_IFACE_ATTR_FIELD_TX_TOKEN is set. + * Caller sets this to a buffer of @ref tx_token_length bytes containing + * the TX token received from the sender. + * @ref UCT_IFACE_ATTR_FIELD_RX_TOKEN must be set together. + */ + const void *tx_token; + + /** + * RX token output buffer. + * Valid when @ref UCT_IFACE_ATTR_FIELD_RX_TOKEN is set. + * Caller sets this to a pre-allocated buffer of @ref rx_token_length + * bytes; callee fills it with RX token. + * @ref UCT_IFACE_ATTR_FIELD_TX_TOKEN must be set together. + */ + void *rx_token; } uct_iface_attr_v2_t;