From patchwork Wed Jul 18 16:25:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10532915 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 941B260547 for ; Wed, 18 Jul 2018 16:25:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87DF72999A for ; Wed, 18 Jul 2018 16:25:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C521299A3; Wed, 18 Jul 2018 16:25:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10A6C2999F for ; Wed, 18 Jul 2018 16:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731313AbeGRREW (ORCPT ); Wed, 18 Jul 2018 13:04:22 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:56522 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731297AbeGRREP (ORCPT ); Wed, 18 Jul 2018 13:04:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1531931136; x=1563467136; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=VXgRAku6a8mbWPofUkGA7Pnn2/NcUI10q42YEcDw+C8=; b=nTTjE6ajP2QFZ9mwdX/g0HPEvqGRQGICCbPztkWxVJxgMZXg6sQvX1jS Day+8BwMefHYZ+Rer8jaS1ffe2lcndgTkWv2eLs1Yxu+BLlLhS+mMTHIG XxzgNUD7sdqI+vnXZ5LOFLKC6FdxBvSIIUD86qFceV1ijdzRqMyn+wWi1 a5VuLjUJbeK1tjxoDzF9NspUUDq7DGXkmiONZBrI4p0ByJ42zNDToKwxh VFgVhw/M+bli7HUi9zel1FChtxpLm+kmXK7xuu0w5J2g80PMyy3c5VCgC hT5jJuZ7rmIQdkZg9Nr7Gxc7JJKXmh0I9SzvNGel/pHS8eTx1wTMYZjaA g==; X-IronPort-AV: E=Sophos;i="5.51,371,1526313600"; d="scan'208";a="85087569" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 19 Jul 2018 00:25:35 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 18 Jul 2018 09:14:06 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 18 Jul 2018 09:25:35 -0700 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Max Gurtovoy Subject: [PATCH v5 11/20] nvme-rdma: Simplify ib_post_(send|recv|srq_recv)() calls Date: Wed, 18 Jul 2018 09:25:23 -0700 Message-Id: <20180718162532.14633-12-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180718162532.14633-1-bart.vanassche@wdc.com> References: <20180718162532.14633-1-bart.vanassche@wdc.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Sagi Grimberg Cc: Christoph Hellwig Cc: Max Gurtovoy Reviewed-by: Max Gurtovoy --- drivers/nvme/host/rdma.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index c9424da0d23e..a7fe5479732d 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1038,7 +1038,6 @@ static void nvme_rdma_inv_rkey_done(struct ib_cq *cq, struct ib_wc *wc) static int nvme_rdma_inv_rkey(struct nvme_rdma_queue *queue, struct nvme_rdma_request *req) { - struct ib_send_wr *bad_wr; struct ib_send_wr wr = { .opcode = IB_WR_LOCAL_INV, .next = NULL, @@ -1050,7 +1049,7 @@ static int nvme_rdma_inv_rkey(struct nvme_rdma_queue *queue, req->reg_cqe.done = nvme_rdma_inv_rkey_done; wr.wr_cqe = &req->reg_cqe; - return ib_post_send(queue->qp, &wr, &bad_wr); + return ib_post_send(queue->qp, &wr, NULL); } static void nvme_rdma_unmap_data(struct nvme_rdma_queue *queue, @@ -1244,7 +1243,7 @@ static int nvme_rdma_post_send(struct nvme_rdma_queue *queue, struct nvme_rdma_qe *qe, struct ib_sge *sge, u32 num_sge, struct ib_send_wr *first) { - struct ib_send_wr wr, *bad_wr; + struct ib_send_wr wr; int ret; sge->addr = qe->dma; @@ -1263,7 +1262,7 @@ static int nvme_rdma_post_send(struct nvme_rdma_queue *queue, else first = ≀ - ret = ib_post_send(queue->qp, first, &bad_wr); + ret = ib_post_send(queue->qp, first, NULL); if (unlikely(ret)) { dev_err(queue->ctrl->ctrl.device, "%s failed with error code %d\n", __func__, ret); @@ -1274,7 +1273,7 @@ static int nvme_rdma_post_send(struct nvme_rdma_queue *queue, static int nvme_rdma_post_recv(struct nvme_rdma_queue *queue, struct nvme_rdma_qe *qe) { - struct ib_recv_wr wr, *bad_wr; + struct ib_recv_wr wr; struct ib_sge list; int ret; @@ -1289,7 +1288,7 @@ static int nvme_rdma_post_recv(struct nvme_rdma_queue *queue, wr.sg_list = &list; wr.num_sge = 1; - ret = ib_post_recv(queue->qp, &wr, &bad_wr); + ret = ib_post_recv(queue->qp, &wr, NULL); if (unlikely(ret)) { dev_err(queue->ctrl->ctrl.device, "%s failed with error code %d\n", __func__, ret);