From patchwork Wed Mar 18 15:02:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Gurtovoy X-Patchwork-Id: 11445453 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B279E90 for ; Wed, 18 Mar 2020 15:03:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9092A20775 for ; Wed, 18 Mar 2020 15:03:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgCRPDB (ORCPT ); Wed, 18 Mar 2020 11:03:01 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:38032 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726762AbgCRPDA (ORCPT ); Wed, 18 Mar 2020 11:03:00 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maxg@mellanox.com) with ESMTPS (AES256-SHA encrypted); 18 Mar 2020 17:02:57 +0200 Received: from mtr-vdi-031.wap.labs.mlnx. (mtr-vdi-031.wap.labs.mlnx [10.209.102.136]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 02IF2vEM008733; Wed, 18 Mar 2020 17:02:57 +0200 From: Max Gurtovoy To: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de, loberman@redhat.com, bvanassche@acm.org, linux-rdma@vger.kernel.org Cc: kbusch@kernel.org, leonro@mellanox.com, jgg@mellanox.com, dledford@redhat.com, idanb@mellanox.com, shlomin@mellanox.com, oren@mellanox.com, vladimirk@mellanox.com, rgirase@redhat.com, Max Gurtovoy Subject: [PATCH v2 2/5] nvmet-rdma: add srq pointer to rdma_cmd Date: Wed, 18 Mar 2020 17:02:54 +0200 Message-Id: <20200318150257.198402-3-maxg@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200318150257.198402-1-maxg@mellanox.com> References: <20200318150257.198402-1-maxg@mellanox.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org This is a preparetion patch for the SRQ per completion vector feature. Signed-off-by: Max Gurtovoy --- drivers/nvme/target/rdma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index 37d262a..04062af 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -38,6 +38,7 @@ struct nvmet_rdma_cmd { struct scatterlist inline_sg[NVMET_RDMA_MAX_INLINE_SGE]; struct nvme_command *nvme_cmd; struct nvmet_rdma_queue *queue; + struct ib_srq *srq; }; enum { @@ -461,8 +462,8 @@ static int nvmet_rdma_post_recv(struct nvmet_rdma_device *ndev, cmd->sge[0].addr, cmd->sge[0].length, DMA_FROM_DEVICE); - if (ndev->srq) - ret = ib_post_srq_recv(ndev->srq, &cmd->wr, NULL); + if (cmd->srq) + ret = ib_post_srq_recv(cmd->srq, &cmd->wr, NULL); else ret = ib_post_recv(cmd->queue->cm_id->qp, &cmd->wr, NULL); @@ -882,6 +883,7 @@ static int nvmet_rdma_init_srq(struct nvmet_rdma_device *ndev) ndev->srq_size = srq_size; for (i = 0; i < srq_size; i++) { + ndev->srq_cmds[i].srq = srq; ret = nvmet_rdma_post_recv(ndev, &ndev->srq_cmds[i]); if (ret) goto out_free_cmds;