From nobody Mon Nov 06 19:11:20 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 4SPLYN2DXvz4yjxy; Mon, 6 Nov 2023 19:11:20 +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 4SPLYN1n3qz3D1F; Mon, 6 Nov 2023 19:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699297880; 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=2tVwCWnv+/RAJACA83Z3M8OIAw0Q2u5QLDFRJQ/1z7M=; b=E+SCQKKcXzT52S7N/gn1w3GxRJ5OIenbcD8402N/Z9Fl0YQBsqJTPGGWuTOnXkvJ9PpAzK q0zxg4rUhqJiPhGhKoIghEohihWXTCoFYA7uF30tv53SAdYO+q7JsLisqdtHivb2nzfgLc Ra7Qkl1nFNB5ecNtEMZe2zJl/+8oPsA57NP6ZD8+U+GEsi3e1z7DAdOUl5nO/O5h8GFZmD C+777vIDkUjh4L3JFPb+0rh++t7f9AWCVW4gE/JCJ0RpLKlR+IIX363wwH8xn8UlP7vTCX Yqk/6gkVPBm4vadvp188JGUE516CC7QWxmlRX3H6cS+NGzwQszkk5nQiUrQjiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699297880; 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=2tVwCWnv+/RAJACA83Z3M8OIAw0Q2u5QLDFRJQ/1z7M=; b=PGKQGwoMqgXdDQqkfUWrxyba7Gr+zJUvFSnldNqTN+xiKaPCFOupVUTGUTyAESw3QjfjLe pkhxLj5E/g7CshlSqHGaDwRu9Wc/lioq54aZA4ND9iFkdle7Y6n0JMWjv503LNj4f2xPXH PHay65P0h0RlajCxTCNbCEdC7CAR1HLNDnFmc5F9chtZWDOcAvZ+e9JHHoHraw6a1MNIjY KLT8+1ZrMkxn9FZES0wWTprSGWuGHTR1E88SyGkAJp8zhQboEEJC8Uwfw3bRe9VCDy67CQ oHn504g/k2PHzDhUJ+OuICUHm5/ZIQ9Al8r53zLDeBxr6Y7nc+rITbbYMTCd3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699297880; a=rsa-sha256; cv=none; b=boxUirzbWIin50ZZyYq1ojO+Rl69rpaHF0my/+V3DCXnaksdmHbRrh248eGKlLXnUKUmlf 1vzPCv54oIQbMX3brBBJU9asJok+edP2Nqy+CRkp3er/z+uMTzc09/L1a9vC5fyjpM9TVZ 0q9EMDd3zyJuGCPgEkAJmYmo0f5VQj97i67naE98vgZTJpmS5vEwjwh/e8tId/E0u+dLQb Egj3G+Ur4aD95nNRJYpoVRHZPSn3a1pXmoYb9SeSX8mjRefQla+YZ1JzrXJiRyz1PjLM0B Y7U2Ef+RTAVDXoVzxCjSN5scOOs5C/RpaBfLAZPRBDcYFZnN1k2LX0wY/B4hwQ== 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 4SPLYN0sLXz48h; Mon, 6 Nov 2023 19:11:20 +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 3A6JBKfl008195; Mon, 6 Nov 2023 19:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A6JBKqJ008192; Mon, 6 Nov 2023 19:11:20 GMT (envelope-from git) Date: Mon, 6 Nov 2023 19:11:20 GMT Message-Id: <202311061911.3A6JBKqJ008192@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: 500196c5c705 - main - cam: Add nvme error devctl publishing 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: 500196c5c705f48e847ad8d568c7167fbef738b0 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=500196c5c705f48e847ad8d568c7167fbef738b0 commit 500196c5c705f48e847ad8d568c7167fbef738b0 Author: Warner Losh AuthorDate: 2023-11-06 19:09:31 +0000 Commit: Warner Losh CommitDate: 2023-11-06 19:10:42 +0000 cam: Add nvme error devctl publishing Start reporting nvme errors from devices, like we report ata and scsi errors. Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D41086 --- sys/cam/cam_periph.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index ebdda9ef449f..101abda5db25 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -2172,19 +2172,49 @@ cam_periph_devctl_notify(union ccb *ccb) sbuf_printf(&sb, "\" "); type = "error"; break; + case CAM_NVME_STATUS_ERROR: + { + struct ccb_nvmeio *n = &ccb->nvmeio; + + sbuf_printf(&sb, "sc=\"%02x\" sct=\"%02x\" cdw0=\"%08x\" ", + NVME_STATUS_GET_SC(n->cpl.status), + NVME_STATUS_GET_SCT(n->cpl.status), n->cpl.cdw0); + type = "error"; + break; + } default: type = "error"; break; } - if (ccb->ccb_h.func_code == XPT_SCSI_IO) { + + switch (ccb->ccb_h.func_code) { + case XPT_SCSI_IO: sbuf_printf(&sb, "CDB=\""); scsi_cdb_sbuf(scsiio_cdb_ptr(&ccb->csio), &sb); sbuf_printf(&sb, "\" "); - } else if (ccb->ccb_h.func_code == XPT_ATA_IO) { + break; + case XPT_ATA_IO: sbuf_printf(&sb, "ACB=\""); ata_cmd_sbuf(&ccb->ataio.cmd, &sb); sbuf_printf(&sb, "\" "); + break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + { + struct ccb_nvmeio *n = &ccb->nvmeio; + struct nvme_command *cmd = &n->cmd; + + // XXX Likely should be nvme_cmd_sbuf + sbuf_printf(&sb, "opc=\"%02x\" fuse=\"%02x\" cid=\"%04x\" " + "nsid=\"%08x\" cdw10=\"%08x\" cdw11=\"%08x\" cdw12=\"%08x\" " + "cdw13=\"%08x\" cdw14=\"%08x\" cdw15=\"%08x\" ", + cmd->opc, cmd->fuse, cmd->cid, cmd->nsid, cmd->cdw10, + cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, cmd->cdw15); + break; + } + default: + break; } if (sbuf_finish(&sb) == 0)