diff mbox

[v5,12/20] nvmet-rdma: Simplify ib_post_(send|recv|srq_recv)() calls

Message ID 20180718162532.14633-13-bart.vanassche@wdc.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Bart Van Assche July 18, 2018, 4:25 p.m. UTC
Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL
as third argument to ib_post_(send|recv|srq_recv)().

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Max Gurtovoy <maxg@mellanox.com>
---
 drivers/nvme/target/rdma.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Max Gurtovoy July 19, 2018, 4:15 p.m. UTC | #1
On 7/18/2018 7:25 PM, Bart Van Assche wrote:
> Instead of declaring and passing a dummy 'bad_wr' pointer, pass NULL
> as third argument to ib_post_(send|recv|srq_recv)().
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Max Gurtovoy <maxg@mellanox.com>
> ---
>   drivers/nvme/target/rdma.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 

Looks good,
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>

Jason,
please note that the 2 nvmf/RDMA fixes can conflict with Jens PR since 
allmost all of nvmf/RDMA code is pushed throw the block-layer tree.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 0d7f3d603f1d..1a642e214a4c 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -382,15 +382,13 @@  static void nvmet_rdma_free_rsps(struct nvmet_rdma_queue *queue)
 static int nvmet_rdma_post_recv(struct nvmet_rdma_device *ndev,
 		struct nvmet_rdma_cmd *cmd)
 {
-	struct ib_recv_wr *bad_wr;
-
 	ib_dma_sync_single_for_device(ndev->device,
 		cmd->sge[0].addr, cmd->sge[0].length,
 		DMA_FROM_DEVICE);
 
 	if (ndev->srq)
-		return ib_post_srq_recv(ndev->srq, &cmd->wr, &bad_wr);
-	return ib_post_recv(cmd->queue->cm_id->qp, &cmd->wr, &bad_wr);
+		return ib_post_srq_recv(ndev->srq, &cmd->wr, NULL);
+	return ib_post_recv(cmd->queue->cm_id->qp, &cmd->wr, NULL);
 }
 
 static void nvmet_rdma_process_wr_wait_list(struct nvmet_rdma_queue *queue)
@@ -472,7 +470,7 @@  static void nvmet_rdma_queue_response(struct nvmet_req *req)
 	struct nvmet_rdma_rsp *rsp =
 		container_of(req, struct nvmet_rdma_rsp, req);
 	struct rdma_cm_id *cm_id = rsp->queue->cm_id;
-	struct ib_send_wr *first_wr, *bad_wr;
+	struct ib_send_wr *first_wr;
 
 	if (rsp->flags & NVMET_RDMA_REQ_INVALIDATE_RKEY) {
 		rsp->send_wr.opcode = IB_WR_SEND_WITH_INV;
@@ -493,7 +491,7 @@  static void nvmet_rdma_queue_response(struct nvmet_req *req)
 		rsp->send_sge.addr, rsp->send_sge.length,
 		DMA_TO_DEVICE);
 
-	if (ib_post_send(cm_id->qp, first_wr, &bad_wr)) {
+	if (ib_post_send(cm_id->qp, first_wr, NULL)) {
 		pr_err("sending cmd response failed\n");
 		nvmet_rdma_release_rsp(rsp);
 	}