From 20343c9186fb194b7002b73412304679687b7a3b Mon Sep 17 00:00:00 2001 From: Dmitry Gladkov Date: Mon, 1 Jul 2019 09:46:12 +0000 Subject: [PATCH 1/2] UCT/IB/MLX5: Use 64-bit value for 1 instead of 32-bit one --- src/uct/ib/mlx5/ib_mlx5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uct/ib/mlx5/ib_mlx5.c b/src/uct/ib/mlx5/ib_mlx5.c index d389cdd065b..daec9413ab3 100644 --- a/src/uct/ib/mlx5/ib_mlx5.c +++ b/src/uct/ib/mlx5/ib_mlx5.c @@ -125,7 +125,7 @@ ucs_status_t uct_ib_mlx5_get_cq(struct ibv_cq *cq, uct_ib_mlx5_cq_t *mlx5_cq) } mlx5_cq->cqe_size_log = ucs_ilog2(cqe_size); - ucs_assert_always((1<cqe_size_log) == cqe_size); + ucs_assert_always((1ul << mlx5_cq->cqe_size_log) == cqe_size); /* Set owner bit for all CQEs, so that CQE would look like it is in HW * ownership. In this case CQ polling functions will return immediately if From 851b365e26e65258435b1a796cc35a0754cb9da6 Mon Sep 17 00:00:00 2001 From: Dmitry Gladkov Date: Mon, 1 Jul 2019 09:41:59 +0000 Subject: [PATCH 2/2] UCT/BASE: Align malloc'ed type and resulted type --- src/uct/base/uct_worker.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uct/base/uct_worker.h b/src/uct/base/uct_worker.h index 78abfb1a15f..8d7fc2ee853 100644 --- a/src/uct/base/uct_worker.h +++ b/src/uct/base/uct_worker.h @@ -52,19 +52,19 @@ typedef struct uct_worker_progress { } \ \ if (&data->list == &(_worker)->tl_data) { /* not found */ \ - data = ucs_malloc(sizeof(_type), UCS_PP_QUOTE(_type)); \ - if (data == NULL) { \ + result = ucs_malloc(sizeof(_type), UCS_PP_QUOTE(_type)); \ + if (result == NULL) { \ result = UCS_STATUS_PTR(UCS_ERR_NO_MEMORY); \ } else { \ + data = (uct_worker_tl_data_t*)result;\ data->key = (_key); \ data->refcount = 1; \ status = _init_fn(ucs_derived_of(data, _type), ## __VA_ARGS__); \ if (status != UCS_OK) { \ - ucs_free(data); \ + ucs_free(result); \ result = UCS_STATUS_PTR(status); \ } else { \ ucs_list_add_tail(&(_worker)->tl_data, &data->list); \ - result = ucs_derived_of(data, _type); \ } \ } \ } else { \