Skip to content

UCT/PLUGIN: ib plugin for token query#11277

Open
jeynmann wants to merge 10 commits intoopenucx:masterfrom
jeynmann:plugin_query_token
Open

UCT/PLUGIN: ib plugin for token query#11277
jeynmann wants to merge 10 commits intoopenucx:masterfrom
jeynmann:plugin_query_token

Conversation

@jeynmann
Copy link
Copy Markdown
Contributor

@jeynmann jeynmann commented Mar 20, 2026

What?

Add plugin support for token query(capability, rx token, tx token, tx token lengh, rx token length).
This is the plugin part of PR#11234

How?

Add weak symbols in uct.
The implementation will be provided by plugin lib.

}

ucs_status_t __attribute__((weak))
uct_ib_plugin_ep_query(uct_ep_h ep, uct_ep_attr_t *ep_attr)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be possible to change this to:

uct_ib_plugin_query_qp()
?

dv/ib_mlx5_dv.c \
dv/ib_mlx5dv_md.c
dv/ib_mlx5dv_md.c \
../plugin/uct_ib_plugin_stubs.c
Copy link
Copy Markdown
Contributor

@roiedanino roiedanino Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a Makefile.am in /plugin and the stub there
(we should also add the .h file to the noinst_HEADERS list)

Comment on lines +17 to +18
pluginincludedir = $(includedir)/uct/ib/plugin
plugininclude_HEADERS = plugin/uct_ib_plugin.h
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be added in plugin/Makefile.am

Comment on lines +18 to +20
uct_ib_plugin_qp_query(const uct_ib_plugin_qp_query_params_t *params,
uct_ib_plugin_qp_query_attr_t *attr)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it going to be called from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be invoked by uct_iface_query_v2 and uct_ep_query.
The UCT implementation will be submitted in a separate PR.

* @brief QP query input parameters.
*/
typedef struct uct_ib_plugin_qp_query_params {
uint64_t field_mask;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also define an enum for the field_mask

@gleon99 gleon99 requested a review from evgeny-leksikov April 2, 2026 15:48
Comment on lines +432 to +433
/* IB plugin capability */
#define UCT_IFACE_FLAG_IB_PLUGIN_QUERY_TOKEN UCS_BIT(47) /**< IB plugin for token query is available */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to getrid of "IB" and "plugin" in UCT API, just "UCT_IFACE_FLAG_QUERY_TOKEN", not implemented/supported => no capability

Comment on lines +46 to +55
/**
* @brief Field mask bits for @ref uct_ib_plugin_qp_query_attr_t.
* Selects which output fields to populate.
*/
enum uct_ib_plugin_qp_query_attr_field {
UCT_IB_PLUGIN_QP_QUERY_ATTR_FIELD_TX_TOKEN_LEN = UCS_BIT(0),
UCT_IB_PLUGIN_QP_QUERY_ATTR_FIELD_RX_TOKEN_LEN = UCS_BIT(1),
UCT_IB_PLUGIN_QP_QUERY_ATTR_FIELD_TX_TOKEN = UCS_BIT(2),
UCT_IB_PLUGIN_QP_QUERY_ATTR_FIELD_RX_TOKEN = UCS_BIT(3)
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll have similar bits for uct_ep_query, so why dont pass the same semantic to the "uct_ib_plugin_ep_query", cast to correct ep_type and access QP.
Then uct_ib_plugin_qp_query_params_t becomes redundant.

Comment on lines +69 to +74
/**
* @brief Return plugin-contributed iface capability flags.
*
* @return Bitmask of UCT_IFACE_FLAG_* contributed by the plugin.
*/
uint64_t uct_ib_plugin_iface_flags(void);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for plugin contribution to defined UCT API

* @return UCS_OK on success, error code otherwise.
*/
ucs_status_t
uct_ib_plugin_qp_query(const uct_ib_plugin_qp_query_params_t *params,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uct_ib_plugin_ep_query?

Copy link
Copy Markdown
Contributor Author

@jeynmann jeynmann Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roiedanino suggests renaming it to uct_ib_plugin_query_qp. We now rely on mlx5dv_devx_obj and ibv_qp rather than the internal UCT structure, which might provide a cleaner and simpler approach.

Will it be possible to change this to: uct_ib_plugin_query_qp() ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it adds inconsistency and overcomplication. Why does iface_flags return native UCT API level flags, but ep_query requires conversion of ep -> qp and qp_attr -> ep_attr converting in base (non-plugin) UCT/IB code?

Signed-off-by: Roie Danino <rdanino@nvidia.com>
Comment on lines +51 to +52
UCT_IB_PLUGIN_QP_QUERY_ATTR_FIELD_TX_TOKEN_LEN = UCS_BIT(0),
UCT_IB_PLUGIN_QP_QUERY_ATTR_FIELD_RX_TOKEN_LEN = UCS_BIT(1),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in #11234 these are defined as iface attributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants