vhost: Fix the issue of virtual machine device parameter max_segments always equal to 1

Solve the problem that the /sys/block/vd../max_segments is always 1 in the virtual
machine,and avoid the problem of low sequential read and write performance caused
by this limitation in the general block device layer of some lower kernels.

Signed-off-by: suhua <suhua1@kingsoft.com>
Change-Id: I3289b4c6c74d9225f34e117f444f310bf8bc8ea2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/975
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
suhua 2020-02-21 09:50:12 +08:00 committed by Tomasz Zawadzki
parent 4f7fa18d69
commit 9c6d4649eb

View File

@ -919,6 +919,7 @@ vhost_blk_get_config(struct spdk_vhost_dev *vdev, uint8_t *config,
uint32_t blk_size;
uint64_t blkcnt;
memset(&blkcfg, 0, sizeof(blkcfg));
bvdev = to_blk_dev(vdev);
assert(bvdev != NULL);
bdev = bvdev->bdev;
@ -949,7 +950,6 @@ vhost_blk_get_config(struct spdk_vhost_dev *vdev, uint8_t *config,
}
}
memset(&blkcfg, 0, sizeof(blkcfg));
blkcfg.blk_size = blk_size;
/* minimum I/O size in blocks */
blkcfg.min_io_size = 1;