svn commit: r364413 - stable/12/sys/cam/nvme
Alexander Motin
mav at FreeBSD.org
Thu Aug 20 02:51:18 UTC 2020
Author: mav
Date: Thu Aug 20 02:51:18 2020
New Revision: 364413
URL: https://svnweb.freebsd.org/changeset/base/364413
Log:
MFC r364178: Report proper stripesize for nda(4).
Same as for nvd(4) report NPWG if present, otherise NOIOB.
Modified:
stable/12/sys/cam/nvme/nvme_da.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/cam/nvme/nvme_da.c
==============================================================================
--- stable/12/sys/cam/nvme/nvme_da.c Thu Aug 20 01:31:21 2020 (r364412)
+++ stable/12/sys/cam/nvme/nvme_da.c Thu Aug 20 02:51:18 2020 (r364413)
@@ -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,
More information about the svn-src-all
mailing list