[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/50] block/iscsi: Adding new iSER transport layer o
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/50] block/iscsi: Adding new iSER transport layer option |
Date: |
Mon, 24 Oct 2016 15:46:49 +0200 |
From: Roy Shterman <address@hidden>
iSER is a new transport layer supported in Libiscsi,
iSER provides a zero-copy RDMA capable interface that can
improve performance.
In order to use the new iSER transport one need to have RDMA supported HW
and to choose iser as the protocol name in Libiscsi URI.
For now iSER memory buffers are pre-allocated and pre-registered,
hence in order to work with iSER from QEMU, one need to enable
MEMLOCK attribute in the VM to be large enough for all iSER buffers and RDMA
resources.
Signed-off-by: Roy Shterman <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 46 insertions(+), 1 deletion(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index e9bf5db..71bd523 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1644,7 +1644,13 @@ static int iscsi_open(BlockDriverState *bs, QDict
*options, int flags,
ret = -ENOMEM;
goto out;
}
-
+#if LIBISCSI_API_VERSION >= (20160603)
+ if (iscsi_init_transport(iscsi, iscsi_url->transport)) {
+ error_setg(errp, ("Error initializing transport."));
+ ret = -EINVAL;
+ goto out;
+ }
+#endif
if (iscsi_set_targetname(iscsi, iscsi_url->target)) {
error_setg(errp, "iSCSI: Failed to set target name.");
ret = -EINVAL;
@@ -2048,9 +2054,48 @@ static BlockDriver bdrv_iscsi = {
.bdrv_attach_aio_context = iscsi_attach_aio_context,
};
+#if LIBISCSI_API_VERSION >= (20160603)
+static BlockDriver bdrv_iser = {
+ .format_name = "iser",
+ .protocol_name = "iser",
+
+ .instance_size = sizeof(IscsiLun),
+ .bdrv_needs_filename = true,
+ .bdrv_file_open = iscsi_open,
+ .bdrv_close = iscsi_close,
+ .bdrv_create = iscsi_create,
+ .create_opts = &iscsi_create_opts,
+ .bdrv_reopen_prepare = iscsi_reopen_prepare,
+ .bdrv_reopen_commit = iscsi_reopen_commit,
+ .bdrv_invalidate_cache = iscsi_invalidate_cache,
+
+ .bdrv_getlength = iscsi_getlength,
+ .bdrv_get_info = iscsi_get_info,
+ .bdrv_truncate = iscsi_truncate,
+ .bdrv_refresh_limits = iscsi_refresh_limits,
+
+ .bdrv_co_get_block_status = iscsi_co_get_block_status,
+ .bdrv_co_pdiscard = iscsi_co_pdiscard,
+ .bdrv_co_pwrite_zeroes = iscsi_co_pwrite_zeroes,
+ .bdrv_co_readv = iscsi_co_readv,
+ .bdrv_co_writev_flags = iscsi_co_writev_flags,
+ .bdrv_co_flush_to_disk = iscsi_co_flush,
+
+#ifdef __linux__
+ .bdrv_aio_ioctl = iscsi_aio_ioctl,
+#endif
+
+ .bdrv_detach_aio_context = iscsi_detach_aio_context,
+ .bdrv_attach_aio_context = iscsi_attach_aio_context,
+};
+#endif
+
static void iscsi_block_init(void)
{
bdrv_register(&bdrv_iscsi);
+#if LIBISCSI_API_VERSION >= (20160603)
+ bdrv_register(&bdrv_iser);
+#endif
}
block_init(iscsi_block_init);
--
1.8.3.1
- [Qemu-devel] [PULL 00/50] Miscellaneous patches for 2016-10-24, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 01/50] kvm-all: don't use stale dbg_data->cpu, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 02/50] rbd: shift byte count as a 64-bit value, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 05/50] Put the copyright information on a separate line, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 07/50] qemu-thread: use acquire/release to clarify semantics of QemuEvent, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 03/50] block/iscsi: Introducing new zero-copy API, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 08/50] rcu: simplify memory barriers, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 04/50] block/iscsi: Adding new iSER transport layer option,
Paolo Bonzini <=
- [Qemu-devel] [PULL 06/50] atomic: introduce smp_mb_acquire and smp_mb_release, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 12/50] target-i386: fix 32-bit addresses in LEA, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 11/50] test-i386: fix bitrot for 64-bit, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 09/50] atomic: base mb_read/mb_set on load-acquire and store-release, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 10/50] qht-bench: relax test_start/stop atomic accesses, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 13/50] tcg: try sti when moving a constant into a dead memory temp, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 14/50] memory: eliminate global MemoryListeners, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 17/50] memory: optimize memory_region_sync_dirty_bitmap, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 15/50] memory: add a per-AddressSpace list of listeners, Paolo Bonzini, 2016/10/24
- [Qemu-devel] [PULL 20/50] rng: remove unused included header, Paolo Bonzini, 2016/10/24