aboutsummaryrefslogtreecommitdiffstats
path: root/sys/cam/nvme/nvme_da.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2020-08-20 02:51:18 +0000
committerAlexander Motin <mav@FreeBSD.org>2020-08-20 02:51:18 +0000
commit78503231a77a2d9eb8e8334be80a42c4f782fb0e (patch)
tree5dafff7bfcb615ddc8b39738c30b3759ab2d82c4 /sys/cam/nvme/nvme_da.c
parentd55e9ce04d2ae7eaf9c9c3dd5c18b9200a804db8 (diff)
downloadsrc-78503231a77a2d9eb8e8334be80a42c4f782fb0e.tar.gz
src-78503231a77a2d9eb8e8334be80a42c4f782fb0e.zip
MFC r364178: Report proper stripesize for nda(4).
Same as for nvd(4) report NPWG if present, otherise NOIOB.
Notes
Notes: svn path=/stable/12/; revision=364413
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r--sys/cam/nvme/nvme_da.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index d382a4d9ce98..059b940ea2df 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -805,7 +805,11 @@ ndaregister(struct cam_periph *periph, void *arg)
disk->d_hba_device = cpi.hba_device;
disk->d_hba_subvendor = cpi.hba_subvendor;
disk->d_hba_subdevice = cpi.hba_subdevice;
- disk->d_stripesize = disk->d_sectorsize;
+ if (((nsd->nsfeat >> NVME_NS_DATA_NSFEAT_NPVALID_SHIFT) &
+ NVME_NS_DATA_NSFEAT_NPVALID_MASK) != 0 && nsd->npwg != 0)
+ disk->d_stripesize = ((nsd->npwg + 1) * disk->d_sectorsize);
+ else
+ disk->d_stripesize = nsd->noiob * disk->d_sectorsize;
disk->d_stripeoffset = 0;
disk->d_devstat = devstat_new_entry(periph->periph_name,
periph->unit_number, disk->d_sectorsize,