crosvm/sys_util
Daniel Verkamp 2b109386e7 devices: virtio: block: advertise seg_max
The virtio-blk configuration space has a `seg_max` field that lets the
device inform the driver of the maximum number of segments allowed
within a single request.  The Linux virtio block driver assumes that if
the corresponding feature (VIRTIO_BLK_F_SEG_MAX) is not advertised, then
only one segment can be used.

Add a segment limit based on sysconf(_SC_IOV_MAX) to allow the Linux
block stack to make use of multiple segments in a single request, which
will get translated into a single readv/writev call in the crosvm block
device.

BUG=None
TEST=strace crosvm virtio-blk process and note preadv with iov_cnt > 1

Change-Id: Ia14ebebb85daa21e2d43437bb74886f32e6e8187
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1876806
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2019-11-08 20:35:18 +00:00
..
poll_token_derive edition: Remove extern crate lines 2019-04-15 02:06:08 -07:00
src devices: virtio: block: advertise seg_max 2019-11-08 20:35:18 +00:00
Cargo.toml tempfile: Unify the two tempdir implementations 2019-07-11 16:15:38 -07:00