Commit 9f583911 authored by Jim Harris's avatar Jim Harris
Browse files

bdev: add INI config file options for bdev_io parameters

parent 9f2a0a67
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -29,6 +29,15 @@
  # Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.
  #TpointGroupMask 0x0

# Users may activate entries in this section to override default values for
# global parameters in the block device (bdev) subsystem.
[Bdev]
  # Number of spdk_bdev_io structures allocated in the global bdev subsystem pool.
  #BdevIoPoolSize 65536

  # Maximum number of spdk_bdev_io structures to cache per thread.
  #BdevIoCacheSize 256

[iSCSI]
  # node name (not include optional part)
  # Users can optionally change this to fit their environment.
+9 −0
Original line number Diff line number Diff line
@@ -26,6 +26,15 @@
  #PciWhitelist 0000:03:00.0
  #PciWhitelist 0000:04:00.0

# Users may activate entries in this section to override default values for
# global parameters in the block device (bdev) subsystem.
[Bdev]
  # Number of spdk_bdev_io structures allocated in the global bdev subsystem pool.
  #BdevIoPoolSize 65536

  # Maximum number of spdk_bdev_io structures to cache per thread.
  #BdevIoCacheSize 256

# Users may change this section to create a different number or size of
#  malloc LUNs.
# This will generate 8 LUNs with a malloc-allocated backend.
+10 −0
Original line number Diff line number Diff line
@@ -29,6 +29,16 @@
  # Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.
  #TpointGroupMask 0x0

# Users may activate entries in this section to override default values for
# global parameters in the block device (bdev) subsystem.
[Bdev]
  # Number of spdk_bdev_io structures allocated in the global bdev subsystem pool.
  #BdevIoPoolSize 65536

  # Maximum number of spdk_bdev_io structures to cache per thread.
  #BdevIoCacheSize 256

# Users may not want to use offload even it is available.
# Users can use offload by specifying "Enable Yes" in this section
# if it is available.
# Users may use the whitelist to initialize specified devices, IDS
+25 −0
Original line number Diff line number Diff line
@@ -637,12 +637,37 @@ spdk_bdev_modules_init(void)
void
spdk_bdev_initialize(spdk_bdev_init_cb cb_fn, void *cb_arg)
{
	struct spdk_conf_section *sp;
	struct spdk_bdev_opts bdev_opts;
	int32_t bdev_io_pool_size, bdev_io_cache_size;
	int cache_size;
	int rc = 0;
	char mempool_name[32];

	assert(cb_fn != NULL);

	sp = spdk_conf_find_section(NULL, "Bdev");
	if (sp != NULL) {
		spdk_bdev_get_opts(&bdev_opts);

		bdev_io_pool_size = spdk_conf_section_get_intval(sp, "BdevIoPoolSize");
		if (bdev_io_pool_size >= 0) {
			bdev_opts.bdev_io_pool_size = bdev_io_pool_size;
		}

		bdev_io_cache_size = spdk_conf_section_get_intval(sp, "BdevIoCacheSize");
		if (bdev_io_cache_size >= 0) {
			bdev_opts.bdev_io_cache_size = bdev_io_cache_size;
		}

		if (spdk_bdev_set_opts(&bdev_opts)) {
			spdk_bdev_init_complete(-1);
			return;
		}

		assert(memcmp(&bdev_opts, &g_bdev_opts, sizeof(bdev_opts)) == 0);
	}

	g_init_cb_fn = cb_fn;
	g_init_cb_arg = cb_arg;

+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ DEFINE_STUB(spdk_conf_find_section, struct spdk_conf_section *, (struct spdk_con
		const char *name), NULL);
DEFINE_STUB(spdk_conf_section_get_nmval, char *,
	    (struct spdk_conf_section *sp, const char *key, int idx1, int idx2), NULL);
DEFINE_STUB(spdk_conf_section_get_intval, int, (struct spdk_conf_section *sp, const char *key), -1);

static void
_bdev_send_msg(spdk_thread_fn fn, void *ctx, void *thread_ctx)
Loading