Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp412800imm; Thu, 28 Jun 2018 23:23:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwMp7VGy4qQZ99qyoxRhMk86aa2rZ5C8DSZd+ALtPsBP6UIftotvIX24Uya69BQLVIX7s8 X-Received: by 2002:a65:4d4b:: with SMTP id j11-v6mr11470613pgt.430.1530253383290; Thu, 28 Jun 2018 23:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530253383; cv=none; d=google.com; s=arc-20160816; b=QX4ulf1kAOWEu1Y9EMKNZ3Jm8+I4n0J8d7uEZJq7fpLVbA5H5F1aouYbCZsE1eEQXG a0yjBITTT1DgRGUUlQBkP6UMd+ecsVujAgNVJEGH/Zsx8xZ3TatD84lg2pEOSGFBzWOP t1/njr7dOxtTMP+coRY9gKOMs7z4JAvzkzPHy8k1b0FxMUFktwg4cS8WeXlXy2NLwuHG QsHjHpQvS5IYz27jHw1EPU8ra35yqCHHOP6O7EfHXpk7RmmLLa2sbtp15FYEyPo4ERPs dDaO6clEYJjtXSzaww+KEJiIdfM40bf7JJCZOi9tMwncPnNUOdEhNQ4QHoxO6EnW483V maDQ== 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=WHXm3kq1rFM30lWLtzsrRUglEgbEseNo6feuvknUcMfvQi/3r9FFZsJPNVFsszAF17 C9R88ELzOjBqD1NeWMAde+QKBf6MBsqhJko+s3hi79GKpY7e+RghfnTR87bHnXYMmUYR +d85XyPdWJmd/x7pc0w30cTkNBtMI/0tvYSiiM27019c3r5G/F55HoExsAi88ymuGKcI Mww8A4xWJyfP/V0mN0nDuxnB0+NKOWDYi32h1Ok60mGQ/bZxB5K9yiW6aXC4gnLNkk99 jy7XDB2Rjndd1Ap0Ao8VZqUm1aQ/6lmQsioHxJO1dGUq0yAlWmEFyP8VYoxSIhpap9+T NWZQ== 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 c18-v6si8128362pfn.245.2018.06.28.23.22.49; Thu, 28 Jun 2018 23:23:03 -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 S967211AbeF1Vwm (ORCPT + 99 others); Thu, 28 Jun 2018 17:52:42 -0400 Received: from mga05.intel.com ([192.55.52.43]:16533 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966640AbeF1VvB (ORCPT ); Thu, 28 Jun 2018 17:51:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 14:51:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="67214449" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga004.fm.intel.com with ESMTP; 28 Jun 2018 14:50:48 -0700 From: Keith Busch To: Johannes Thumshirn , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCHv2 2/4] nvme: cache struct nvme_ctrl reference to struct nvme_request Date: Thu, 28 Jun 2018 15:49:54 -0600 Message-Id: <20180628214956.13877-3-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180628214956.13877-1-keith.busch@intel.com> References: <20180628214956.13877-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