From 514d6e4ad0dcae10a50ce49dffad435e2260d5a7 Mon Sep 17 00:00:00 2001 From: Minwoo Im Date: Sun, 25 Aug 2019 22:28:50 +0900 Subject: [PATCH] id-ctrl: show Flush command behavior in VWC Volatile Write Cache(VWC) is now indicating the Flush command behavior in VWC point-of-view. If 2h, Flush command does not support for the NSID set to FFFFFFFFh. But in case of 3h, it will support. Signed-off-by: Minwoo Im --- nvme-print.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nvme-print.c b/nvme-print.c index 40245f7b..16acda86 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -515,10 +515,20 @@ static void show_nvme_id_ctrl_fna(__u8 fna) static void show_nvme_id_ctrl_vwc(__u8 vwc) { - __u8 rsvd = (vwc & 0xFE) >> 1; + __u8 rsvd = (vwc & 0xF8) >> 3; + __u8 flush = (vwc & 0x6) >> 1; __u8 vwcp = vwc & 0x1; + + static const char *flush_behavior[] = { + "Support for the NSID field set to FFFFFFFFh is not indicated", + "Reserved", + "The Flush command does not support NSID set to FFFFFFFFh", + "The Flush command supports NSID set to FFFFFFFFh" + }; + if (rsvd) printf(" [7:3] : %#x\tReserved\n", rsvd); + printf(" [2:1] : %#x\t%s\n", flush, flush_behavior[flush]); printf(" [0:0] : %#x\tVolatile Write Cache %sPresent\n", vwcp, vwcp ? "" : "Not "); printf("\n"); -- 2.50.1