Skip to content

Commit

Permalink
providers/qedr: Remove unused debug files
Browse files Browse the repository at this point in the history
Now that all DP_* macros have been replaced, Remove the unused debug files.

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

extern uint32_t qelr_dp_level;
extern uint32_t qelr_dp_module;

enum DP_MODULE {
QELR_MSG_CQ = 0x10000,
QELR_MSG_RQ = 0x20000,
QELR_MSG_SQ = 0x40000,
QELR_MSG_QP = (QELR_MSG_SQ | QELR_MSG_RQ),
QELR_MSG_MR = 0x80000,
QELR_MSG_INIT = 0x100000,
QELR_MSG_SRQ = 0x200000,
/* to be added...up to 0x8000000 */
};

enum DP_LEVEL {
QELR_LEVEL_VERBOSE = 0x0,
QELR_LEVEL_INFO = 0x1,
QELR_LEVEL_NOTICE = 0x2,
QELR_LEVEL_ERR = 0x3,
};

struct qelr_buf {
void *addr;
size_t len; /* a 64 uint is used as s preparation
Expand Down
53 changes: 0 additions & 53 deletions providers/qedr/qelr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ static void qelr_free_context(struct ibv_context *ibctx);
#define PCI_DEVICE_ID_QLOGIC_AHP (0x8170)
#define PCI_DEVICE_ID_QLOGIC_AHP_IOV (0x8190)

uint32_t qelr_dp_level;
uint32_t qelr_dp_module;

#define QHCA(d) \
VERBS_PCI_MATCH(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_##d, NULL)
static const struct verbs_match_ent hca_table[] = {
Expand Down Expand Up @@ -128,51 +125,6 @@ static void qelr_uninit_device(struct verbs_device *verbs_device)
free(dev);
}

static void qelr_open_debug_file(struct qelr_devctx *ctx)
{
char *env;

env = getenv("QELR_DEBUG_FILE");
if (!env) {
ctx->dbg_fp = stderr;
verbs_debug(&ctx->ibv_ctx, "Debug file opened: stderr\n");
return;
}

ctx->dbg_fp = fopen(env, "aw+");
if (!ctx->dbg_fp) {
fprintf(stderr, "Failed opening debug file %s, using stderr\n",
env);
ctx->dbg_fp = stderr;
verbs_debug(&ctx->ibv_ctx, "Debug file opened: stderr\n");
return;
}

verbs_debug(&ctx->ibv_ctx, "Debug file opened: %s\n", env);
}

static void qelr_close_debug_file(struct qelr_devctx *ctx)
{
if (ctx->dbg_fp && ctx->dbg_fp != stderr)
fclose(ctx->dbg_fp);
}

static void qelr_set_debug_mask(void)
{
char *env;

qelr_dp_level = QELR_LEVEL_NOTICE;
qelr_dp_module = 0;

env = getenv("QELR_DP_LEVEL");
if (env)
qelr_dp_level = atoi(env);

env = getenv("QELR_DP_MODULE");
if (env)
qelr_dp_module = atoi(env);
}

static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,
int cmd_fd,
void *private_data)
Expand All @@ -188,9 +140,6 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,

memset(&resp, 0, sizeof(resp));

qelr_open_debug_file(ctx);
qelr_set_debug_mask();

cmd.context_flags = QEDR_ALLOC_UCTX_DB_REC | QEDR_SUPPORT_DPM_SIZES;
cmd.context_flags |= QEDR_ALLOC_UCTX_EDPM_MODE;
if (ibv_cmd_get_context(&ctx->ibv_ctx, &cmd.ibv_cmd, sizeof(cmd),
Expand Down Expand Up @@ -265,7 +214,6 @@ static struct verbs_context *qelr_alloc_context(struct ibv_device *ibdev,

cmd_err:
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);
return NULL;
Expand All @@ -279,7 +227,6 @@ static void qelr_free_context(struct ibv_context *ibctx)
munmap(ctx->db_addr, ctx->db_size);

free(ctx->srq_table);
qelr_close_debug_file(ctx);
verbs_uninit_context(&ctx->ibv_ctx);
free(ctx);
}
Expand Down

0 comments on commit cb0f880

Please sign in to comment.