lib/ftl: Remove buffer alignment requirements
Ftl should no longer require 4k alignment for I/O buffers for either internal or external requests. The 4k alignment was needed due to a bug in QEMU when handling internal SGL buffers in LNVM commands. Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com> Change-Id: Icafc14b7811c9c0ffa13789e341c453503cf2821 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460106 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
1897943987
commit
a4b3481242
@ -725,8 +725,6 @@ bdev_ftl_create_cb(struct spdk_ftl_dev *dev, void *ctx, int status)
|
|||||||
ftl_bdev->bdev.write_cache = 0;
|
ftl_bdev->bdev.write_cache = 0;
|
||||||
ftl_bdev->bdev.blocklen = attrs.lbk_size;
|
ftl_bdev->bdev.blocklen = attrs.lbk_size;
|
||||||
ftl_bdev->bdev.blockcnt = attrs.lbk_cnt;
|
ftl_bdev->bdev.blockcnt = attrs.lbk_cnt;
|
||||||
/* TODO: Investigate why nbd test are failing without this alignment */
|
|
||||||
ftl_bdev->bdev.required_alignment = spdk_u32log2(attrs.lbk_size);
|
|
||||||
ftl_bdev->bdev.uuid = attrs.uuid;
|
ftl_bdev->bdev.uuid = attrs.uuid;
|
||||||
|
|
||||||
SPDK_DEBUGLOG(SPDK_LOG_BDEV_FTL, "Creating bdev %s:\n", ftl_bdev->bdev.name);
|
SPDK_DEBUGLOG(SPDK_LOG_BDEV_FTL, "Creating bdev %s:\n", ftl_bdev->bdev.name);
|
||||||
|
@ -698,8 +698,7 @@ ftl_band_alloc_lba_map(struct ftl_band *band)
|
|||||||
|
|
||||||
lba_map->segments = (char *)lba_map->map + ftl_lba_map_num_lbks(dev) * FTL_BLOCK_SIZE;
|
lba_map->segments = (char *)lba_map->map + ftl_lba_map_num_lbks(dev) * FTL_BLOCK_SIZE;
|
||||||
|
|
||||||
lba_map->dma_buf = spdk_dma_zmalloc(ftl_tail_md_num_lbks(dev) * FTL_BLOCK_SIZE,
|
lba_map->dma_buf = spdk_dma_zmalloc(ftl_tail_md_num_lbks(dev) * FTL_BLOCK_SIZE, 0, NULL);
|
||||||
FTL_BLOCK_SIZE, NULL);
|
|
||||||
if (!lba_map->dma_buf) {
|
if (!lba_map->dma_buf) {
|
||||||
spdk_mempool_put(dev->lba_pool, lba_map->map);
|
spdk_mempool_put(dev->lba_pool, lba_map->map);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -196,7 +196,7 @@ ftl_restore_init(struct spdk_ftl_dev *dev, ftl_restore_fn cb)
|
|||||||
md_size = spdk_max(ftl_dev_num_bands(dev) * ftl_head_md_num_lbks(dev) * FTL_BLOCK_SIZE,
|
md_size = spdk_max(ftl_dev_num_bands(dev) * ftl_head_md_num_lbks(dev) * FTL_BLOCK_SIZE,
|
||||||
ftl_tail_md_num_lbks(dev) * FTL_BLOCK_SIZE);
|
ftl_tail_md_num_lbks(dev) * FTL_BLOCK_SIZE);
|
||||||
|
|
||||||
restore->md_buf = spdk_dma_zmalloc(md_size, FTL_BLOCK_SIZE, NULL);
|
restore->md_buf = spdk_dma_zmalloc(md_size, 0, NULL);
|
||||||
if (!restore->md_buf) {
|
if (!restore->md_buf) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -1173,14 +1173,7 @@ ftl_restore_pad_band(struct ftl_restore_band *rband)
|
|||||||
ppa = band->chunk_buf[i].start_ppa;
|
ppa = band->chunk_buf[i].start_ppa;
|
||||||
ppa.lbk = info.wp;
|
ppa.lbk = info.wp;
|
||||||
|
|
||||||
/*
|
buffer = spdk_dma_zmalloc(FTL_BLOCK_SIZE * dev->xfer_size, 0, NULL);
|
||||||
* We need 4k alignment for lightnvm writes; otherwise, due to a bug in QEMU,
|
|
||||||
* scatter gather lists to underlying block device become broken as the number of
|
|
||||||
* incoming offsets (dev->xfer_size) would be smaller than the calculated size of
|
|
||||||
* sgl (dev->xfer_size+1), which eventually results in some part of the write
|
|
||||||
* hitting offset 0 of the drive, overwriting head_md of band 0.
|
|
||||||
*/
|
|
||||||
buffer = spdk_dma_zmalloc(FTL_BLOCK_SIZE * dev->xfer_size, FTL_BLOCK_SIZE, NULL);
|
|
||||||
if (spdk_unlikely(!buffer)) {
|
if (spdk_unlikely(!buffer)) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -161,8 +161,7 @@ ftl_rwb_batch_init(struct ftl_rwb *rwb, struct ftl_rwb_batch *batch, unsigned in
|
|||||||
|
|
||||||
LIST_INIT(&batch->entry_list);
|
LIST_INIT(&batch->entry_list);
|
||||||
|
|
||||||
batch->buffer = spdk_dma_zmalloc(FTL_BLOCK_SIZE * rwb->xfer_size,
|
batch->buffer = spdk_dma_zmalloc(FTL_BLOCK_SIZE * rwb->xfer_size, 0, NULL);
|
||||||
FTL_BLOCK_SIZE, NULL);
|
|
||||||
if (!batch->buffer) {
|
if (!batch->buffer) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user