Skip to content

Commit

Permalink
nvmet-rdma: remove p2p_client initialization from fast-path
Browse files Browse the repository at this point in the history
Initialize it during command allocation.

Cc: Logan Gunthorpe <[email protected]>
Cc: Stephen Bates <[email protected]>
Signed-off-by: Max Gurtovoy <[email protected]>
Reviewed-by: Logan Gunthorpe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
Max Gurtovoy authored and Christoph Hellwig committed Apr 25, 2019
1 parent 95f18c9 commit 8dc2ed3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/nvme/target/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev,
if (ib_dma_mapping_error(ndev->device, r->send_sge.addr))
goto out_free_rsp;

r->req.p2p_client = &ndev->device->dev;
r->send_sge.length = sizeof(*r->req.rsp);
r->send_sge.lkey = ndev->pd->local_dma_lkey;

Expand Down Expand Up @@ -763,8 +764,6 @@ static void nvmet_rdma_handle_command(struct nvmet_rdma_queue *queue,
cmd->send_sge.addr, cmd->send_sge.length,
DMA_TO_DEVICE);

cmd->req.p2p_client = &queue->dev->device->dev;

if (!nvmet_req_init(&cmd->req, &queue->nvme_cq,
&queue->nvme_sq, &nvmet_rdma_ops))
return;
Expand Down

0 comments on commit 8dc2ed3

Please sign in to comment.