From nobody Mon Jan 29 19:03:03 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 4TNyP35jtjz59DH4; Mon, 29 Jan 2024 19:03:03 +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 4TNyP33Tjgz40KL; Mon, 29 Jan 2024 19:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706554983; 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=hOH2HxQDnG3Uz7HjVbCGCQ7TXNo4k2Phn51m+v3cBzo=; b=SE79PPafNc3sjgvO1Kb87nwZWOVY4vbhIJhgp8uhmlpPu03rkYFrlFbOkrYjdBAvslbSEn 34jxdofhEbwug2wjglG6BajI1xeSgFqUpq5tbkn0NtSMMWplLPL8t2HtComOBGXCtOeq7x Z2/l4pXnibeutRXB/ozIom9C7kyY2jXiLfgIWxWIL86Nev89VFg2UAspvSqwTPR4TrscmP 9iVz+9mZN6fxJCVogQ7rUc5bIBZZdeQx+pEi3PfpvYNieHSPTqX36+DypGvpcVtx7sn7wT jGyEGLEmd7eGtj9jQrZQWK8BlaSOSF0pLJ7065Jkhyis+RZph5pMA9uUPDcl3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706554983; 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=hOH2HxQDnG3Uz7HjVbCGCQ7TXNo4k2Phn51m+v3cBzo=; b=ZDdLVWhmz7isaS3apcJfPix1ahg14pkOak6rgpdiHUeJi6K7z6mtwT34RxpQofvp/CsZ+w aFOF5jJ2XwAAJp/6IustgJ9m8ASJa555bsek1U+NaYcl8kqgYN5axnssak2XkD+q+dsE42 h5NHRoiistl49Phpn+bcue6QDcYui+Sx+ln1VMnTmIcFvWiBAUhnIJNh4QHWr4F51ikYm8 FmCoyO4+EgQDhjbZ04uhxZG0qOFLh0Y24Wzx/WNY5aJGvwk0wtscGURN21MI/KYhDntZtt sPaBYcruDVkraAr7A8VxUgZrN9H8tNp6hNmmp6Q3K2FF/UAX+WfpoF+LDOGWcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706554983; a=rsa-sha256; cv=none; b=kzt95zF0fcUkDFaX2xzgVm2iW1zrnNfP0H+Wa2W79WUVaxrnwmS08AwT7H/4fflNaW/fWp FEflauM2gj1nHcrm6oC/59AqVp4sK2RUYlSh4nRIi8BiqjhCnsKY+MtXFVp1H55pkJK2Gi xGbrpgUt97Qy+XY/FIYitFPUDuKIPX/mgTv9xn7FTcZWt7PvbEn9lZAx8nsQn4C2ZzrcBU SROWI6iC2udxUMve2ytx7lzKI6ScyVWkxDWff5xQRxwcEN+tw7NwaoyeYGscOjJs5yJCEt 2D4T+utT6DNrhHjiVGvIZTEv40GtDtqOHWXTIhKy7KE2ucXsiNGXwF7rjzB91Q== 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 4TNyP32JjCz13Dv; Mon, 29 Jan 2024 19:03:03 +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 40TJ334T058464; Mon, 29 Jan 2024 19:03:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TJ33Cp058461; Mon, 29 Jan 2024 19:03:03 GMT (envelope-from git) Date: Mon, 29 Jan 2024 19:03:03 GMT Message-Id: <202401291903.40TJ33Cp058461@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: 94962f5a72ae - main - 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: 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: 94962f5a72ae7a5190f38cbe54a0ad4426329a06 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=94962f5a72ae7a5190f38cbe54a0ad4426329a06 commit 94962f5a72ae7a5190f38cbe54a0ad4426329a06 Author: John Baldwin AuthorDate: 2024-01-29 18:49:49 +0000 Commit: John Baldwin CommitDate: 2024-01-29 18:49:49 +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 --- 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; }