Skip to content

Commit e98250e

Browse files
author
root
committed
fix the md buffer size
1 parent 5b8e495 commit e98250e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

module/bdev/passthru/vbdev_passthru.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ vbdev_passthru_register(const char *bdev_name)
11421142
// SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA);
11431143

11441144
pt_node->malloc_md_buf = spdk_zmalloc(
1145-
(pt_node->offset_start * pt_node->md_len) * pt_node->pt_bdev.blocklen,
1145+
(pt_node->offset_start * pt_node->pt_bdev.blocklen) + pt_node->pt_bdev.blocklen,
11461146
spdk_bdev_get_buf_align(pt_node->base_bdev),
11471147
NULL,
11481148
SPDK_ENV_LCORE_ID_ANY,
@@ -1212,7 +1212,7 @@ vbdev_passthru_register(const char *bdev_name)
12121212
// rc = spdk_bdev_read_blocks(pt_node->base_desc, channel->base_ch,
12131213
// pt_node->malloc_md_buf, 0, (pt_node->offset_start) * pt_node->multiplier, _pt_complete_io_zero, NULL);
12141214

1215-
uint64_t blocks_to_read = 28000 * 8;
1215+
uint64_t blocks_to_read = 28000;
12161216
uint64_t max_blocks_per_io = 1024 * 1; // or another value that works
12171217
uint64_t offset = 0;
12181218
while (blocks_to_read > 0) {
@@ -1221,8 +1221,8 @@ vbdev_passthru_register(const char *bdev_name)
12211221
rc = spdk_bdev_read_blocks(
12221222
pt_node->base_desc,
12231223
channel->base_ch,
1224-
pt_node->malloc_md_buf + offset * pt_node->pt_bdev.blocklen,
1225-
offset,
1224+
pt_node->malloc_md_buf + (offset * pt_node->pt_bdev.blocklen),
1225+
offset * pt_node->multiplier,
12261226
blocks_this_io * pt_node->multiplier,
12271227
_pt_complete_io_zero,
12281228
NULL

0 commit comments

Comments
 (0)