Hi Jim could you let me know the use case for exposing the controller stripe size as the disk stripe size done by this commit?

I ask as it actually causes problems for ZFS which has checks to ensure zpools perform optimally by correctly configuring ashift to match the stripesize if reported.

This is usually fine as stripe size typically reports the physical block size of device, where sectorsize is the logical block size, unfortunately this is currently limited to ashift of 13 (8KB) so when nvme reports 128KB it limits it 8KB and hence every subsequent zpool status reports a warning about optimal performance.

Before I look to fix one or the other, I wanted to fully understand the reasoning behind how nvme behaves here.

On 30/10/2015 16:35, Jim Harris wrote:
Author: jimharris
Date: Fri Oct 30 16:35:18 2015
New Revision: 290199
URL: https://svnweb.freebsd.org/changeset/base/290199

Log:
   nvd, nvme: report stripesize through GEOM disk layer
MFC after: 3 days
   Sponsored by:        Intel

Modified:
   head/sys/dev/nvd/nvd.c
   head/sys/dev/nvme/nvme.h
   head/sys/dev/nvme/nvme_ns.c

Modified: head/sys/dev/nvd/nvd.c
==============================================================================
--- head/sys/dev/nvd/nvd.c      Fri Oct 30 16:06:34 2015        (r290198)
+++ head/sys/dev/nvd/nvd.c      Fri Oct 30 16:35:18 2015        (r290199)
@@ -279,6 +279,7 @@ nvd_new_disk(struct nvme_namespace *ns,
        disk->d_sectorsize = nvme_ns_get_sector_size(ns);
        disk->d_mediasize = (off_t)nvme_ns_get_size(ns);
        disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns);
+       disk->d_stripesize = nvme_ns_get_stripesize(ns);
if (TAILQ_EMPTY(&disk_head))
                disk->d_unit = 0;

Modified: head/sys/dev/nvme/nvme.h
==============================================================================
--- head/sys/dev/nvme/nvme.h    Fri Oct 30 16:06:34 2015        (r290198)
+++ head/sys/dev/nvme/nvme.h    Fri Oct 30 16:35:18 2015        (r290199)
@@ -870,6 +870,7 @@ const char *        nvme_ns_get_serial_number(s
  const char *  nvme_ns_get_model_number(struct nvme_namespace *ns);
  const struct nvme_namespace_data *
                nvme_ns_get_data(struct nvme_namespace *ns);
+uint32_t       nvme_ns_get_stripesize(struct nvme_namespace *ns);
int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp,
                            nvme_cb_fn_t cb_fn);

Modified: head/sys/dev/nvme/nvme_ns.c
==============================================================================
--- head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:06:34 2015        (r290198)
+++ head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:35:18 2015        (r290199)
@@ -210,6 +210,13 @@ nvme_ns_get_data(struct nvme_namespace *
        return (&ns->data);
  }
+uint32_t
+nvme_ns_get_stripesize(struct nvme_namespace *ns)
+{
+
+       return (ns->stripesize);
+}
+
  static void
  nvme_ns_bio_done(void *arg, const struct nvme_completion *status)
  {


_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to