diff --git a/lib/nvmf/conn.c b/lib/nvmf/conn.c index 1e32e390c..2c8651d04 100644 --- a/lib/nvmf/conn.c +++ b/lib/nvmf/conn.c @@ -1003,14 +1003,15 @@ static int nvmf_cq_event_handler(struct spdk_nvmf_conn *conn) */ SPDK_TRACELOG(SPDK_TRACE_RDMA, "\nCQ rdma write completion\n"); tx_desc = (struct nvme_qp_tx_desc *)wc.wr_id; - spdk_trace_record(TRACE_RDMA_WRITE_COMPLETE, 0, 0, (uint64_t)tx_desc->rx_desc, 0); + req = &tx_desc->req_state; + spdk_trace_record(TRACE_RDMA_WRITE_COMPLETE, 0, 0, (uint64_t)req, 0); break; case IBV_WC_RDMA_READ: SPDK_TRACELOG(SPDK_TRACE_RDMA, "\nCQ rdma read completion\n"); tx_desc = (struct nvme_qp_tx_desc *)wc.wr_id; - spdk_trace_record(TRACE_RDMA_READ_COMPLETE, 0, 0, (uint64_t)tx_desc->rx_desc, 0); req = &tx_desc->req_state; + spdk_trace_record(TRACE_RDMA_READ_COMPLETE, 0, 0, (uint64_t)req, 0); rc = spdk_nvmf_request_exec(conn, req); if (rc) { SPDK_ERRLOG("request_exec error %d after RDMA Read completion\n", rc); diff --git a/lib/nvmf/nvmf_io_cmd.c b/lib/nvmf/nvmf_io_cmd.c index fa0ea51e2..5c4c976b1 100644 --- a/lib/nvmf/nvmf_io_cmd.c +++ b/lib/nvmf/nvmf_io_cmd.c @@ -106,8 +106,7 @@ nvmf_process_io_cmd(struct nvmf_request *req) if (cmd->opc == SPDK_NVME_OPC_READ) { SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_process_io_cmd: Read; lba address %lx, lba count %x\n", lba_address, lba_count); - spdk_trace_record(TRACE_NVMF_LIB_READ_START, 0, 0, - (uint64_t)req->fabric_rx_ctx, 0); + spdk_trace_record(TRACE_NVMF_LIB_READ_START, 0, 0, (uint64_t)req, 0); rc = spdk_nvme_ns_cmd_read(ns, qpair, req->data, lba_address, lba_count, nvmf_complete_cmd, @@ -115,8 +114,7 @@ nvmf_process_io_cmd(struct nvmf_request *req) } else { SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_process_io_cmd: Write; lba address %lx, lba count %x\n", lba_address, lba_count); - spdk_trace_record(TRACE_NVMF_LIB_WRITE_START, 0, 0, - (uint64_t)req->fabric_rx_ctx, 0); + spdk_trace_record(TRACE_NVMF_LIB_WRITE_START, 0, 0, (uint64_t)req, 0); rc = spdk_nvme_ns_cmd_write(ns, qpair, req->data, lba_address, lba_count, nvmf_complete_cmd, diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index dd52569d4..2a689491c 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -293,7 +293,7 @@ nvmf_post_rdma_read(struct spdk_nvmf_conn *conn, nvmf_ibv_send_wr_init(&wr, req, &rx_desc->bb_sgl, (uint64_t)tx_desc, IBV_WR_RDMA_READ, IBV_SEND_SIGNALED); - spdk_trace_record(TRACE_RDMA_READ_START, 0, 0, (uint64_t)rx_desc, 0); + spdk_trace_record(TRACE_RDMA_READ_START, 0, 0, (uint64_t)req, 0); rc = ibv_post_send(conn->qp, &wr, &bad_wr); if (rc) { SPDK_ERRLOG("Failure posting rdma read send, rc = 0x%x\n", rc); @@ -318,7 +318,7 @@ nvmf_post_rdma_write(struct spdk_nvmf_conn *conn, nvmf_ibv_send_wr_init(&wr, req, &rx_desc->bb_sgl, (uint64_t)tx_desc, IBV_WR_RDMA_WRITE, 0); - spdk_trace_record(TRACE_RDMA_WRITE_START, 0, 0, (uint64_t)rx_desc, 0); + spdk_trace_record(TRACE_RDMA_WRITE_START, 0, 0, (uint64_t)req, 0); rc = ibv_post_send(conn->qp, &wr, &bad_wr); if (rc) { SPDK_ERRLOG("Failure posting rdma write send, rc = 0x%x\n", rc); @@ -331,6 +331,7 @@ nvmf_post_rdma_send(struct spdk_nvmf_conn *conn, struct nvme_qp_tx_desc *tx_desc) { struct ibv_send_wr wr, *bad_wr = NULL; + struct nvmf_request *req = &tx_desc->req_state; struct nvme_qp_rx_desc *rx_desc = tx_desc->rx_desc; int rc; @@ -349,16 +350,10 @@ nvmf_post_rdma_send(struct spdk_nvmf_conn *conn, nvmf_ibv_send_wr_init(&wr, NULL, &tx_desc->send_sgl, (uint64_t)tx_desc, IBV_WR_SEND, IBV_SEND_SIGNALED); -#ifdef DEBUG - { - struct nvmf_request *req = &tx_desc->req_state; - SPDK_TRACELOG(SPDK_TRACE_RDMA, - "tx_desc %p: req_state %p, rsp %p\n", - tx_desc, req, (void *)req->rsp); - } -#endif + SPDK_TRACELOG(SPDK_TRACE_RDMA, "tx_desc %p: req_state %p, rsp %p\n", + tx_desc, req, req->rsp); - spdk_trace_record(TRACE_NVMF_IO_COMPLETE, 0, 0, (uint64_t)rx_desc, 0); + spdk_trace_record(TRACE_NVMF_IO_COMPLETE, 0, 0, (uint64_t)req, 0); rc = ibv_post_send(conn->qp, &wr, &bad_wr); if (rc) { SPDK_ERRLOG("Failure posting rdma send for NVMf completion, rc = 0x%x\n", rc); diff --git a/lib/nvmf/session.c b/lib/nvmf/session.c index 347dd3ad1..2f6729b11 100644 --- a/lib/nvmf/session.c +++ b/lib/nvmf/session.c @@ -345,7 +345,7 @@ nvmf_complete_cmd(void *rsp, const struct spdk_nvme_cpl *cmp) struct nvmf_request *req_state = (struct nvmf_request *)rsp; struct spdk_nvme_cpl *response; - spdk_trace_record(TRACE_NVMF_LIB_COMPLETE, 0, 0, (uint64_t)req_state->fabric_rx_ctx, 0); + spdk_trace_record(TRACE_NVMF_LIB_COMPLETE, 0, 0, (uint64_t)req_state, 0); SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_complete_cmd callback: req_state %p\n", req_state); response = &req_state->rsp->nvme_cpl;