Spdk/lib/bdev
Changpeng Liu efd7b514d4 bdev: rewind child offset to last block size aligned iov
Here is the an example to describe existing issue:

There is a Write request with 64KiB data length, and this IO is cross the IO
boundary.  We assume that the parent IO will have 2 children requests, one is
33KiB length, the other one is 31KiB.  Here is the view of parent iovs, the
first 33KiB length data has 33 iovs:

iov.[0].iov_length = 1024;
.
.
iov.[31].iov_length = 256;
iov.[32].iov_length = 768;
.
.
iov.[64].iov_length = 1024;

In function _spdk_bdev_io_split(), then you can see that for the 33KiB length
child request, exiting code will run out of child child_iov space and return
error due to last one data buffer is not block size aligned.

Here we can rewind the existing offset to last block size aligned buffer to
avoid the error case, for backend which need aligned data buffer such as
AIO backend, the request will go through spdk_bdev_io_get_buf() again to
do the data copy, otherwise for those backend devices such as NVMe with
hardware SGL support, 256 data segment is fine for them.

Change-Id: I96ebdf29829d86f9b38fab28a7406eedc9fa44ef
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453604
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-01 04:20:21 +00:00
..
aio bdev/aio: An error code can be returned via the rpc interface. 2019-05-22 16:12:40 +00:00
compress bdev/compress: add RPC to specify PMD 2019-06-26 07:57:09 +00:00
crypto bdev/crypto: cleanup the vbdev_crypto_examine 2019-05-02 09:10:38 +00:00
delay bdev: Create a new delay vbdev module 2019-05-31 14:37:26 +00:00
error bdev: make spdk_bdev_register_module_xxx function names predictable 2019-02-11 23:56:53 +00:00
gpt bdev: switch to spdk_*malloc(). 2019-04-09 06:30:42 +00:00
iscsi bdev/iscsi: fix iscsi bdev wrong lun id 2019-04-01 01:16:51 +00:00
lvol blobstore: Make possible to remove snapshot if there is only one clone 2019-06-18 13:19:32 +00:00
malloc bdev: Make malloc bdev use the new zero copy mechanism 2019-04-23 18:38:39 +00:00
null bdev/null : Clean up module resources that failed to initialize. 2019-04-24 22:25:47 +00:00
nvme dif: Add data offset to DIF context separately from start block address 2019-06-11 18:53:58 +00:00
ocf ocf: Improve handling of partial IOs 2019-06-07 18:18:42 +00:00
passthru bdev/passthru: add error check in get buffer read callback 2019-05-20 17:02:27 +00:00
pmem bdev: process failure of spdk_bdev_io_get_buf_cb in each bdev module 2019-02-27 07:28:15 +00:00
raid bdev/raid: add additional NULL check for data iovec 2019-06-07 05:05:22 +00:00
rbd bdev: process failure of spdk_bdev_io_get_buf_cb in each bdev module 2019-02-27 07:28:15 +00:00
rpc bdev: make bdevs array for get_bdevs_iostat RPC 2019-05-08 22:43:00 +00:00
split misc/rpc: rename some C functions of rpc methods 2019-05-07 05:30:16 +00:00
uring bdev/uring: adjust to the latest io_uring API 2019-06-07 18:43:07 +00:00
virtio env: Add free_space parameter to spdk_ring_enqueue 2019-06-05 05:23:58 +00:00
bdev.c bdev: rewind child offset to last block size aligned iov 2019-07-01 04:20:21 +00:00
Makefile bdev: add uring in bdev Makefile 2019-06-11 00:26:48 +00:00
part.c bdev/part: separate buffer metadata support 2019-06-19 03:43:11 +00:00
scsi_nvme.c bdev: move error union to internal spdk_bdev_io struct 2018-06-26 20:04:07 +00:00
vtune.c mk: don't use '-include spdk/config.h' 2018-10-02 23:13:32 +00:00