From nobody Fri Apr 15 20:46:46 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A9B0B5D70B9; Fri, 15 Apr 2022 20:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kg7fZ3DCTz4tSR; Fri, 15 Apr 2022 20:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650055606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i16CfQU9A7EUmC2ixJMRL9td1a6na0PvSpw5W3WWGxM=; b=WQQrbMRnC+gfoJrhCuS7SGYx4lXfy9wUzmswzvhT6FKjbh6SHi5egUM5kzErhbiIcUrbJ0 /8noxooTYM7hvexYJG48YS5gMVcaBXtBa6VMIL0h7UyKaiSLrrE4ZvZVFeST1FJ7B9Xpsu GvtHj48NnNb1qyK0GyEIB6z1CqF5xc1FxxPMuxJmjHxmA33g45qCGkh4/Gu9+J372ppVgW xaJgXd7K47kCLNRLR1yJ6ryssdTU1IQ4A+qkHWJguZBVk0Swt/8nUzOWzBF0z/K/rGQyAx EuKc9H7CEHQr7CpBcHIwgTZmniKxRm1vW/gDoen3wqtgL2UeohPxggnrfb2Sgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42CE51C683; Fri, 15 Apr 2022 20:46:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23FKkkHp079327; Fri, 15 Apr 2022 20:46:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23FKkkFJ079326; Fri, 15 Apr 2022 20:46:46 GMT (envelope-from git) Date: Fri, 15 Apr 2022 20:46:46 GMT Message-Id: <202204152046.23FKkkFJ079326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 55412ef90ad1 - main - nvme: Rename min_page_size to page_size and save mps List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55412ef90ad1b03ea8124af7537307a49f52fab3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650055606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i16CfQU9A7EUmC2ixJMRL9td1a6na0PvSpw5W3WWGxM=; b=mpOp6zrV9L8f8sH9yVxJhYreRIuQIMTGEujCCds8AKTS+d5t0YupNPpUZCNbfJ6QTEpiGV rJmd69tsKU0rKn6oCpaJQ+9dYnIMnmIciC2gw4jtY+EMVwQL9ixYIplIJEURLpoI+TMxlc s9QOsitoz1no+QADe0J1vh4Je43+PA0gNM+1k2WU87vBgJvXXFUg57SdeZtLsw3a9LFYEe /9q7hrjkUQ7nXjQVNcJutYZjNY8TM3GivPWBmG1M2UMmLx14J+HHERKs1IdcmTBWCekSUR Rq4PHpo6Sayg26kxoGUtMUteFY0x+hP5mDY99/HmYobAXotaOj0Qn43wC1LCGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650055606; a=rsa-sha256; cv=none; b=piJPlNijTMcgCjc9Pi5ICdMB+f/ygm0Fj1iUpDhePp2VnnvGu96ldIcCOLxDagOg+z5Ovg mABu8IQ8pMvATFXJv3ksvZ7zXOWHyOXlA7qCQHEs6P+ZrLTLypTx0uTBHA5AZaAqQBhNiv QtH7uV68qQAI2+hDU7G4U2TXU/Nm6efaINYkM2qsMzonWQ+kGWtrIrJjcIgK+YOMowcBzu niUVGan0LSYugBIZLqcy/LHQdXuuBO5ChqOkYmaNH/nJKyeHDR+duLST/YQ//+RiukGEJm PUCvVyz+LY52xlRN8uaTsso7+qKiYWGCl/tCrO4bXCMmreyKpR6hkNT3Wrwigg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=55412ef90ad1b03ea8124af7537307a49f52fab3 commit 55412ef90ad1b03ea8124af7537307a49f52fab3 Author: Warner Losh AuthorDate: 2022-04-15 20:41:13 +0000 Commit: Warner Losh CommitDate: 2022-04-15 20:46:18 +0000 nvme: Rename min_page_size to page_size and save mps The Memory Page Size sets the basic unit of operation for the drive. We currently set this to the drive's minimum page size, but we could set it to any page size the drive supports in the future. Replace min_page_size (it's now unused for that purpose) with page_size to reflect this and cache the MPS we want to use. Use NVME_MPS_SHIFT to compute page_size. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D34868 --- sys/dev/nvme/nvme_ctrlr.c | 5 ++--- sys/dev/nvme/nvme_private.h | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 21e33f991749..2bd6514d2a64 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1380,7 +1380,6 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) uint32_t cap_lo; uint32_t cap_hi; uint32_t to, vs, pmrcap; - uint8_t mpsmin; int status, timeout_period; ctrlr->dev = dev; @@ -1432,8 +1431,8 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev) ctrlr->dstrd = NVME_CAP_HI_DSTRD(cap_hi) + 2; - mpsmin = NVME_CAP_HI_MPSMIN(cap_hi); - ctrlr->min_page_size = 1 << (12 + mpsmin); + ctrlr->mps = NVME_CAP_HI_MPSMIN(cap_hi); + ctrlr->page_size = 1 << (NVME_MPS_SHIFT + ctrlr->mps); /* Get ready timeout value from controller, in units of 500ms. */ to = NVME_CAP_LO_TO(cap_lo) + 1; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index eaf0468096c4..851405d7c9f6 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -288,8 +288,9 @@ struct nvme_controller { uint32_t cap_lo; uint32_t cap_hi; - /** minimum page size supported by this controller in bytes */ - uint32_t min_page_size; + /** Page size and log2(page_size) - 12 that we're currently using */ + uint32_t page_size; + uint32_t mps; /** interrupt coalescing time period (in microseconds) */ uint32_t int_coal_time;