From owner-svn-src-stable@freebsd.org Mon May 13 13:28:43 2019 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F57815900FE; Mon, 13 May 2019 13:28:43 +0000 (UTC) (envelope-from mav@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D94A818BD; Mon, 13 May 2019 13:28:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E54A5A681; Mon, 13 May 2019 13:28:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4DDSg3l082095; Mon, 13 May 2019 13:28:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DDSgP0082093; Mon, 13 May 2019 13:28:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905131328.x4DDSgP0082093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 13 May 2019 13:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347523 - in stable/12: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sbin/nvmecontrol sys/dev/nvme X-SVN-Commit-Revision: 347523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D94A818BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 May 2019 13:28:43 -0000 Author: mav Date: Mon May 13 13:28:42 2019 New Revision: 347523 URL: https://svnweb.freebsd.org/changeset/base/347523 Log: MFC r347158: Decode Deallocate Logical Block Features. Modified: stable/12/sbin/nvmecontrol/identify.c stable/12/sys/dev/nvme/nvme.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/nvmecontrol/identify.c ============================================================================== --- stable/12/sbin/nvmecontrol/identify.c Mon May 13 12:38:33 2019 (r347522) +++ stable/12/sbin/nvmecontrol/identify.c Mon May 13 13:28:42 2019 (r347523) @@ -49,7 +49,7 @@ print_namespace(struct nvme_namespace_data *nsdata) uint32_t i; uint32_t lbaf, lbads, ms, rp; uint8_t thin_prov, ptype; - uint8_t flbas_fmt; + uint8_t flbas_fmt, t; thin_prov = (nsdata->nsfeat >> NVME_NS_DATA_NSFEAT_THIN_PROV_SHIFT) & NVME_NS_DATA_NSFEAT_THIN_PROV_MASK; @@ -122,6 +122,16 @@ print_namespace(struct nvme_namespace_data *nsdata) NVME_NS_DATA_FPI_PERC_MASK); } else printf("Not Supported\n"); + t = (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_READ_SHIFT) & + NVME_NS_DATA_DLFEAT_READ_MASK; + printf("Deallocate Logical Block: Read %s%s%s\n", + (t == NVME_NS_DATA_DLFEAT_READ_NR) ? "Not Reported" : + (t == NVME_NS_DATA_DLFEAT_READ_00) ? "00h" : + (t == NVME_NS_DATA_DLFEAT_READ_FF) ? "FFh" : "Unknown", + (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_DWZ_SHIFT) & + NVME_NS_DATA_DLFEAT_DWZ_MASK ? ", Write Zero" : "", + (nsdata->dlfeat >> NVME_NS_DATA_DLFEAT_GCRC_SHIFT) & + NVME_NS_DATA_DLFEAT_GCRC_MASK ? ", Guard CRC" : ""); printf("Optimal I/O Boundary (LBAs): %u\n", nsdata->noiob); printf("Globally Unique Identifier: "); for (i = 0; i < sizeof(nsdata->nguid); i++) Modified: stable/12/sys/dev/nvme/nvme.h ============================================================================== --- stable/12/sys/dev/nvme/nvme.h Mon May 13 12:38:33 2019 (r347522) +++ stable/12/sys/dev/nvme/nvme.h Mon May 13 13:28:42 2019 (r347523) @@ -349,6 +349,20 @@ #define NVME_NS_DATA_FPI_SUPP_SHIFT (7) #define NVME_NS_DATA_FPI_SUPP_MASK (0x1) +/** Deallocate Logical Block Features */ +/* deallocated logical block read behavior */ +#define NVME_NS_DATA_DLFEAT_READ_SHIFT (0) +#define NVME_NS_DATA_DLFEAT_READ_MASK (0x07) +#define NVME_NS_DATA_DLFEAT_READ_NR (0x00) +#define NVME_NS_DATA_DLFEAT_READ_00 (0x01) +#define NVME_NS_DATA_DLFEAT_READ_FF (0x02) +/* supports the Deallocate bit in the Write Zeroes */ +#define NVME_NS_DATA_DLFEAT_DWZ_SHIFT (3) +#define NVME_NS_DATA_DLFEAT_DWZ_MASK (0x01) +/* Guard field for deallocated logical blocks is set to the CRC */ +#define NVME_NS_DATA_DLFEAT_GCRC_SHIFT (4) +#define NVME_NS_DATA_DLFEAT_GCRC_MASK (0x01) + /** lba format support */ /* metadata size */ #define NVME_NS_DATA_LBAF_MS_SHIFT (0)