From nobody Tue Nov 15 07:26:09 2022 X-Original-To: dev-commits-src-main@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 4NBHm12M1Wz4hBbg; Tue, 15 Nov 2022 07:26:09 +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 4NBHm11tVdz3hGQ; Tue, 15 Nov 2022 07:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668497169; 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=EcreVICUppBuNZTq3dUN3K1tS51ENMR3JQJjikZ+fB0=; b=Vuoanv2E+IFU3k7FoFPLn2i97ye4v8z1R7Gqo/+3TuljwDFz+VGe//L0M07/jNrWyy0Ujk ufJhZJFbje/CqMoNf6CajRI9dnL6egiy0+PYz6PHLJNNAYBZTd9Q5+6W/OXwTyhA8Zox66 0t2uDyoX/JOTeeudSNGW+b4YgpLwe6UaAYigJ3idqG3I+FnMDkev+wir8CcKT+24JgMKNS 9Myt6cAGitjCB68KJc/+D5vgMc8rKpXQ6xXpjERxIlBI12fz9KTnED2nJ3KzSKzoVYCmBx dBAjan3Fn7hTMnhfnrdb80cotvIt305Eg5QE9zy0Zp/XX9TF6KFbLOls6CEmkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668497169; 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=EcreVICUppBuNZTq3dUN3K1tS51ENMR3JQJjikZ+fB0=; b=Oz7lT94oSlnn80xkFdP39RslR6+RSPEOWJU1dMk58LWvJUHW+7Ic9hP1yKV1DnVkA6giwV Y5kijBotJ0GmvRiwKL8SHTF4RLJtUJWHh+VeDTvuKuNwa6ZTrRFsPARzGWWd8cxhSyFNws sc7A+xoqhl1gCbeK+WcWBoji1KyN4VTsAMKnbihMgR0SAkrqOW1wQTdy8GwCt5Lzru5nI2 90drLgKL1sRIGx6QfgT+y+oAYXFbFgzki2YqiIdD6afzL462FOlt6RI727WtGia6Vp2RkP 3Pjce8Cjq02IXaUmBjcPcl2FdN4DE8RxvLbh3Xbn7yPQkU1SmQK7YFS7PjrpJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668497169; a=rsa-sha256; cv=none; b=XqMBYAH0rbbAXvNZCLQWcMuP2koB9wCDxrl9mgMQfBYnWPX3oUTxckboW2GebhDRK2tXiV qa06tTCTl/lWpPv1YObx/IgsV8HJyPkVIEi+Q7qsW9vyLxOb1lzbLXReYdfxN3lbBned2Z L3flYpYxaC0rM18wpxdMEggWeXdu742iWi1f+k8xalhW0T0zVuhnnIqG872vPsz1eIjx8x EMZeeavwXsHH1YhsL+o8ZxBED/oqfmH6H7OwFjxCKAK+05heqUWRtuffrhv7U5Kpmvlyjp hc48fe/bGU+vHbvPRWbrf26ULs945x+k7BoPIo98T2j3B/baaqElpV4MSvImAw== 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 4NBHm10zrnz1CwK; Tue, 15 Nov 2022 07:26:09 +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 2AF7Q9p8046149; Tue, 15 Nov 2022 07:26:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AF7Q9NC046148; Tue, 15 Nov 2022 07:26:09 GMT (envelope-from git) Date: Tue, 15 Nov 2022 07:26:09 GMT Message-Id: <202211150726.2AF7Q9NC046148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 10846c53c456 - main - bhyve: nvme controller obey async event setting when reporting critical temperature List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10846c53c4569bdf6d6e2b88739a56a8273bce7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=10846c53c4569bdf6d6e2b88739a56a8273bce7f commit 10846c53c4569bdf6d6e2b88739a56a8273bce7f Author: Wanpeng Qian AuthorDate: 2022-11-14 13:08:52 +0000 Commit: Corvin Köhne CommitDate: 2022-11-15 06:48:26 +0000 bhyve: nvme controller obey async event setting when reporting critical temperature Async event report is controlled by async event configuration feature setting. When reporting a critical temperature warning, check the async event configuration. Approved by: manu (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37355 --- usr.sbin/bhyve/pci_nvme.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index c9fde4ac7876..6572781e939c 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1758,6 +1758,7 @@ nvme_feature_temperature(struct pci_nvme_softc *sc, uint8_t tmpsel; /* Threshold Temperature Select */ uint8_t thsel; /* Threshold Type Select */ bool set_crit = false; + bool report_crit; tmpth = command->cdw11 & 0xffff; tmpsel = (command->cdw11 >> 16) & 0xf; @@ -1785,11 +1786,13 @@ nvme_feature_temperature(struct pci_nvme_softc *sc, ~NVME_CRIT_WARN_ST_TEMPERATURE; pthread_mutex_unlock(&sc->mtx); - if (set_crit) + report_crit = sc->feat[NVME_FEAT_ASYNC_EVENT_CONFIGURATION].cdw11 & + NVME_CRIT_WARN_ST_TEMPERATURE; + + if (set_crit && report_crit) pci_nvme_aen_post(sc, PCI_NVME_AE_TYPE_SMART, sc->health_log.critical_warning); - DPRINTF("%s: set_crit=%c critical_warning=%#x status=%#x", __func__, set_crit ? 'T':'F', sc->health_log.critical_warning, compl->status); }