From nobody Tue Aug 27 01:06:28 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 4Wt8WT1tPlz5TjLD; Tue, 27 Aug 2024 01:06:29 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wt8WT0QPmz4lSb; Tue, 27 Aug 2024 01:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724720789; 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=HzsEaML/NTkpEDiR/taIqdnPctgtLDK0DMYmruSl1bk=; b=qo1Lf39tn379kR8UW6mKDwo0btUyegLjQy1J6uX3uDta3ogU9yXsxixYKEn45TxEdfeWDH AxJx+wnW4CeFY+RsqIJ1R7CjvyEIJWc4IhdodaR+V8AbEKedyxLnHVDxztfFp3T6tH3Ej5 RzwOWSQlCpBL7Npofo4vHUMhrmlMLQxEfrV4Zx8mja8dCjZIlw0MOOASHgwCmrzDFx4k8D +o9do9y0qfSMGnhs0I0QutZ3iAhu3Gul5Xc+tZItvEvXGE+sn9buckt2eu2lp/2guKRakM 7tO/Ei9GbYIoQuvYoaTJvsRFjmAa7fPRv+Mlqf6KVa2sARs/gnXJNfTsGVjv0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724720789; a=rsa-sha256; cv=none; b=BytW5zgRy4fabCOsQriMYpP4sHaEILn+F8Lnzjr6E+K/5iwailLkDuqJt2AUSaN+GXeVXQ BoIL0TuwWH20DNQTs05zdpXnW7gPq+pm4tSFREfY9Ltju/ywT3/suvV+RA9mz+mClDbhmX hzixB9leD++lwE+NqGL1i/CSAABkLl5YQ+/jTMc8IJUgKBTPNHCH5OSqZzeDq+ZwgO3X+x 8HzvKU4kscSl1qV1iEp7cfzMnWJZ1KxfphH2E54Zsi6jzUwdw+/3m45tjsrF2yJbh6heHS P2WWHfEdH9IwW9x5bzOOzyoKVxi5Rihes1O2cBHg2Xh2Dl6w0A19LYPQ35ucOg== 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=1724720789; 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=HzsEaML/NTkpEDiR/taIqdnPctgtLDK0DMYmruSl1bk=; b=P8sUyofEMwixKMwUtQxcnQF52A98voT9CAA9b+/WTA+c4RuF13MPYJxyAIXeMjZJxfmZ0m wfI3nNdhIml4NZ3yAQfN1ClMzPXPNQxvIILKyHvOn2gqBOiUFfGk8cfPBDffzbwj55VRK2 MgnoGU5Jx2TUtvygLNML+DkAFjuJD3bBNXj7zG8oMchzLTpMLRB1HMgyFdmoZVS4rh1GTQ 0sIcDxhRwkg8TxaYt1B2HWxJ8UV7J2y5/PHklnl/L3NCpQsWF4X3mLNk6Ae5V8kTekkDc0 98cw0Cu4ncjLSBp/spMIXN1m9mAvKss4jxwyiNdxQFfCJxSqOd8xUY1uxgV3QA== 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 4Wt8WS6byKzTff; Tue, 27 Aug 2024 01:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47R16SBm056609; Tue, 27 Aug 2024 01:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47R16SnF056606; Tue, 27 Aug 2024 01:06:28 GMT (envelope-from git) Date: Tue, 27 Aug 2024 01:06:28 GMT Message-Id: <202408270106.47R16SnF056606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 41f61bf23024 - stable/14 - 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/14 X-Git-Reftype: branch X-Git-Commit: 41f61bf230243361b8375ce19d45eb01f139014d Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=41f61bf230243361b8375ce19d45eb01f139014d commit 41f61bf230243361b8375ce19d45eb01f139014d Author: John Baldwin AuthorDate: 2024-03-23 00:24:06 +0000 Commit: John Baldwin CommitDate: 2024-08-26 18:27:48 +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 (cherry picked from commit b354bb04cb51f373e997cb8911c32dc93243c1d7) --- 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 70d293cf278e..b738ab902f89 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -642,6 +642,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 0004895d6691..52e412c5202a 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -794,10 +794,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)) {