svn commit: r364178 - head/sys/cam/nvme
Alexander Motin
mav at FreeBSD.org
Wed Aug 12 19:37:58 UTC 2020
Author: mav
Date: Wed Aug 12 19:37:57 2020
New Revision: 364178
URL: https://svnweb.freebsd.org/changeset/base/364178
Log:
Report proper stripesize for nda(4).
Same as for nvd(4) report NPWG if present, otherise NOIOB.
MFC after: 1 week
Modified:
head/sys/cam/nvme/nvme_da.c
Modified: head/sys/cam/nvme/nvme_da.c
==============================================================================
--- head/sys/cam/nvme/nvme_da.c Wed Aug 12 19:11:53 2020 (r364177)
+++ head/sys/cam/nvme/nvme_da.c Wed Aug 12 19:37:57 2020 (r364178)
@@ -943,7 +943,11 @@ ndaregister(struct cam_periph *periph, void *arg)
disk->d_hba_subdevice = cpi.hba_subdevice;
snprintf(disk->d_attachment, sizeof(disk->d_attachment),
"%s%d", cpi.dev_name, cpi.unit_number);
- 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