From nobody Fri Apr 15 20:46:44 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 76AE45D7129; Fri, 15 Apr 2022 20:46:45 +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 4Kg7fY1gkFz4tZv; Fri, 15 Apr 2022 20:46:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650055605; 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=yvNvC33f34qhzbb6YoPwqIMdqRxfKZ4C6mnFKEeGALk=; b=E3IH+BWz2Md7TY2M+HCQk5IYeHgLxXQ3OnV/zE86m7qm/XmLpTaQFBHYvmK+3Vde3af1x6 /BNer2Kx+V0juiF5rs+QvFR6NwmULs26T+OWrAOjCcYIHkWH9ds/YDlPx/VnpDQFt2RU9/ RgayrZlh+s+EaOJOnfIcFFDkFErlruTHwsKaYlkg0xyVtUbtWLPPN30AB0Cxw/F5+Xs0/G OTiDU2KQwQVn40BgmvSR+iq7T4kftnP5LXIdLttpfYCg3R2UshqhCMvkov9uoCDKMuTAQ1 SaGVgpQhvn9036LyWBzuPoG88rir672zaTzQA/MpkoprP2UM0ajus66Vt+J50g== 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 0DFDC1C1EC; Fri, 15 Apr 2022 20:46:45 +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 23FKkiwx079303; Fri, 15 Apr 2022 20:46:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23FKkicg079302; Fri, 15 Apr 2022 20:46:44 GMT (envelope-from git) Date: Fri, 15 Apr 2022 20:46:44 GMT Message-Id: <202204152046.23FKkicg079302@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: 6e3deec8caab - main - nvme: Base maximum data transfer size directly on MPSMIN in cap_hi 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: 6e3deec8caab01a4de2bb446f8c5e799ed864562 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650055605; 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=yvNvC33f34qhzbb6YoPwqIMdqRxfKZ4C6mnFKEeGALk=; b=Oe71J7agMwLHA+V3zD6o5ZUcjEO/HettB6dwy4z+W8TUAUg3c2NLy6NpY7Av4PEB24UL6d 6xgYQpwq68SG1p4ZLXH9TIWF/9MmOIqjjePejJgwKoHmoN7DXBvYU1xYb55cbV2ZmkAhOE VyjlmCVSBSGG03PcujVbBdV2Za23pH/kg81tNPnZLqFmicAcpjIx0uunAmcsj8a4/ZNzIy 7DF26BefAXyFs0jDLWLB/UHQyU3tY2oxy6fyTa+WgSmMO0L6GDLiUXGRtD/rsVt73VdVvp yJ6l14EUtiRyCdcUXYow8151sKdwbZFix7vOoTaSlJBNEfFoMzMFe75bkIFL9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650055605; a=rsa-sha256; cv=none; b=OVe905htk94WQhvUcmVOJu/rT3yRqKJnYxnd1AOjJ8a3shtKSy/TZd8WIVh52+4J3hklqo uA8/3oFJRLyGYMY8YZk3HCWy45ox2ZtobRpPJc2OVlHjErPDWihi1WIYSBVe4RDVR3uTYG Ma+B/AWna4nluCCF97oa81URDe2Xx4F1vOO7ddRTpQxvUMCXVCCCJZm64npaD6A4t2axmr RTwQ7GPFuUKBSyprhmVfEeon6SeM+cqgeRNyzcZkWabqdeamiLmt68boAMBVJxrF0e808z 3/L33IQTNiur1Ag9HVVOaqvxSUxt1kluLY5edTuT7CQMNJ9nWtSBo5+gwohqMQ== 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=6e3deec8caab01a4de2bb446f8c5e799ed864562 commit 6e3deec8caab01a4de2bb446f8c5e799ed864562 Author: Warner Losh AuthorDate: 2022-04-15 20:41:05 +0000 Commit: Warner Losh CommitDate: 2022-04-15 20:46:18 +0000 nvme: Base maximum data transfer size directly on MPSMIN in cap_hi Calculate the maxmimum transfer size based on the MPSMIN we have in our cached copy of cap_hi rather than using min_page_size in the controller. Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D34867 --- sys/dev/nvme/nvme_ctrlr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 6996b3151b0d..21e33f991749 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -474,7 +474,8 @@ nvme_ctrlr_identify(struct nvme_controller *ctrlr) */ if (ctrlr->cdata.mdts > 0) ctrlr->max_xfer_size = min(ctrlr->max_xfer_size, - ctrlr->min_page_size * (1 << (ctrlr->cdata.mdts))); + 1 << (ctrlr->cdata.mdts + NVME_MPS_SHIFT + + NVME_CAP_HI_MPSMIN(ctrlr->cap_hi))); return (0); }