From patchwork Sun Jun 18 15:21:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9794869 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 0CC7B601C8 for ; Sun, 18 Jun 2017 15:22:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3355283AF for ; Sun, 18 Jun 2017 15:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8104283C0; Sun, 18 Jun 2017 15:22:26 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, URIBL_BLACK 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 995BA283AF for ; Sun, 18 Jun 2017 15:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753214AbdFRPW0 (ORCPT ); Sun, 18 Jun 2017 11:22:26 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52134 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbdFRPWZ (ORCPT ); Sun, 18 Jun 2017 11:22:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PR0szzsV3ZaHgOkvLOdfjQH8XWMjcQyZFFbtSY37nSk=; b=ChKF1HpH1a2dMjcFrJAFtW/TS QxGsKxII9/zARWFYuyACJM/VqV6MnSDAibUFTR1wpEXuk1SUBGgn7lFO/qII1BmxFCMY2vI7cUIZ2 wWzfzp5l8ecFkSjyQzvXzmLl96NrYjsehadeDqCFOP2Xm3gY3d8O73hDK5G2+du3/n4HLAZEOGbUp ZAmAHRPKpWyJ9BmIkindoZGQRRTAvOoSQ4GJtCCNuyNCODpva3/b3bLmgGMj5xTmvDAV3DcsmSKeF 2KPkAxBu6fAjZYG/5HQjBEZnMvLetQlh81MtbzoesGyRcYYmMugLpZVsOnjKUuc7q5m8+XxrEGoT7 g1tqKh8iw==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dMc1u-0006WN-O8; Sun, 18 Jun 2017 15:22:23 +0000 From: Sagi Grimberg To: linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Keith Busch , linux-block@vger.kernel.org Subject: [PATCH rfc 11/30] nvme: move controller cap to struct nvme_ctrl Date: Sun, 18 Jun 2017 18:21:45 +0300 Message-Id: <1497799324-19598-12-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497799324-19598-1-git-send-email-sagi@grimberg.me> References: <1497799324-19598-1-git-send-email-sagi@grimberg.me> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Will be used in centralized code later. only rdma for now. Signed-off-by: Sagi Grimberg --- drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/rdma.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 3be59634b4af..5b75f6a81764 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -159,6 +159,7 @@ struct nvme_ctrl { u16 kas; u8 npss; u8 apsta; + u64 cap; unsigned int kato; bool subsystem; unsigned long quirks; diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 58ed2ae3cd35..cd637e28647b 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -119,7 +119,6 @@ struct nvme_rdma_ctrl { struct blk_mq_tag_set admin_tag_set; struct nvme_rdma_device *device; - u64 cap; u32 max_fr_pages; struct sockaddr_storage addr; @@ -826,7 +825,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, bool new set_bit(NVME_RDMA_Q_LIVE, &ctrl->queues[0].flags); - error = nvmf_reg_read64(&ctrl->ctrl, NVME_REG_CAP, &ctrl->cap); + error = nvmf_reg_read64(&ctrl->ctrl, NVME_REG_CAP, &ctrl->ctrl.cap); if (error) { dev_err(ctrl->ctrl.device, "prop_get NVME_REG_CAP failed\n"); @@ -834,9 +833,9 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, bool new } ctrl->ctrl.sqsize = - min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize); + min_t(int, NVME_CAP_MQES(ctrl->ctrl.cap), ctrl->ctrl.sqsize); - error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap); + error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->ctrl.cap); if (error) goto out_cleanup_connect_queue;