Author: sephe
Date: Mon Aug  1 04:51:31 2016
New Revision: 303604
URL: https://svnweb.freebsd.org/changeset/base/303604

Log:
  hyperv/storvsc: Set maxio to 128KB.
  
  MFC after:    1 week
  Sponsored by: Microsoft
  Differential Revision:        https://reviews.freebsd.org/D7360

Modified:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c        Mon Aug  1 
04:26:24 2016        (r303603)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c        Mon Aug  1 
04:51:31 2016        (r303604)
@@ -88,10 +88,25 @@ __FBSDID("$FreeBSD$");
 
 #define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta)
 
-#define STORVSC_DATA_SEGCNT_MAX                32
+/*
+ * 33 segments are needed to allow 128KB maxio, in case the data
+ * in the first page is _not_ PAGE_SIZE aligned, e.g.
+ *
+ *     |<----------- 128KB ----------->|
+ *     |                               |
+ *  0  2K 4K    8K   16K   124K  128K  130K
+ *  |  |  |     |     |       |     |  |
+ *  +--+--+-----+-----+.......+-----+--+--+
+ *  |  |  |     |     |       |     |  |  | DATA
+ *  |  |  |     |     |       |     |  |  |
+ *  +--+--+-----+-----+.......------+--+--+
+ *     |  |                         |  |
+ *     | 1|            31           | 1| ...... # of segments
+ */
+#define STORVSC_DATA_SEGCNT_MAX                33
 #define STORVSC_DATA_SEGSZ_MAX         PAGE_SIZE
 #define STORVSC_DATA_SIZE_MAX          \
-       (STORVSC_DATA_SEGCNT_MAX * STORVSC_DATA_SEGSZ_MAX)
+       ((STORVSC_DATA_SEGCNT_MAX - 1) * STORVSC_DATA_SEGSZ_MAX)
 
 struct storvsc_softc;
 
@@ -1386,6 +1401,7 @@ storvsc_action(struct cam_sim *sim, unio
                cpi->hba_misc = PIM_NOBUSRESET;
                if (hv_storvsc_use_pim_unmapped)
                        cpi->hba_misc |= PIM_UNMAPPED;
+               cpi->maxio = STORVSC_DATA_SIZE_MAX;
                cpi->hba_eng_cnt = 0;
                cpi->max_target = STORVSC_MAX_TARGETS;
                cpi->max_lun = sc->hs_drv_props->drv_max_luns_per_target;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to