Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp367714imm; Thu, 28 Jun 2018 22:21:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmO2AjAvKjLPag9RY6PkeIUGJ/lji4FVcNp7s5wQGI4ctygN/lIEp/V5LmH32KFR1yd4uC X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr13198733plo.281.1530249708475; Thu, 28 Jun 2018 22:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530249708; cv=none; d=google.com; s=arc-20160816; b=Hvg07uo5cG8WJWs3kAhzx8ys2HOKLlVxNVN+FSsMCMhWJDktswTx42/N/iXW8xk+Wk sYmG7vICWK8++faKif0fp42Mp3poR1YRYSnxh8oAb5W8lnAn4fJLxNd/H6nIT5lhy1no 0FsZRJtL+F8ltwvVR3C8smDmdKZNoAtmUQw6S/kssw3AxfOzth1bKdobWPbcraV1iyLq iLvHHuWQt1E2vpOAyWcUy7rt0j7izs0gWhqhoyt43JQXWDgKHP//5pvqlnjdg14uXlS2 UUgIv1krnjtw3OENDeltNgk4Q3ipjN9APsjS3I5+J0/fGGU98lmzVyCWoG5SFuzQavIA mraw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:arc-authentication-results; bh=eG6Ggniakijcbd9ZiTPGnJVExj3w76PKn+whQO26XB0=; b=NaEJ9UVSQJ64jHomhRqMK+HTX2YiuRgLLQAprp4ofnzjWsEPUS6CMTRn/KDG/Ac/sy GEdUbE7ub2gNLvxkeKxClzHJiFElJf5G2wO0vW2scIYqLQEr/md11FN6XXPURTKwNwa0 sb6epuYM/JznPiBiFE5olbmhMfW3ZpMz1OEUe3dQWR3W5aKcgenIMlItoodgNZCCPpY6 I4PjQ7vI7XjWzltRDAuQlr1QPLpCL6BnfbtQiqrTzs2Gn58bqqp+7qA36w3Xzzi73cPw +Safgj/EUEqK54mDvKx98ndP+Sc0qVoiHSTlh+expew2ANwW+kXyaL852BO/NvCe2Yzb KWUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19-v6si7091452pgb.629.2018.06.28.22.21.33; Thu, 28 Jun 2018 22:21:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936077AbeF1U5O (ORCPT + 99 others); Thu, 28 Jun 2018 16:57:14 -0400 Received: from mga09.intel.com ([134.134.136.24]:31844 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934003AbeF1U5M (ORCPT ); Thu, 28 Jun 2018 16:57:12 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 13:57:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,284,1526367600"; d="scan'208";a="50702325" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga007.fm.intel.com with ESMTP; 28 Jun 2018 13:56:57 -0700 From: Keith Busch To: Johannes Thumshirn , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Jens Axboe Subject: [PATCH 3/5] nvme: cache struct nvme_ctrl reference to struct nvme_request Date: Thu, 28 Jun 2018 14:55:59 -0600 Message-Id: <20180628205601.13742-3-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180628205601.13742-1-keith.busch@intel.com> References: <20180628205601.13742-1-keith.busch@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sagi Grimberg We will need to reference the controller in the setup and completion time for tracing and future traffic based keep alive support. Signed-off-by: Sagi Grimberg --- drivers/nvme/host/fc.c | 1 + drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pci.c | 2 ++ drivers/nvme/host/rdma.c | 1 + drivers/nvme/target/loop.c | 1 + 5 files changed, 6 insertions(+) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 41d45a1b5c62..9cc33752539a 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -1737,6 +1737,7 @@ nvme_fc_init_request(struct blk_mq_tag_set *set, struct request *rq, int queue_idx = (set == &ctrl->tag_set) ? hctx_idx + 1 : 0; struct nvme_fc_queue *queue = &ctrl->queues[queue_idx]; + nvme_req(rq)->ctrl = &ctrl->ctrl; return __nvme_fc_init_request(ctrl, queue, op, rq, queue->rqcnt++); } diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 0c4a33df3b2f..f2249387b60d 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -102,6 +102,7 @@ struct nvme_request { u8 retries; u8 flags; u16 status; + struct nvme_ctrl *ctrl; }; /* diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index ba943f211687..8dcae11bbf3a 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -418,6 +418,8 @@ static int nvme_init_request(struct blk_mq_tag_set *set, struct request *req, BUG_ON(!nvmeq); iod->nvmeq = nvmeq; + + nvme_req(req)->ctrl = &dev->ctrl; return 0; } diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 9544625c0b7d..ade55977d432 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -286,6 +286,7 @@ static int nvme_rdma_init_request(struct blk_mq_tag_set *set, struct ib_device *ibdev = dev->dev; int ret; + nvme_req(rq)->ctrl = &ctrl->ctrl; ret = nvme_rdma_alloc_qe(ibdev, &req->sqe, sizeof(struct nvme_command), DMA_TO_DEVICE); if (ret) diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index d8d91f04bd7e..af7fbf4132b0 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -227,6 +227,7 @@ static int nvme_loop_init_request(struct blk_mq_tag_set *set, { struct nvme_loop_ctrl *ctrl = set->driver_data; + nvme_req(req)->ctrl = &ctrl->ctrl; return nvme_loop_init_iod(ctrl, blk_mq_rq_to_pdu(req), (set == &ctrl->tag_set) ? hctx_idx + 1 : 0); } -- 2.14.3