From nobody Mon Aug 26 18:03:22 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 4Wsz7H4cdHz5TM83; Mon, 26 Aug 2024 18:03:23 +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 4Wsz7H0RHGz457l; Mon, 26 Aug 2024 18:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724695403; 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=Z0F1mUzaXpcP0vXTJL1ubz5W0VbG+Bh00J8cFyl8mdw=; b=gaoU+A7RD9mAjEDgMEiMwxyjdxmuzesZCWMdenOlNB+pso5ITwJWbu7gPiKN+808H2HkIW zbEJ5RusZDk/pfqNjLgMAF722yx/gvxDqR4+jIXgCcPofrFjBWYBbNQ32vZR7uJBMC/X9H BDadZKCL6QOy//ZdJD6Ar2OTQu3G3947q3nr9KXpqJ/mv/PQ0r1MUZQIuQ7eUe4htgDWez nf1gawImT3hexAAM4H83XPk3VjzSe3snEL61UypFhHn0cdx0ohdDGextpp1kMeMQbU9Jqn mT0N/m4vcuV1tAUZt9NRfiCngRIjAePG0kATt0NREcv0aqyn2mvAcbUoYis65g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724695403; a=rsa-sha256; cv=none; b=oxQgWt9R2Ipb1S7HIOTdwC8g3I8fQ2AypCpi3yWEMvolhmz3yqDmnKyMDNlfV+L2lyyUO+ o2FKniepRweJm5s9hMGqszJksjnkdJ46tpcKi/MoyTdoG5CZ1O0cSv+mdOxLqlE+HvfzjU mQ2pW33XwyveV/GVPRra3Q/cmfhAVOBYjLAnRr0Qg003ei5RvjFXUFF7UMop2mDld4v5t2 KIo2YUpdPxzuv3A4GDBTmClKO8RxzraOydZRr+6t38Hn09JMabNqBX14v8Ik0aEV8m8Sz8 0r+EWk/AxxVzFep6x82yRlW/gl6qcaHoeveHv2AbFKVk7kCTkIwQmTEMKQyafQ== 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=1724695403; 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=Z0F1mUzaXpcP0vXTJL1ubz5W0VbG+Bh00J8cFyl8mdw=; b=IBPXjkS3UjmjL1QEletGUwZf8PpRQwi2tQClcWgWJiN+Z3uIosrJ2Y4AVVO+XZml58NkFp Y1a0A/4XCYSnjFfbYqdy+XGgrZbaX31aPfyW79RVUTYXsnwcF9yNjOEDHIzVP3MeJi3Bbe LgpbHJ5FdbTr1TOoVU0S+j2Zk/6dfOID09odKdkiGmRiGzgCeq60B7/J0xY0Hl8tPuSJXu t2mRvKPuDZv5wexV/AD2gC5g9F3vEqmslO+Jxp3f1cU8coG99M/383lEhnD8rHisQcWULy L37nPXmr7Te8aP/uFRDtgPvdLMw+GNR/4wH2HeqdPX29v2C5jtnMlAFeAcfkBQ== 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 4Wsz7G6TWBzH6L; Mon, 26 Aug 2024 18:03:22 +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 47QI3Mcm042894; Mon, 26 Aug 2024 18:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QI3MBT042891; Mon, 26 Aug 2024 18:03:22 GMT (envelope-from git) Date: Mon, 26 Aug 2024 18:03:22 GMT Message-Id: <202408261803.47QI3MBT042891@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: 5438d2060676 - stable/14 - nvmecontrol: Use NVMEF macro to construct fields 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: 5438d20606769c8db690f1a2d92becb7a6b05426 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5438d20606769c8db690f1a2d92becb7a6b05426 commit 5438d20606769c8db690f1a2d92becb7a6b05426 Author: John Baldwin AuthorDate: 2024-01-29 19:01:46 +0000 Commit: John Baldwin CommitDate: 2024-08-26 17:27:14 +0000 nvmecontrol: Use NVMEF macro to construct fields Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43606 (cherry picked from commit c68ec278deb23fd90eb5506c9a6a4f7339784ff3) --- sbin/nvmecontrol/ns.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index a77f37e0f468..24f4b6b3d043 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -580,14 +580,12 @@ nscreate(const struct cmd *f, int argc, char *argv[]) /* Default to the first format, whatever it is. */ nsdata.flbas = 0; if (create_opt.lbaf != NONE) { - nsdata.flbas |= (create_opt.lbaf & - NVME_NS_DATA_FLBAS_FORMAT_MASK) - << NVME_NS_DATA_FLBAS_FORMAT_SHIFT; + nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_FORMAT, + create_opt.lbaf); } if (create_opt.mset != NONE) { - nsdata.flbas |= (create_opt.mset & - NVME_NS_DATA_FLBAS_EXTENDED_MASK) - << NVME_NS_DATA_FLBAS_EXTENDED_SHIFT; + nsdata.flbas |= NVMEF(NVME_NS_DATA_FLBAS_EXTENDED, + create_opt.mset); } } if (create_opt.dps != NONE) { @@ -596,22 +594,19 @@ nscreate(const struct cmd *f, int argc, char *argv[]) /* Default to protection disabled. */ nsdata.dps = 0; if (create_opt.pi != NONE) { - nsdata.dps |= (create_opt.pi & - NVME_NS_DATA_DPS_MD_START_MASK) - << NVME_NS_DATA_DPS_MD_START_SHIFT; + nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_MD_START, + create_opt.pi); } if (create_opt.pil != NONE) { - nsdata.dps |= (create_opt.pil & - NVME_NS_DATA_DPS_PIT_MASK) - << NVME_NS_DATA_DPS_PIT_SHIFT; + nsdata.dps |= NVMEF(NVME_NS_DATA_DPS_PIT, + create_opt.pil); } } if (create_opt.nmic != NONE) { nsdata.nmic = create_opt.nmic; } else { /* Allow namespaces sharing if Multi-Path I/O is supported. */ - nsdata.nmic = cd.mic ? (NVME_NS_DATA_NMIC_MAY_BE_SHARED_MASK << - NVME_NS_DATA_NMIC_MAY_BE_SHARED_SHIFT) : 0; + nsdata.nmic = NVMEF(NVME_NS_DATA_NMIC_MAY_BE_SHARED, !!cd.mic); } nvme_namespace_data_swapbytes(&nsdata);