Project

General

Profile

Actions

Bug #7279

closed

nvme.c: idns->id_nlbaf is a 0's based value.

Added by Youzhong Yang almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
2016-08-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

http://www.nvmexpress.org/wp-content/uploads/NVM-Express-1_1b.pdf (page 96) says Number of LBA Formats (NLBAF) is a 0’s based value, so the for loop should start from 0 and end with nlbaf.

It's not a big deal, but should be fixed.

http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/nvme/nvme.c#2044

for (int j = 0; j != idns->id_nlbaf; j++) {
            if (idns->id_lbaf[j].lbaf_lbads == 0)
                break;
            if (idns->id_lbaf[j].lbaf_ms != 0)
                continue;
            if (idns->id_lbaf[j].lbaf_rp >= last_rp)
                continue;
            last_rp = idns->id_lbaf[j].lbaf_rp;
            nvme->n_ns[i].ns_best_block_size =
                1 << idns->id_lbaf[j].lbaf_lbads;
        }

> ffffd127f12659c0::print -t nvme_t n_ns | ::print -t nvme_namespace_t ns_idns | ::print nvme_identify_nsid_t id_nlbaf id_lbaf
id_nlbaf = 0x6
id_lbaf = [
    {
        lbaf_ms = 0
        lbaf_lbads = 0x9
        lbaf_rp = 0x2
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0x8
        lbaf_lbads = 0x9
        lbaf_rp = 0x2
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0x10
        lbaf_lbads = 0x9
        lbaf_rp = 0x2
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0xc
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0x8
        lbaf_lbads = 0xc
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0x40
        lbaf_lbads = 0xc
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0x80
        lbaf_lbads = 0xc
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
    {
        lbaf_ms = 0
        lbaf_lbads = 0
        lbaf_rp = 0
        lbaf_rsvd1 = 0
    },
]
Actions #1

Updated by Electric Monk almost 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 0d140ff944190d3ff2fdba65e9864f3c03248162

commit  0d140ff944190d3ff2fdba65e9864f3c03248162
Author: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Date:   2016-08-25T15:04:44.000Z

    7279 nvme.c: idns->id_nlbaf is a 0's based value.
    Reviewed by: Dan Fields <dan.fields@nexenta.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Actions

Also available in: Atom PDF