Repository navigation
UCT/IB/MLX5: DV UAR alloc type NC support - #6082
Conversation
e494da0 to
a07e487
Compare
| unsigned flags = UCT_IB_MLX5_UAR_ALLOC_TYPE_WC; | ||
|
|
||
| retry: | ||
| uar->uar = mlx5dv_devx_alloc_uar(md->super.dev.ibv_context, | ||
| flags); | ||
| if (uar->uar == NULL) { | ||
| if (flags != UCT_IB_MLX5_UAR_ALLOC_TYPE_NC) { | ||
| flags = UCT_IB_MLX5_UAR_ALLOC_TYPE_NC; | ||
| goto retry; | ||
| } |
There was a problem hiding this comment.
IMO, calling mlx5dv_devx_alloc_uar twice(instead of goto/retry) would be more readable
There was a problem hiding this comment.
don't we want to cache the failure?
| { | ||
| #if HAVE_DEVX | ||
| uar->uar = mlx5dv_devx_alloc_uar(md->super.dev.ibv_context, 0); | ||
| uar->uar = mlx5dv_devx_alloc_uar(md->super.dev.ibv_context, |
There was a problem hiding this comment.
pls remove indentation where not needed
| ucs_error("mlx5dv_devx_alloc_uar() failed: %m"); | ||
| return UCS_ERR_NO_MEMORY; | ||
| if (UCT_IB_MLX5_UAR_ALLOC_TYPE_WC == UCT_IB_MLX5_UAR_ALLOC_TYPE_NC) { | ||
| ucs_error("mlx5dv_devx_alloc_uar(WC) failed: %m"); |
There was a problem hiding this comment.
- print a debug message if WC failed and we're doing fallback
- print actual flag value, ucs_error("mlx5dv_devx_alloc_uar(WC, flags=0x%x) failed: %m", UCT_IB_MLX5_UAR_ALLOC_TYPE_WC);
| uar->uar = mlx5dv_devx_alloc_uar(md->super.dev.ibv_context, | ||
| UCT_IB_MLX5_UAR_ALLOC_TYPE_NC); | ||
| if (uar->uar == NULL) { | ||
| ucs_error("mlx5dv_devx_alloc_uar(NC) failed: %m"); | ||
| return UCS_ERR_NO_MEMORY; | ||
| } |
There was a problem hiding this comment.
IMO, #define UCT_IB_MLX5_UAR_ALLOC_TYPE_NC 0 is not correct (but only #define UCT_IB_MLX5_UAR_ALLOC_TYPE_WC 0 is correct)
maybe add #ifdef HAVE_DECL_MLX5DV_UAR_ALLOC_TYPE_NC here?
and check for HAVE_DECL_MLX5DV_UAR_ALLOC_TYPE_WC separately in configure?
| uar->uar = mlx5dv_devx_alloc_uar(md->super.dev.ibv_context, | ||
| UCT_IB_MLX5_UAR_ALLOC_TYPE_NC); | ||
| #if HAVE_DECL_MLX5DV_UAR_ALLOC_TYPE_NC | ||
| ucs_debug("UAR alloc WC failed. Fallback to NC\n"); |
There was a problem hiding this comment.
ucs_debug("mlx5dv_devx_alloc_uar(device=%s, flags=0x%x) failed: %m, fallback to NC\n");
| UCT_IB_MLX5_UAR_ALLOC_TYPE_NC); | ||
| if (uar->uar == NULL) { | ||
| ucs_error("mlx5dv_devx_alloc_uar(NC) failed: %m"); | ||
| ucs_error("mlx5dv_devx_alloc_uar(NC, flags=0x%x) failed: %m", |
|
also, revert #6061 in this PR |
| ucs_debug("mlx5dv_devx_alloc_uar(device=%s, flags=0x%x(WC)) " | ||
| "failed: %m, fallback to NC", | ||
| uct_ib_device_name(&md->super.dev), | ||
| UCT_IB_MLX5_UAR_ALLOC_TYPE_WC); |
There was a problem hiding this comment.
maybe add function uct_ib_mlx5_devx_alloc_uar(md, flags, err_level=ERROR/DEBUG, char *title="WC"/"NC") which will wrap the debug/error print?
cbeb7b5 to
c7ad67e
Compare
617b186 to
ef338d4
Compare
| sprintf(buf, "mlx5dv_devx_alloc_uar(device=%s, flags=0x%x(%s)) " | ||
| "failed: %m", uct_ib_device_name(&md->super.dev), flags, title); | ||
| if (fallback == NULL) { | ||
| ucs_log(log_level, "%s", buf); | ||
| } else { | ||
| ucs_log(log_level, "%s, fallback to %s", buf, fallback); | ||
| } | ||
|
|
There was a problem hiding this comment.
what was wrong with the previous version?
|
@Artemy-Mellanox can u pls squash? |
985a3c4 to
31c9220
Compare
No description provided.