Lines Matching refs:context
49 static struct mlx5_db_page *__add_page(struct mlx5_context *context)
52 int ps = to_mdev(context->ibv_ctx.device)->page_size;
57 pp = ps / context->cache_line_size;
75 page->next = context->db_list;
76 context->db_list = page;
83 uint32_t *mlx5_alloc_dbrec(struct mlx5_context *context)
89 pthread_mutex_lock(&context->db_list_mutex);
91 for (page = context->db_list; page; page = page->next)
95 page = __add_page(context);
108 db = page->buf.buf + (i * 8 * sizeof(long) + j) * context->cache_line_size;
111 pthread_mutex_unlock(&context->db_list_mutex);
116 void mlx5_free_db(struct mlx5_context *context, uint32_t *db)
119 uintptr_t ps = to_mdev(context->ibv_ctx.device)->page_size;
122 pthread_mutex_lock(&context->db_list_mutex);
124 for (page = context->db_list; page; page = page->next)
131 i = ((void *) db - page->buf.buf) / context->cache_line_size;
138 context->db_list = page->next;
147 pthread_mutex_unlock(&context->db_list_mutex);