From nobody Sat Mar 23 00:25:36 2024 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 4V1g2n2mWbz5Fl6P; Sat, 23 Mar 2024 00:25:37 +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 4V1g2n0jtDz4Yqy; Sat, 23 Mar 2024 00:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711153537; 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=5kAe0tOrJwjiwP5fQI/whrLjxXEQYt7Kq6BXrFQDmiE=; b=VEtrEDuK3lAx3f8UP/RdczdtDxPStet1F/SuXgo22UMHZK/9jscl7H1O3jnDE/9SaVyGI5 76h3HjapP/ouVUdhQhQAzkfcYjOop5O9W+elcOc9e4FedQCmKcYX2S2z3ddTTxdjABTYvP 9NjQ8ieTTey+sJEs6S/n60b72IQ8e8kBrrHquy8+YyZG3biYO+HDclGqe0FS76f/p/Q0d4 ezAicLMGurG9A5z31TZpqFK9Gj+radASF58jenAF8N4VKTJ+0hUM0w0Bjuy7AaODnYjGnn mfGLE11GryzsSHGBACGsknPQyjRdq5xgtuOxXfq+E6uxySXeFxY9uZkPhG0b8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711153537; a=rsa-sha256; cv=none; b=hHrNjuzzTMziP1GDGT/Y75aACh8z7wubpsERsM8kkRpd9LJycZn0nvh0JFaLMlheIjUP5I hwyI/XkLZnQV1syLsiDCktUdAGv77ZB2tQ/kKaxB/hBT0mFkdEpKDioecMSkQIqa09JMhv WheLng3bxIWSKwZIC9RMld3+Mb3QCqdHWzVdQqkRGSY/imytvX2LDijlEdUsVAhyeEUJfQ 1HxuUDkNdKToaNMxV6me0IdIPcasl/9C0NskkiiM4ts9C7tfaCKFf6yBwDCweZ3gJLVv8s kbnOwAuaODI0GJbykQxRtFz/o71dqy8uCUDf/PCyu/ICdkxcqS4sBogx633kyg== 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=1711153537; 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=5kAe0tOrJwjiwP5fQI/whrLjxXEQYt7Kq6BXrFQDmiE=; b=QHZKJ7sfW4ontBpvwxPpwSk0f0Xlha0jDreC/QDAvwVc4DspnA16s4oTMzbRKXtZQcksYA 3jla075E3TTFKZpnlGgt2EU2IX29p0XM62bOttP+beWEcy6GwKsd+k+RApd9ufqDIiSQmj kbM79dlF/K1Ua6hq//8uFfkuEtA/qrSOA4rBLT3GyfoJpv7l782im5b+rDFqE61cwgTpZn xAOuLJzjX8uoQ4+8kqvE4eEhKO8N3hEl1VbpeumqgrjVEAZenTiXZvaxz+2/b+BzsvhGso Fb9gVE6fyU31DMX4315Ef5DLOsso0vuvPduf5qaR/YAD86Fs5kwn8RB1Tm6Oig== 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 4V1g2n01MHzQRm; Sat, 23 Mar 2024 00:25:37 +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 42N0PaNa005879; Sat, 23 Mar 2024 00:25:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42N0PaxO005876; Sat, 23 Mar 2024 00:25:36 GMT (envelope-from git) Date: Sat, 23 Mar 2024 00:25:36 GMT Message-Id: <202403230025.42N0PaxO005876@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b354bb04cb51 - main - nvme: Add constants for fields in AER completion dword 0 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b354bb04cb51f373e997cb8911c32dc93243c1d7 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b354bb04cb51f373e997cb8911c32dc93243c1d7 commit b354bb04cb51f373e997cb8911c32dc93243c1d7 Author: John Baldwin AuthorDate: 2024-03-23 00:24:06 +0000 Commit: John Baldwin CommitDate: 2024-03-23 00:24:06 +0000 nvme: Add constants for fields in AER completion dword 0 Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44445 --- sys/dev/nvme/nvme.h | 8 ++++++++ sys/dev/nvme/nvme_ctrlr.c | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 7059421f9fd7..ef262a864121 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -643,6 +643,14 @@ enum nvme_critical_warning_state { #define NVME_FEAT_SET_FID_SHIFT (0) #define NVME_FEAT_SET_FID_MASK (0xff) +/* Async Events */ +#define NVME_ASYNC_EVENT_TYPE_SHIFT (0) +#define NVME_ASYNC_EVENT_TYPE_MASK (0x7) +#define NVME_ASYNC_EVENT_INFO_SHIFT (8) +#define NVME_ASYNC_EVENT_INFO_MASK (0xff) +#define NVME_ASYNC_EVENT_LOG_PAGE_ID_SHIFT (16) +#define NVME_ASYNC_EVENT_LOG_PAGE_ID_MASK (0xff) + /* Helper macro to combine *_MASK and *_SHIFT defines */ #define NVMEM(name) (name##_MASK << name##_SHIFT) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 7334c7169efb..e41f32635346 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -783,10 +783,11 @@ nvme_ctrlr_async_event_cb(void *arg, const struct nvme_completion *cpl) } /* Associated log page is in bits 23:16 of completion entry dw0. */ - aer->log_page_id = (cpl->cdw0 & 0xFF0000) >> 16; + aer->log_page_id = NVMEV(NVME_ASYNC_EVENT_LOG_PAGE_ID, cpl->cdw0); nvme_printf(aer->ctrlr, "async event occurred (type 0x%x, info 0x%02x," - " page 0x%02x)\n", (cpl->cdw0 & 0x07), (cpl->cdw0 & 0xFF00) >> 8, + " page 0x%02x)\n", NVMEV(NVME_ASYNC_EVENT_TYPE, cpl->cdw0), + NVMEV(NVME_ASYNC_EVENT_INFO, cpl->cdw0), aer->log_page_id); if (is_log_page_id_valid(aer->log_page_id)) {