Skip to content

Commit

Permalink
roviders/qelr: Replace DP_ERR with verbs_err
Browse files Browse the repository at this point in the history
Remove the DP_ERR macro and use verbs_err instade

Signed-off-by: Kamal Heib <[email protected]>
  • Loading branch information
Kamalheib committed Mar 18, 2024
1 parent 3283794 commit 8b6f743
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 60 deletions.
10 changes: 0 additions & 10 deletions providers/qedr/qelr.h
Expand Up @@ -50,8 +50,6 @@
#include "qelr_hsi.h"
#include "qelr_chain.h"

#define qelr_err(format, arg...) printf(format, ##arg)

extern uint32_t qelr_dp_level;
extern uint32_t qelr_dp_module;

Expand All @@ -73,14 +71,6 @@ enum DP_LEVEL {
QELR_LEVEL_ERR = 0x3,
};

#define DP_ERR(fd, fmt, ...) \
do { \
fprintf(fd, "[%s:%d]" fmt, \
__func__, __LINE__, \
##__VA_ARGS__); \
fflush(fd); \
} while (0)

struct qelr_buf {
void *addr;
size_t len; /* a 64 uint is used as s preparation
Expand Down
6 changes: 3 additions & 3 deletions providers/qedr/qelr_main.c
Expand Up @@ -203,7 +203,7 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,

ctx->srq_table = calloc(QELR_MAX_SRQ_ID, sizeof(*ctx->srq_table));
if (!ctx->srq_table) {
DP_ERR(ctx->dbg_fp, "failed to allocate srq_table\n");
verbs_err(&ctx->ibv_ctx, "failed to allocate srq_table\n");
goto cmd_err;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,
if (ctx->db_addr == MAP_FAILED) {
int errsv = errno;

DP_ERR(ctx->dbg_fp,
verbs_err(&ctx->ibv_ctx,
"alloc context: doorbell mapping failed resp.db_pa = %llx resp.db_size=%d context->cmd_fd=%d errno=%d\n",
resp.db_pa, resp.db_size, cmd_fd, errsv);
goto free_srq_tbl;
Expand All @@ -264,7 +264,7 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,
free(ctx->srq_table);

cmd_err:
qelr_err("%s: Failed to allocate context for device.\n", __func__);
verbs_err(&ctx->ibv_ctx, "Failed to allocate context for device.\n");
qelr_close_debug_file(ctx);
verbs_uninit_context(&ctx->ibv_ctx);
free(ctx);
Expand Down

0 comments on commit 8b6f743

Please sign in to comment.