hyperv/storvsc: Set maxio to 128KB.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7360
This commit is contained in:
Sepherosa Ziehau 2016-08-01 04:51:31 +00:00
parent 9d6016a773
commit 88cb8d7812

View File

@ -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, union ccb *ccb)
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;