From nobody Mon Aug 26 18:03:13 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 4Wsz7610y0z5TLm4; Mon, 26 Aug 2024 18:03:14 +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 4Wsz756M47z44HY; Mon, 26 Aug 2024 18:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695393; 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=Dw4gzY3PzFgovS0cQsGOx+4Q0IGMZqCjSE4C1Zr15tI=; b=MKLpvaCe2mOJUILS2Ia+++OcWy9ooAe6LYgI7ubU8bWcJDFfCxk+/pQhmwHnuwpKACCI8j lyy054CSaBMLrf4CgY3TN+e1dviTmPg+K8g1Y453das4fdMlI74wRX7cmgau2heyqykmfd v3ZmaKhXSNYinGB2dXxEYGjuUN7zkNwXuh43m3Pd0kjyKJYkd+E+BCE+6/AOGD3OTUsl5W oijcUeFTIf9ZGR4o0tX1xFJAAIeQF2A0kFzicT8vRZqY1xQ0oLrLoo6pYXaAxs8b/l89FJ ZoATBZ+4cz2i0X4wBN+Og5PnV0uBUBBe8kvodsEOkNSuVx2GrQLMdGVz+hOWLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695393; a=rsa-sha256; cv=none; b=i8dtmJ2P8J2rnjpTdk6xc+g91C5GLc2K3BwicXKCIp5PjRw3a8ua6lLrJQUegeqSLIEHBJ afNIUJbJi/DVsu70/cHJ/9lFQDuazX1gCyRb7AvwQckjki9YUllABjCdUseqL4wc2Ure2J T2pvS5D8aVLDy+SdirzK11n4bn5Kb48Vp3BVH+BnAjaZI3dgxlw6h8t699A+YEPkmhEh+e KSqWBuzNZHP0DVU5X2EMfuwkzo2tRpjYXLfQelRmdARRBNZ2CzqvB5WYrVFcd5gHWMfzT6 SRARMZcTXPpeeW3T2jLmFOnfemC6WYZdfdsvfFaht3+mOpIVGuqCYEDVnBp6aw== 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=1724695393; 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=Dw4gzY3PzFgovS0cQsGOx+4Q0IGMZqCjSE4C1Zr15tI=; b=bEEVix+0g1diXRrxWiG/1L0CesvH8Ya4ni19uVjm+gp3wFTX1Hl6/zltP9bOKra4FNZxCX owf6c37cOtMLYEHhaO4JrYdwWYYrtQiVetopwz8X/qZjV8Od6IXST0/P2rlNPD/FgO7riQ ICoDzFdofK2yHowDNdm9/GJ7/hYZh7/0fgQu1gD6H9dIRStr+vc+km3VN5xwI7XtfuqLcU EijJV4rhP2UhFhix9RuehHdtm3tOLzluLA2A7De8SUxLSWlFTd7W1WvGp7SmFcl25OW0cW OK2WpwTBvL07AZTKNrIymgM17iakS4ew3vIfd2pjg43gKKMy5E9WklbPsP+BKw== 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 4Wsz755xw1zGs9; Mon, 26 Aug 2024 18:03:13 +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 47QI3DUd042451; Mon, 26 Aug 2024 18:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3DDr042448; Mon, 26 Aug 2024 18:03:13 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:13 GMT Message-Id: <202408261803.47QI3DDr042448@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: 8ed711ddcd02 - stable/14 - bhyve: Use the NVMEV macro instead of expanded versions 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: 8ed711ddcd0277f4b0101e7bb641130ee8d1dfab Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed711ddcd0277f4b0101e7bb641130ee8d1dfab commit 8ed711ddcd0277f4b0101e7bb641130ee8d1dfab Author: John Baldwin AuthorDate: 2024-01-29 18:49:49 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:26:17 +0000 bhyve: Use the NVMEV macro instead of expanded versions Reviewed by: corvink, chuck (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43598 (cherry picked from commit 94962f5a72ae7a5190f38cbe54a0ad4426329a06) --- usr.sbin/bhyve/pci_nvme.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 2fd49a84c768..4084f9b007ba 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -369,15 +369,15 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Configuration utils */ #define NVME_CC_GET_EN(cc) \ - ((cc) >> NVME_CC_REG_EN_SHIFT & NVME_CC_REG_EN_MASK) + NVMEV(NVME_CC_REG_EN, cc) #define NVME_CC_GET_CSS(cc) \ - ((cc) >> NVME_CC_REG_CSS_SHIFT & NVME_CC_REG_CSS_MASK) + NVMEV(NVME_CC_REG_CSS, cc) #define NVME_CC_GET_SHN(cc) \ - ((cc) >> NVME_CC_REG_SHN_SHIFT & NVME_CC_REG_SHN_MASK) + NVMEV(NVME_CC_REG_SHN, cc) #define NVME_CC_GET_IOSQES(cc) \ - ((cc) >> NVME_CC_REG_IOSQES_SHIFT & NVME_CC_REG_IOSQES_MASK) + NVMEV(NVME_CC_REG_IOSQES, cc) #define NVME_CC_GET_IOCQES(cc) \ - ((cc) >> NVME_CC_REG_IOCQES_SHIFT & NVME_CC_REG_IOCQES_MASK) + NVMEV(NVME_CC_REG_IOCQES, cc) #define NVME_CC_WRITE_MASK \ ((NVME_CC_REG_EN_MASK << NVME_CC_REG_EN_SHIFT) | \ @@ -391,7 +391,7 @@ static void pci_nvme_io_done(struct blockif_req *, int); /* Controller Status utils */ #define NVME_CSTS_GET_RDY(sts) \ - ((sts) >> NVME_CSTS_REG_RDY_SHIFT & NVME_CSTS_REG_RDY_MASK) + NVMEV(NVME_CSTS_REG_RDY, sts) #define NVME_CSTS_RDY (1 << NVME_CSTS_REG_RDY_SHIFT) #define NVME_CSTS_CFS (1 << NVME_CSTS_REG_CFS_SHIFT) @@ -1085,8 +1085,7 @@ pci_nvme_init_controller(struct pci_nvme_softc *sc) DPRINTF("%s mapping Admin-SQ guest 0x%lx, host: %p", __func__, sc->regs.asq, sc->submit_queues[0].qbase); - acqs = ONE_BASED((sc->regs.aqa >> NVME_AQA_REG_ACQS_SHIFT) & - NVME_AQA_REG_ACQS_MASK); + acqs = ONE_BASED(NVMEV(NVME_AQA_REG_ACQS, sc->regs.aqa)); if (acqs < 2) { EPRINTLN("%s: illegal ACQS value %#x (aqa=%#x)", __func__, acqs - 1, sc->regs.aqa); @@ -2083,8 +2082,8 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, uint64_t value) break; case NVME_OPC_FORMAT_NVM: DPRINTF("%s command FORMAT_NVM", __func__); - if ((sc->ctrldata.oacs & - (1 << NVME_CTRLR_DATA_OACS_FORMAT_SHIFT)) == 0) { + if (NVMEV(NVME_CTRLR_DATA_OACS_FORMAT, + sc->ctrldata.oacs) == 0) { pci_nvme_status_genc(&compl.status, NVME_SC_INVALID_OPCODE); break; }