Skip to content

Commit

Permalink
TL/MLX5: minor comments
Browse files Browse the repository at this point in the history
  • Loading branch information
samnordmann committed May 21, 2023
1 parent ab76282 commit 218d7b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions src/components/tl/mlx5/tl_mlx5.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ UCC_CLASS_DECLARE(ucc_tl_mlx5_context_t, const ucc_base_context_params_t *,
const ucc_base_config_t *);

typedef struct ucc_tl_mlx5_schedule ucc_tl_mlx5_schedule_t;
typedef struct ucc_tl_mlx5_dm_chunk_t {
typedef struct ucc_tl_mlx5_dm_chunk {
ptrdiff_t offset; // 0 based offset from the beginning of
// memic_mr (obtained with ibv_reg_dm_mr)
ucc_tl_mlx5_schedule_t *task;
Expand Down Expand Up @@ -125,10 +125,4 @@ UCC_CLASS_DECLARE(ucc_tl_mlx5_team_t, ucc_base_context_t *,
#define IS_SERVICE_TEAM(_team) \
((_team)->super.super.params.scope == UCC_CL_LAST + 1)

ucc_status_t ucc_tl_mlx5_dm_alloc_reg(struct ibv_context *ib_ctx,
struct ibv_pd *pd, int dm_host,
size_t buf_size, size_t *buf_num_p,
struct ibv_dm **ptr, struct ibv_mr **mr,
ucc_base_lib_t *lib);

#endif
9 changes: 4 additions & 5 deletions src/components/tl/mlx5/tl_mlx5_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ static ucc_status_t ucc_tl_mlx5_dm_chunk_alloc(ucc_mpool_t *mp, //NOLINT
static void ucc_tl_mlx5_dm_chunk_init(ucc_mpool_t *mp, //NOLINT
void *obj, void *chunk) //NOLINT
{
ucc_tl_mlx5_dm_chunk_t *c = (ucc_tl_mlx5_dm_chunk_t *)obj;
ucc_tl_mlx5_team_t * team =
ucc_tl_mlx5_dm_chunk_t *c = (ucc_tl_mlx5_dm_chunk_t *)obj;
ucc_tl_mlx5_team_t *team =
ucc_container_of(mp, ucc_tl_mlx5_team_t, dm_pool);
const size_t memic_chunk = UCC_TL_MLX5_DM_CHUNK_SIZE;

c->offset = (ptrdiff_t)team->oob_req;
team->oob_req = PTR_OFFSET(team->oob_req, memic_chunk);
team->oob_req = PTR_OFFSET(team->oob_req, UCC_TL_MLX5_DM_CHUNK_SIZE);
}

static void ucc_tl_mlx5_dm_chunk_release(ucc_mpool_t *mp, void *chunk) //NOLINT
Expand Down Expand Up @@ -122,7 +122,6 @@ ucc_status_t ucc_tl_mlx5_dm_alloc_reg(struct ibv_context *ib_ctx,
errno = 0;
dm_ptr = ibv_alloc_dm(ib_ctx, &dm_attr);
if (dm_ptr) {
ucc_assert(errno == 0);
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions test/gtest/tl/mlx5/test_tl_mlx5.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <dlfcn.h>
#include "common/test_ucc.h"
#include "components/tl/mlx5/tl_mlx5.h"
#include "components/tl/mlx5/tl_mlx5_dm.h"
#include "components/tl/mlx5/tl_mlx5_ib.h"

typedef ucc_status_t (*ucc_tl_mlx5_create_ibv_ctx_fn_t)(
Expand Down

0 comments on commit 218d7b3

Please sign in to comment.