From nobody Fri Jul 21 04:32:34 2023 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 4R6c9G4S9qz4nwkc; Fri, 21 Jul 2023 04:32:34 +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 4R6c9G2NMqz3php; Fri, 21 Jul 2023 04:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913954; 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=zQvyYT+PnA5LGCJLd0v3+1ZryvBcUdiiRPb4lg0Uqhw=; b=L5Jza8yajZG4mMTl/Sb/2njj6uK+QrYWSVv33Y7IbEHGhspj59dnnzxLX6YyqoD8PVSPXN mudr0znvdp2UZz8l0UqZHaIn2oIHlESVDSBrf/Zj+DC0JpOM/KmqO6rAEl6Li/V/B6Khge n0ivpNVqoluUFkZwn620Q7RC4nkaLf+QDVdxM1ubcuJkMif3rOH02wvO6GgEdCTIvmK8oo HPIvZyClxDa7rFo3s3Pqde8/Ealj1RZan6yrD5cW08YfAd0MYoIYFJBBigsKS0C34HUs/w 8ENgMfo4OKHM4Ad2FD6plIuv21XrJ7Nw0hXPzoEQ4dars/9NpRDss2fV0A1jfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913954; 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=zQvyYT+PnA5LGCJLd0v3+1ZryvBcUdiiRPb4lg0Uqhw=; b=Gnb5fjLyngeQdPQWp4GBOyK59rYXBjmuQz19f2nEUJ22mnVM2eRZgYTr+GAssLhXRIHxoG EW5IbStqRP9pbH7U2/+lQRLFB7bYU7RVY6yspigagj7j6iZO4+eH81z9g6asTsiOoNqDB3 Qd3muK1WtiEJpCA6VAIPP9Baft2Q74jwmhVtQJFeokf48pnNbQutw5bSPg8KdkxwysI6G3 lrgcf/jpIlHjq62+llx2LKZeljOGPgytnlPMiLdczT6TAo4s/lOdDYzCXI/3pyv0UWtQMK GgtYx9l9JxK5eYpk0UzW/red128PW9p4WdECgtz8/d+kE6kKcy9anri39vpKSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913954; a=rsa-sha256; cv=none; b=f6sdDoK+Lv0w/eYNXcxnuiO1GFTRx7mACZWJmKN2+sbWl5SzQYFBoQeOW5yHfX+qlpM4FJ GPp7VcDnyV92A/E/tUmgaQjF0YScm9Q8lsV7MYGbO1DbqtuI/GKjJgRc5VkePtxW6nqzQn q4zwLsqyHQ72PXOTKI1xcJZYtkOToq7zq9DcufSdnd8mxXWT7tulEFVP/vwdbXc3UGcxDN ZON8Zv5Mkv/obLTqbH1dIXEK+iT6xCQMa3EVCFbEZiLz6Y48phO6F1Q4fjNcaek64MW6UT UWNbVHkhnHPsMXU9vLuNJOl/CnmREGDVDUmJDcg+VpoWw0f+diHdUYpk0XfJIg== 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 4R6c9G1VNKzyMv; Fri, 21 Jul 2023 04:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4WYeO014801; Fri, 21 Jul 2023 04:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WYir014800; Fri, 21 Jul 2023 04:32:34 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:34 GMT Message-Id: <202307210432.36L4WYir014800@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: 774ab87cf27b - main - cam: Add CAM_NVME_STATUS_ERROR error code 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 774ab87cf27beb3669693f14b9c89ebaf542eaf3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=774ab87cf27beb3669693f14b9c89ebaf542eaf3 commit 774ab87cf27beb3669693f14b9c89ebaf542eaf3 Author: Warner Losh AuthorDate: 2023-07-21 04:22:37 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam: Add CAM_NVME_STATUS_ERROR error code Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that completed with an error status as CAM_NVME_STATUS_ERROR (a new value) instaead of CAM_REQ_CMP_ERR. This indicates to the upper layers of CAM that the 'cpl' field for nvmeio CCBs is valid and can be examined for error recovery, if desired. No functional change. nda will still see these as errors, call ndaerror() to get the error recovery action, etc. cam_periph_error will select the same case as before (even w/o the change, though the change makes it explicit). Sponsored by: Netflix Reviewed by: chuck, mav, jhb Differential Revision: https://reviews.freebsd.org/D41085 --- sys/cam/cam.h | 7 ++++++- sys/cam/cam_periph.c | 1 + sys/cam/nvme/nvme_da.c | 1 + sys/dev/nvme/nvme_sim.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam.h b/sys/cam/cam.h index 99f7b6a7f5c2..eacf3a248ce9 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -240,7 +240,12 @@ typedef enum { CAM_REQ_SOFTTIMEOUT = 0x1f, /* - * 0x20 - 0x32 are unassigned + * NVME error, look at errro code in CCB + */ + CAM_NVME_STATUS_ERROR = 0x20, + + /* + * 0x21 - 0x32 are unassigned */ /* Initiator Detected Error */ diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index fe256e84cd2c..8defdc9ecbe6 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1996,6 +1996,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ case CAM_ATA_STATUS_ERROR: + case CAM_NVME_STATUS_ERROR: case CAM_SMP_STATUS_ERROR: case CAM_REQ_CMP_ERR: case CAM_CMD_TIMEOUT: diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index f2fb1b79f452..9beef786f320 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1285,6 +1285,7 @@ ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) #endif break; case CAM_REQ_CMP_ERR: + case CAM_NVME_STATUS_ERROR: #ifdef CAM_IO_STATS softc->errors++; #endif diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index ec8cc03cb774..ad6783adf181 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -74,7 +74,7 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_completion *cpl) memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl)); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; if (nvme_completion_is_error(cpl)) { - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + ccb->ccb_h.status = CAM_NVME_STATUS_ERROR; xpt_done(ccb); } else { ccb->ccb_h.status = CAM_REQ_CMP;