From: Gollu Appalanaidu Date: Sat, 3 Jul 2021 18:52:36 +0000 (+0530) Subject: nvme: add multiple update detected result value in fw commit X-Git-Tag: v2.0-rc0~53^2~43 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6e47d6243450604e673b12765a83ac0fa8d4298f;p=users%2Fsagi%2Fnvme-cli.git nvme: add multiple update detected result value in fw commit Add Multiple Update Detected (MUD) field in FW Commit command CQE CDW0 as per NVMe 2.0 Spec. Signed-off-by: Gollu Appalanaidu [dwagner: removed nvme-ioctl changes; part of libnvme] Signed-off-by: Daniel Wagner --- diff --git a/nvme.c b/nvme.c index 787850ed..f85d92ce 100644 --- a/nvme.c +++ b/nvme.c @@ -3059,6 +3059,7 @@ static int fw_commit(int argc, char **argv, struct command *cmd, struct plugin * const char *action = "[0-7]: commit action"; const char *bpid = "[0,1]: boot partition identifier, if applicable (default: 0)"; int err, fd; + __u32 result; struct config { __u8 slot; @@ -3099,7 +3100,7 @@ static int fw_commit(int argc, char **argv, struct command *cmd, struct plugin * goto close_fd; } - err = nvme_fw_commit(fd, cfg.slot, cfg.action, cfg.bpid); + err = nvme_fw_commit(fd, cfg.slot, cfg.action, cfg.bpid, &result); if (err < 0) perror("fw-commit"); else if (err != 0) @@ -3125,6 +3126,16 @@ static int fw_commit(int argc, char **argv, struct command *cmd, struct plugin * printf("\n"); } + if (err >= 0) { + printf("Multiple Update Detected (MUD) Value: %u\n", result); + if (result & 0x1) + printf("Detected an overlapping firmware/boot partition image update command "\ + "sequence due to processing a command from a Management Endpoint"); + if ((result >> 1) & 0x1) + printf("Detected an overlapping firmware/boot partition image update command "\ + "sequence due to processing a command from an Admin SQ on a controller"); + } + close_fd: close(fd); ret: