From nobody Thu Sep 03 15:34:31 2026 X-Original-To: dev-commits-src-all@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 4hbNtv6pSpz6rQh0 for ; Thu, 03 Sep 2026 15:34:31 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hbNtv5L9pz4DFr for ; Thu, 03 Sep 2026 15:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788449671; 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=G4hVmTdMPJcQw7V1xftNPUbZFelkuw/eIZdXUcMBlco=; b=WAfBy2np4BTWArY6hLoBa88oTXVAZHlbzf3sPPka110aqYYkK0V6Qt7IPBIW6b9dfL+A7n qU7bjSiozTnhDyMmrEtMGdT77B78DiAZVWiwdGv4521/g+mit2PWQ6fe2uEVbbRpco07KK M0apV9rTeVgNGIkQ3Y+FEoxpFx7eAlDTt74S5jVHhcWaeXNNlTreQusOzlXDCeV0JlxIEq umCUcct/0en++7NQPQlXyS9ueUJug1A4+6EHXu1JwiKs1Qlt/8eJDMbJ268RWpf64Emb8I 2YTEPNbe6OPerByUuAy9pHpVX6TZdQTLKbayfcyU5R16axrpXNwNJk08BqC0Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788449671; a=rsa-sha256; cv=none; b=Mtd0bh+UH6wJioI/iGuEoEQjgacseKiQPeNbEDEzzx+gJsu7+KVYmTNhl0uojAMMw6FueP goTNtUmazhmhf/ZfyUTBQukfV0PHbzlbTOA4VtRqWWeRdOJ5i1Br/hgwjuhHgGNNHEemzZ z8lkX0OCckYdfTSSppYRmzgZ7Z8L8uoFABgjpN2M6imVSf91V+rPmn0gqUy2dF+gEFxBdC Zm3BH2PSzPilCsjAYVZEDAF6O8R5ikELdC1J1AoSylsvGFv6bz0IIz8vq3edtKNuAuJcxP k6QoOwh42h8vnLMviW8r7dtHl9TP8FOkLJA6Ed/xItl6KDFeSvipvKqSblaIUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788449671; 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=G4hVmTdMPJcQw7V1xftNPUbZFelkuw/eIZdXUcMBlco=; b=i+Y6304S8aQjcjnPdwhnM2VwEQXua3wLHGZn1YvEnJ4G4fBIw50lFgcsRqtmV6NL9hCtMT crOl9BsawhaEQlcx8QdnCSRCKLICWOAqUyUVABWIcbePdfv3iPHUgr/MR/BxSJW3eLJwCj 0uZR53gW7RTlR86UyPFMv0pe+GwgCqUZvEm5iKuv/qGlMm1BSflDctQeDnfXD9wLnd0tAM wMuIX05kJSG9DHG1cruXOchmXaBX5kPTQ408PwKCeOQJKWXQAUaMKHXcIbO2xhAx29shP4 JsgEBK/YYwOkQhgNWztiOQezYTSSsVj+wZgTFNVmuk0Fy/vnE1r6li6NbAsk4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hbNtv4Lxzz4Sf for ; Thu, 03 Sep 2026 15:34:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31b30 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 03 Sep 2026 15:34:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Abdelkader Boudih Subject: git: 125ec0e30785 - main - nvme: limit namespace character-device I/O size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: seuros X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 125ec0e30785bb0cbca7aa6c0b1a34b75e53078d Auto-Submitted: auto-generated Date: Thu, 03 Sep 2026 15:34:31 +0000 Message-Id: <6a999387.31b30.7a386891@gitrepo.freebsd.org> The branch main has been updated by seuros: URL: https://cgit.FreeBSD.org/src/commit/?id=125ec0e30785bb0cbca7aa6c0b1a34b75e53078d commit 125ec0e30785bb0cbca7aa6c0b1a34b75e53078d Author: Abdelkader Boudih AuthorDate: 2026-09-03 15:34:11 +0000 Commit: Abdelkader Boudih CommitDate: 2026-09-03 15:34:11 +0000 nvme: limit namespace character-device I/O size The namespace character device does not initialize si_iosize_max, so physio falls back to DFLTPHYS and can produce a bio larger than the qpair payload DMA tag on a controller whose maximum transfer size is below 64KB. Such a bio fails DMA mapping and is never submitted. Approved by: ngie (co-mentor) MFC after: 1 week Reviewed by: ngie, imp Differential Revision: https://reviews.freebsd.org/D59152 --- sys/dev/nvme/nvme_ns.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_ns.c b/sys/dev/nvme/nvme_ns.c index 4f2ff826e184..0082d5cb6299 100644 --- a/sys/dev/nvme/nvme_ns.c +++ b/sys/dev/nvme/nvme_ns.c @@ -602,8 +602,10 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, * cdev may have already been created, if we are reconstructing the * namespace after a controller-level reset. */ - if (ns->cdev != NULL) + if (ns->cdev != NULL) { + ns->cdev->si_iosize_max = ctrlr->max_xfer_size; return (0); + } /* * Namespace IDs start at 1, so we need to subtract 1 to create a @@ -623,6 +625,11 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, ns->cdev->si_drv2 = make_dev_alias(ns->cdev, "%sns%d", device_get_nameunit(ctrlr->dev), ns->id); ns->cdev->si_flags |= SI_UNMAPPED; + /* + * Limit physio requests to the controller's maximum transfer size. + * The qpair payload DMA tag is constructed with the same limit. + */ + ns->cdev->si_iosize_max = ctrlr->max_xfer_size; ns->flags |= NVME_NS_ALIVE; return (0);