diff options
author | mav <mav@FreeBSD.org> | 2015-03-16 09:15:59 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-03-16 09:15:59 +0000 |
commit | cfdd687fd71a37a2a9e69bd47ef91b7aac3c5074 (patch) | |
tree | 48de551fe66d3854afaf18e6bbf9c6ab74f01032 /usr.sbin | |
parent | d854427d60da6996c2c72413a20a4704d9aef37e (diff) | |
download | FreeBSD-src-cfdd687fd71a37a2a9e69bd47ef91b7aac3c5074.zip FreeBSD-src-cfdd687fd71a37a2a9e69bd47ef91b7aac3c5074.tar.gz |
Increase S/G list size of 32 to 33 entries.
32 entries are not enough for the worst case of misaligned 128KB request,
that made FreeBSD to chunk large quests in odd pieces.
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/block_if.h | 2 | ||||
-rw-r--r-- | usr.sbin/bhyve/pci_virtio_block.c | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/bhyve/block_if.h b/usr.sbin/bhyve/block_if.h index 4e2c1b4..1cb7c80 100644 --- a/usr.sbin/bhyve/block_if.h +++ b/usr.sbin/bhyve/block_if.h @@ -39,7 +39,7 @@ #include <sys/uio.h> #include <sys/unistd.h> -#define BLOCKIF_IOV_MAX 32 /* not practical to be IOV_MAX */ +#define BLOCKIF_IOV_MAX 33 /* not practical to be IOV_MAX */ struct blockif_req { struct iovec br_iov[BLOCKIF_IOV_MAX]; diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c index b0d3830..163fa06 100644 --- a/usr.sbin/bhyve/pci_virtio_block.c +++ b/usr.sbin/bhyve/pci_virtio_block.c @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #define VTBLK_RINGSZ 64 -#define VTBLK_MAXSEGS 32 - #define VTBLK_S_OK 0 #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 @@ -201,10 +199,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vqueue_info *vq) int iolen; int writeop, type; off_t offset; - struct iovec iov[VTBLK_MAXSEGS + 2]; - uint16_t idx, flags[VTBLK_MAXSEGS + 2]; + struct iovec iov[BLOCKIF_IOV_MAX + 2]; + uint16_t idx, flags[BLOCKIF_IOV_MAX + 2]; - n = vq_getchain(vq, &idx, iov, VTBLK_MAXSEGS + 2, flags); + n = vq_getchain(vq, &idx, iov, BLOCKIF_IOV_MAX + 2, flags); /* * The first descriptor will be the read-only fixed header, @@ -214,7 +212,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vqueue_info *vq) * XXX - note - this fails on crash dump, which does a * VIRTIO_BLK_T_FLUSH with a zero transfer length */ - assert(n >= 2 && n <= VTBLK_MAXSEGS + 2); + assert(n >= 2 && n <= BLOCKIF_IOV_MAX + 2); io = &sc->vbsc_ios[idx]; assert((flags[0] & VRING_DESC_F_WRITE) == 0); @@ -347,7 +345,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ - sc->vbsc_cfg.vbc_seg_max = VTBLK_MAXSEGS; + sc->vbsc_cfg.vbc_seg_max = BLOCKIF_IOV_MAX; sc->vbsc_cfg.vbc_geometry.cylinders = 0; /* no geometry */ sc->vbsc_cfg.vbc_geometry.heads = 0; sc->vbsc_cfg.vbc_geometry.sectors = 0; |