numam-spdk/lib
Tomasz Zawadzki ca470ff844 lib/blob: chunk spdk_bs_init to exact multiple of sector size
During spdk_bs_init() data present on the device can be cleared
depending on the clear_method used.

Picking BS_CLEAR_WITH_UNMAP results in deallocate command sent
when NVMe device is used.

The size of logical blocks do not have to match the indirection unit
size (IU) of the device. The SSDs can only unmap full physical blocks.
Since the deallocate command is advisory, the controller can complete
the command without deallocating any blocks.

In practice this results in some controllers not deallocating any blocks
if number of logical blocks is not aligned to the IU size.

Make sure that spdk_bs_init() handles this case.
The size of the unmap is now chunked at UINT32_MAX - 127,
which is an even multiple of 512B blocks with a 64KiB IU.

This is already addressed with an API change in SPDK 21.10:
(f01146ae)blob: use uint64_t for unmap and write_zeroes lba count

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie00bd5ae7cdaec4f1486f16fceb6cb18e30bf563
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9970
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-11-17 10:55:17 +00:00
..
accel lib/accel: change max batch size to match idxd batch max 2020-11-18 11:27:23 +00:00
bdev bdev: add function to return aio's errno 2021-01-20 00:13:49 +00:00
blob lib/blob: chunk spdk_bs_init to exact multiple of sector size 2021-11-17 10:55:17 +00:00
blobfs blob: Make the ABI compatibility for spdk_bs_opts 2020-12-29 07:55:22 +00:00
conf lib/conf: check pointer return value when use calloc 2020-11-11 01:02:31 +00:00
env_dpdk env_dpdk: save hotplug timeout timestamps separate from rte_devargs 2021-05-10 10:45:57 +00:00
env_ocf lib/thead: print error log when create mempool or ring failed 2020-11-05 09:41:06 +00:00
event Revert "lib/event: do not spawn a thread for each reactor" 2021-02-01 08:04:44 +00:00
ftl lib/ftl: add assert check for ftl_wptr_from_band 2020-11-17 08:25:31 +00:00
idxd lib/idxd: small code cleanup 2020-10-22 22:43:28 +00:00
ioat ioat: hide 2MiB boundary memory check in spdk_vtophys() 2020-11-25 17:15:13 +00:00
iscsi lib/iscsi: return immediately from iscsi_parse_params if len is 0 2021-03-03 08:11:04 +00:00
json json: add spdk_json_free_object() 2020-10-19 10:02:10 +00:00
jsonrpc lib/jsonrpc: Add a new API to send response for writing bool result. 2020-11-16 15:08:47 +00:00
log log: remove internal log.h header 2020-10-15 08:23:39 +00:00
lvol blob: Make the ABI compatibility of spdk_blob_open_opts structure. 2020-12-29 07:55:22 +00:00
nbd nbd: set io timeout 2021-03-03 08:12:01 +00:00
net lib/jsonrpc: Add a new API to send response for writing bool result. 2020-11-16 15:08:47 +00:00
notify log: remove internal log.h header 2020-10-15 08:23:39 +00:00
nvme nvme: reset mapping_length correctly for contig SGL 2021-10-27 08:47:51 +00:00
nvmf nvmf/rdma: Handle CQ resize for iWARP transport 2021-01-29 17:06:10 +00:00
rdma rdma: Remove check for translation length 2021-01-18 13:02:20 +00:00
reduce log: remove internal log.h header 2020-10-15 08:23:39 +00:00
rocksdb build: use DEPDIRS variables to build SPDK_LIB_LIST 2020-12-18 09:40:01 +00:00
rpc RPC: update the error message for current RPC state 2020-07-31 08:21:37 +00:00
scsi lib: Use PRId64 for portability 2020-11-20 11:01:37 +00:00
sock sock: add enable_quickack and enable_placement_id when writing json config 2021-02-26 11:51:37 +00:00
thread lib/thread: Defer exiting thread if thread is unregistering io_device 2021-01-13 10:07:51 +00:00
trace trace: disable trace by set num-trace-entries=0 2020-11-26 10:16:26 +00:00
ut_mock mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
util lib/util: Fix valgrind error reported on ARM platform 2021-03-05 08:01:28 +00:00
vfio_user NVMe/vfio-user: add initial version vfio-user transport to NVMe driver 2021-01-21 05:00:18 +00:00
vhost lib/vhost: force cpumask to be subset of application's CPU mask 2021-03-05 08:01:35 +00:00
virtio virtio: add transitional virtio device support 2020-11-20 11:00:53 +00:00
vmd lib: Use PRId64 for portability 2020-11-20 11:01:37 +00:00
Makefile NVMe/vfio-user: add initial version vfio-user transport to NVMe driver 2021-01-21 05:00:18 +00:00