Project

General

Profile

Feature #11203

Support for NVMe drive firmware updates

Added by Paul Winder 5 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

The NVMe specification in section 5.7 and 5.8 details the NVM commands to update firmware in a drive.
This translates to three steps:
  1. Upload the firmware from the O/S to the drive (from the drive's POV this is referred to as down load).
  2. Commit the firmware to a drive slot.
  3. Activate the drive slot.

And these translate into three new options to nvmeadm:

nvmeadm -h load-firmware
usage:
  nvmeadm load-firmware
  nvmeadm [-dv] load-firmware <ctl> <image file> [<offset>]

  Load firmware <image file> to offset <offset>.
  The firmware needs to be committed to a slot using "nvmeadm commit-firmware" 
  command.

nvmeadm -h commit-firmware
usage:
  nvmeadm -h commit-firmware
  nvmeadm [-dv] commit-firmware <ctl> <slot>

  Commit previously downloaded firmware to slot <slot>.
  The firmware is only activated after a "nvmeadm activate-firmware" command.

nvmeadm -h activate-firmware
usage:
  nvmeadm -h activate-firmware
  nvmeadm [-dv] activate-firmware <ctl> <slot>

  Activate firmware in slot <slot>.
  The firmware will be in use after the next system reset


There is already a get-logpage option to view firmware slots:
nvmeadm get-logpage nvme0 firmware
nvme0: Firmware Slot Information
  Active Firmware Slot:                     4
  Firmware Revision for Slot 1:             KNGND110
  Firmware Revision for Slot 2:             KNGND110
  Firmware Revision for Slot 3:             KNGND110
  Firmware Revision for Slot 4:             KNGND112
  Firmware Revision for Slot 5:             KNGND110

For example:

# nvmeadm get-logpage nvme2 firmware
nvme2: Firmware Slot Information
  Active Firmware Slot:                     2
  Next Firmware Slot:                       2
  Firmware Revision for Slot 1:             KNGND110
  Firmware Revision for Slot 2:             KNGND113
  Firmware Revision for Slot 3:             KNGND110
  Firmware Revision for Slot 4:             KNGND112
  Firmware Revision for Slot 5:             KNGND110
  Firmware Revision for Slot 6:             <Unused>
  Firmware Revision for Slot 7:             <Unused>

# nvmeadm -v load-firmware nvme1 KNGND113.bin 
1740544 bytes downloaded

# nvmeadm -v commit-firmware nvme1 3 
firmware committed to slot 3

# nvmeadm -v activate-firmware nvme1 3 
Slot 3 activated: NVM subsystem reset required

# nvmeadm get-logpage nvme1 firmware
nvme1: Firmware Slot Information
  Active Firmware Slot:                     2
  Next Firmware Slot:                       3
  Firmware Revision for Slot 1:             KNGND110
  Firmware Revision for Slot 2:             KTGND76E
  Firmware Revision for Slot 3:             KNGND113
  Firmware Revision for Slot 4:             KNGND112
  Firmware Revision for Slot 5:             KNGND110
  Firmware Revision for Slot 6:             <Unused>
  Firmware Revision for Slot 7:             <Unused>

History

#2

Updated by Paul Winder 4 months ago

The illustration in the previous comment is a test run of a firmware update. The process has been used to update two models of WDC Dual ported NVMe drives: HUSMR7616BDP301 (1.5TB) and HUSMR7676BDP3Y1 (7TB). It is used to update WDC drive firmware during the manufacturing of its IntelliFlash product.

#3

Updated by Paul Winder 4 months ago

  • % Done changed from 50 to 100
#4

Updated by Electric Monk 3 months ago

  • Status changed from In Progress to Closed

git commit cf8408718275b7f097c42550143f5c9517e00cc0

commit  cf8408718275b7f097c42550143f5c9517e00cc0
Author: Paul Winder <Paul.Winder@wdc.com>
Date:   2019-07-10T01:53:03.000Z

    11203 Support for NVMe drive firmware updates
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF