Date: Wed, 12 Aug 2020 19:37:58 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364178 - head/sys/cam/nvme Message-ID: <202008121937.07CJbwp4009711@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008121937.07CJbwp4009711>