Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1246206imm; Fri, 29 Jun 2018 14:16:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdpdbeww3QeKEdVpXIIYVhl//Z1zF4ExgZPD/yE3kP/xGUwWzSRs1CkfA23zG8K2VkfMpDO X-Received: by 2002:a65:66d7:: with SMTP id c23-v6mr10109326pgw.427.1530306987027; Fri, 29 Jun 2018 14:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530306987; cv=none; d=google.com; s=arc-20160816; b=gTtPJ4ElexE9iAvbdsKMsxxbmWR9NE3+Yf50kujLcYvGhnia+QVAOLl3JfgR/dsIOq I41RITXKOfrJXRhL0V2fnB6Ie99QaXC5el4aS37ZFz28Yz5jjOlwURcAsJjbItt69/qT 3qkOLXcB/myqWza3LZZDJJYKS87H3ppRE69avuRnWItTXA8MdVm6+YCicroryWFwkIIp V/1h5w24axtE4H0+JnAxWVwIuiPUXx9ZZ7/MLKZm4CwiqIg1w88JlI/aqsIm5h6xSmph CaHizWyuQJ2IP/IH4X5fzPjWptwxKpY/bG1lrh9GbnD8v/YFJjY7ZXTqcP3JtnpF6bKp U3pw== 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=ZMaADBGjoqN2WWDuUosv1C053+7RVO9L6su3g70RAr8=; b=To53jlvXueCL7GzwvYsD6q9fFjKxOJBXPLoBpIYRxYAEyYXGdvEhcu+Pgtot/hUYQB vI+gVxbfGUMlq1WT5afvYIJ+K3GYRY9KzSE0s2tB1CusP5BvLfKb7MzEUQsdb3+el7Y6 TiLexeEu7AdP4xOX8MjQ6N0W6oDhr9CUQtjjziucE3seNA3EmmnMth6OO0+1NXA+ec3K 3ugRGJIQeBqvTSeZZ+Yt3klgOA0hUtDOO4Wp9kAa8ZPEorBxwD4CPQhihb48BYVtAGoQ iSn+RiuU4OQhZR9lk3bdgwuc0pzrh1WYGoXiHI0ca+9D2BFG5KubwIAGlQ8sVP1aXMzE teSA== 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 u8-v6si9603436pfm.63.2018.06.29.14.16.12; Fri, 29 Jun 2018 14:16:26 -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 S937266AbeF2UAt (ORCPT + 99 others); Fri, 29 Jun 2018 16:00:49 -0400 Received: from mga11.intel.com ([192.55.52.93]:19117 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932396AbeF2UAr (ORCPT ); Fri, 29 Jun 2018 16:00:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 13:00:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,287,1526367600"; d="scan'208";a="241791986" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga006.fm.intel.com with ESMTP; 29 Jun 2018 13:00:46 -0700 From: Keith Busch To: Johannes Thumshirn , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCHv3 1/4] nvme: cache struct nvme_ctrl reference to struct nvme_request Date: Fri, 29 Jun 2018 13:59:57 -0600 Message-Id: <20180629200000.16171-2-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180629200000.16171-1-keith.busch@intel.com> References: <20180629200000.16171-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. Reviewed-by: Johannes Thumshirn 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