nvm_vblk

NVM Virtual Block (nvm_vblk_*) -- Ver { major(0), minor(0), patch(1) }

Erase, write, and read virtual blocks

Usage:
 nvm_vblk        erase dev_path 0xADDR [-h] [-v]
 nvm_vblk        write dev_path 0xADDR [-h] [-v] [-i FILE]
 nvm_vblk         read dev_path 0xADDR [-h] [-v] [-o FILE]
 nvm_vblk          pad dev_path 0xADDR [-h] [-v]
 nvm_vblk    set_erase dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_vblk    set_write dev_path 0xADDR [0xADDR...] [-h] [-v] [-i FILE]
 nvm_vblk     set_read dev_path 0xADDR [0xADDR...] [-h] [-v] [-o FILE]
 nvm_vblk      set_pad dev_path 0xADDR [0xADDR...] [-h] [-v]
 nvm_vblk   line_erase dev_path ch_bgn ch_end lun_bgn lun_end blk [-h] [-v]
 nvm_vblk   line_write dev_path ch_bgn ch_end lun_bgn lun_end blk [-h] [-v] [-i FILE]
 nvm_vblk    line_read dev_path ch_bgn ch_end lun_bgn lun_end blk [-h] [-v] [-o FILE]
 nvm_vblk     line_pad dev_path ch_bgn ch_end lun_bgn lun_end blk [-h] [-v]

Options:
 -h       Print usage
 -v       Dump CLI state to stdout
 -i  FILE Path to input file
 -o  FILE Path to output file

See: http://lightnvm.io/liblightnvm/cli/ for usage examples

A virtual block consists, at a minimum, of the physical blocks at a given block address across all planes in a LUN. The minimum construction encapsulates managing address-construction across planes and setting plane hints. See section Plane Span.

Increased utilization of parallel units in a device is achieved by constructing a virtual block as either a Block Set or a Block Line.

The write operation by default uses a synthetically constructed payload, use the -i FILE option to provide a payload from file. Payloads can likewise be dumped to file system when read using the -o FILE option.

Tip

See section Environment Variables for a full list of environment variables modifying command behavior

See also

See nvm_addr on how to construct the 0xADDR parameter

Plane Span

Construct a virtual block providing the address of block 42 in LUN 5 on channel 2:

nvm_addr from_geo /dev/nvme0n1 2 5 0 42 0 0
0x020500000000002a: {ch: 02, lun: 05, pl: 0, blk: 0042, pg: 000, sec: 0}

Erase

nvm_vblk erase /dev/nvme0n1 0x020500000000002a
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 16777216
  nmbytes: 16
naddrs: 1
addrs:
  - 0x020500000000002a: {ch: 02, lun: 05, pl: 0, blk: 0042, pg: 000, sec: 0}
nvm_vblk_erase: {elapsed: 0.005541}

Write

nvm_vblk write /dev/nvme0n1 0x020500000000002a
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 16777216
  nmbytes: 16
naddrs: 1
addrs:
  - 0x020500000000002a: {ch: 02, lun: 05, pl: 0, blk: 0042, pg: 000, sec: 0}
nvm_buf_alloc: {elapsed: 0.000012}
nvm_buf_fill: {elapsed: 0.021147}
nvm_vblk_write: {elapsed: 0.923969}

Read

nvm_vblk read /dev/nvme0n1 0x020500000000002a
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 16777216
  nmbytes: 16
naddrs: 1
addrs:
  - 0x020500000000002a: {ch: 02, lun: 05, pl: 0, blk: 0042, pg: 000, sec: 0}
nvm_buf_alloc: {elapsed: 0.000012}
nvm_vblk_read: {elapsed: 0.126809}

Block Set

Construct a virtual block using an arbitrary set of physical block addresses. E.g. construct a virtual block spanning the physical blocks:

(0x0000000000000002){ ch(00), lun(00), pl(0), blk(0002), pg(000), sec(0) }
(0x0a0700000000014d){ ch(10), lun(07), pl(0), blk(0333), pg(000), sec(0) }
(0x0301000000000014){ ch(03), lun(01), pl(0), blk(0020), pg(000), sec(0) }
(0x0500000000000190){ ch(05), lun(00), pl(0), blk(0400), pg(000), sec(0) }

Erase

nvm_vblk set_erase /dev/nvme0n1 0x0000000000000002 0x0a0700000000014d 0x0301000000000014 0x0500000000000190
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 67108864
  nmbytes: 64
naddrs: 4
addrs:
  - 0x0000000000000002: {ch: 00, lun: 00, pl: 0, blk: 0002, pg: 000, sec: 0}
  - 0x0a0700000000014d: {ch: 10, lun: 07, pl: 0, blk: 0333, pg: 000, sec: 0}
  - 0x0301000000000014: {ch: 03, lun: 01, pl: 0, blk: 0020, pg: 000, sec: 0}
  - 0x0500000000000190: {ch: 05, lun: 00, pl: 0, blk: 0400, pg: 000, sec: 0}
nvm_vblk_erase: {elapsed: 0.023238}

Write

nvm_vblk set_write /dev/nvme0n1 0x0000000000000002 0x0a0700000000014d 0x0301000000000014 0x0500000000000190
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 67108864
  nmbytes: 64
naddrs: 4
addrs:
  - 0x0000000000000002: {ch: 00, lun: 00, pl: 0, blk: 0002, pg: 000, sec: 0}
  - 0x0a0700000000014d: {ch: 10, lun: 07, pl: 0, blk: 0333, pg: 000, sec: 0}
  - 0x0301000000000014: {ch: 03, lun: 01, pl: 0, blk: 0020, pg: 000, sec: 0}
  - 0x0500000000000190: {ch: 05, lun: 00, pl: 0, blk: 0400, pg: 000, sec: 0}
nvm_buf_alloc: {elapsed: 0.000013}
nvm_buf_fill: {elapsed: 0.058105}
nvm_vblk_write: {elapsed: 0.956329}

Read

nvm_vblk set_read /dev/nvme0n1 0x0000000000000002 0x0a0700000000014d 0x0301000000000014 0x0500000000000190
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 67108864
  nmbytes: 64
naddrs: 4
addrs:
  - 0x0000000000000002: {ch: 00, lun: 00, pl: 0, blk: 0002, pg: 000, sec: 0}
  - 0x0a0700000000014d: {ch: 10, lun: 07, pl: 0, blk: 0333, pg: 000, sec: 0}
  - 0x0301000000000014: {ch: 03, lun: 01, pl: 0, blk: 0020, pg: 000, sec: 0}
  - 0x0500000000000190: {ch: 05, lun: 00, pl: 0, blk: 0400, pg: 000, sec: 0}
nvm_buf_alloc: {elapsed: 0.000013}
nvm_vblk_read: {elapsed: 0.163377}

Block Line

Construct a virtual block using block 10 in the ranges channel[0,0] and LUN[0,3]. That is, Block ten in the first four LUNs of channel 0.

Erase

nvm_vblk line_erase /dev/nvme0n1 0 0 0 3 10
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 67108864
  nmbytes: 64
naddrs: 4
addrs:
  - 0x000000000000000a: {ch: 00, lun: 00, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000100000000000a: {ch: 00, lun: 01, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000200000000000a: {ch: 00, lun: 02, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000300000000000a: {ch: 00, lun: 03, pl: 0, blk: 0010, pg: 000, sec: 0}
nvm_vblk_erase: {elapsed: 0.024285}

Write

nvm_vblk line_write /dev/nvme0n1 0 0 0 3 10
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 67108864
  nmbytes: 64
naddrs: 4
addrs:
  - 0x000000000000000a: {ch: 00, lun: 00, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000100000000000a: {ch: 00, lun: 01, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000200000000000a: {ch: 00, lun: 02, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000300000000000a: {ch: 00, lun: 03, pl: 0, blk: 0010, pg: 000, sec: 0}
nvm_buf_alloc: {elapsed: 0.000014}
nvm_buf_fill: {elapsed: 0.063046}
nvm_vblk_write: {elapsed: 1.097443}

Read

nvm_vblk line_read /dev/nvme0n1 0 0 0 3 10
vblk:
  dev: {pmode: 'DUAL'}
  nbytes: 67108864
  nmbytes: 64
naddrs: 4
addrs:
  - 0x000000000000000a: {ch: 00, lun: 00, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000100000000000a: {ch: 00, lun: 01, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000200000000000a: {ch: 00, lun: 02, pl: 0, blk: 0010, pg: 000, sec: 0}
  - 0x000300000000000a: {ch: 00, lun: 03, pl: 0, blk: 0010, pg: 000, sec: 0}
nvm_buf_alloc: {elapsed: 0.000013}
nvm_vblk_read: {elapsed: 0.322616}