From nobody Fri Jan 21 02:26:49 2022 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 427CA1968B69; Fri, 21 Jan 2022 02:26:50 +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 4Jg3D95mSnz4p3P; Fri, 21 Jan 2022 02:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642732009; 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=Sw+e0qKWQtF5LQKuoElxmSe09aw3E/iqfbLoBW+Ln9Q=; b=R+TsaMH1XACI31BFppR4dw8krYR2BWQQtZgFEJU7TMti/UvaTX+qL85cDlMcbWb9a7r8LY Q/GbUf9xHM1aEpwcDwV5sjnDYCSmxoQw6yfqLdFhP8vXMd9PZevVwmjsQzwp97DDPpGcSs HLoLxN6ParYBa/SOdVRASi5swMP/TPz4M7JDjNRD3BS+BMWZurHR2Kgw9+hlBHZ+GQwYzD VKh+qccZgIAJHpl6N+qlHdpQnB8jXBhvzuPNJ6F1vEm0WLjTq4J+xAoNNpu8EMvIATWVOH M/lucZnx72emdTTN6OFTmtCRSQhT7JTwI9AYdBfjQm32F09viuBFzo06qM2s8A== 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 56CEF13CAD; Fri, 21 Jan 2022 02:26:49 +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 20L2Qn24001155; Fri, 21 Jan 2022 02:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20L2QnQD001154; Fri, 21 Jan 2022 02:26:49 GMT (envelope-from git) Date: Fri, 21 Jan 2022 02:26:49 GMT Message-Id: <202201210226.20L2QnQD001154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 24d2d1813e82 - stable/13 - nvme/nda: Fail all nvme I/Os after controller fails 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 24d2d1813e82224cf30820206d165260a301811d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642732009; 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=Sw+e0qKWQtF5LQKuoElxmSe09aw3E/iqfbLoBW+Ln9Q=; b=OgzjWVa52WGL+7sZvC+AypEInprKv+rAk1RLmLfRtPN13OmITjZJ1tJtTWIQZcGJTK1QIA Hyf/GKPSgS3JyJt71oB/QFRY2rf+oRvpuZZZwP0fEdhP9tlX5KNnrsMvwFxsv+2ntKSW61 y0JfTu+0lZXWKsBT5+pgxMks+yVjyk+0fm9P4LkOHS9qaZ+w/DXzeXs+A1/tGtU5VgHHu7 hXSro28l8CpNjkVc/O/gKSC9UBQ2jL55iFy5oPox4VdeprIRKDwxfAjjfOpKio2K8FjJog BWydcRVgIdiuygurUaAwr76r23f99iy8ADnYkGxr8SJVqJHWq64vJ7YQiNayCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642732009; a=rsa-sha256; cv=none; b=Hb6qn9A8amNvdtKBBmLMpB27vRRu26SXp9dBQT+zmxRUV7zc/SBKg9eqWZSkVI/yyEwMPg KYu4fA6jBgXFnBP/SdVXK8D4QMVNtRmytJwaaQoLwZH0gIcsHYsNTGM+NLmkrO1Ye7sNT+ fJOwFM8D3oQG7GJ3KYFkPQIJfymfeMbkw3kZgOKxfZMIclwTbLcRMwk3C6tPXw0m7irYiO QMdumGtZWDmKhRcu58lj0GoUt23ie7bDgzmHi581GqQrVl4cBNTrEYTRYUQTm9/H9u399T U/u/5GIk9k6AWlLaS+t2B4NSppC21G/RaiOGC8Vv0T7HGkYHfurY2jQsQFJmvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=24d2d1813e82224cf30820206d165260a301811d commit 24d2d1813e82224cf30820206d165260a301811d Author: Warner Losh AuthorDate: 2021-09-17 20:56:58 +0000 Commit: Alexander Motin CommitDate: 2022-01-21 02:07:30 +0000 nvme/nda: Fail all nvme I/Os after controller fails Once the controller has failed, fail all I/O w/o sending it to the device. The reset of the nvme driver won't schedule any I/O to the failed device, and the controller is in an indeterminate state and can't accept I/O. Fail both at the top end of the sim and the bottom end. Don't bother queueing up the I/O for failure in a different task. Reviewed by: chuck Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31341 (cherry picked from commit 4b977e6dda92fe093ea300f1a91dbcf877b64fa0) --- sys/dev/nvme/nvme_qpair.c | 8 +++----- sys/dev/nvme/nvme_sim.c | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index eea87e299d3d..71718acff66f 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1078,12 +1078,10 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) if (qpair->ctrlr->is_failed) { /* - * The controller has failed. Post the request to a - * task where it will be aborted, so that we do not - * invoke the request's callback in the context - * of the submission. + * The controller has failed, so fail the request. */ - nvme_ctrlr_post_failed_request(qpair->ctrlr, req); + nvme_qpair_manual_complete_request(qpair, req, + NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST); } else { /* * Put the request on the qpair's request queue to be diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index efec8d34868a..06e645ebdf90 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -258,6 +258,10 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) break; case XPT_NVME_IO: /* Execute the requested I/O operation */ case XPT_NVME_ADMIN: /* or Admin operation */ + if (ctrlr->is_failed) { + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + break; + } nvme_sim_nvmeio(sim, ccb); return; /* no done */ default: