Commit 8eef5183 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

bdev: remove spdk_bdev_poller_start() lcore option



Always start bdev pollers on the calling core.

This removes the lcore concept from the bdev poller abstraction and
simplifies the job of spdk_bdev_initialize() callers providing their own
poller and event implementations.

All callers except the NVMe bdev hotplug poller already used the current
core as the parameter.  The NVMe HotplugPollCore option was undocumented
and unused in any of the tests or example configuration files, so it
should be safe to remove.

Change-Id: I93b466e1e58901b8785c40cbe296fa46c157850f
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382857


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent ae0f518e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ static void
spdk_fio_start_poller(struct spdk_bdev_poller **ppoller,
		      spdk_bdev_poller_fn fn,
		      void *arg,
		      uint32_t lcore,
		      uint64_t period_microseconds)
{
	struct spdk_fio_thread *fio_thread;
+0 −1
Original line number Diff line number Diff line
@@ -120,7 +120,6 @@ typedef void (*spdk_bdev_poller_fn)(void *arg);
typedef void (*spdk_bdev_poller_start_cb)(struct spdk_bdev_poller **ppoller,
		spdk_bdev_poller_fn fn,
		void *arg,
		uint32_t lcore,
		uint64_t period_microseconds);
typedef void (*spdk_bdev_poller_stop_cb)(struct spdk_bdev_poller **ppoller);

+16 −1
Original line number Diff line number Diff line
@@ -367,12 +367,27 @@ int spdk_bdev_module_claim_bdev(struct spdk_bdev *bdev, struct spdk_bdev_desc *d
				struct spdk_bdev_module_if *module);
void spdk_bdev_module_release_bdev(struct spdk_bdev *bdev);

/**
 * Start a poller on the current thread to periodically call fn.
 *
 * \param[out] ppoller Will be filled with initialized poller pointer.
 * \param fn Function to run periodically.
 * \param arg Argument to be passed to fn.
 * \param period_microseconds Delay between calls of the poller function,
 *                            or 0 to call as frequently as possible.
 *
 * The user must call spdk_bdev_poller_stop() to clean up the resources allocated by this function.
 */
void spdk_bdev_poller_start(struct spdk_bdev_poller **ppoller,
			    spdk_bdev_poller_fn fn,
			    void *arg,
			    uint32_t lcore,
			    uint64_t period_microseconds);

/**
 * Stop a poller started by spdk_bdev_poller_start().
 *
 * \param ppoller Poller to stop.
 */
void spdk_bdev_poller_stop(struct spdk_bdev_poller **ppoller);

/**
+1 −2
Original line number Diff line number Diff line
@@ -312,8 +312,7 @@ bdev_aio_create_cb(void *io_device, void *ctx_buf)
		return -1;
	}

	spdk_bdev_poller_start(&ch->poller, bdev_aio_poll, ch,
			       spdk_env_get_current_core(), 0);
	spdk_bdev_poller_start(&ch->poller, bdev_aio_poll, ch, 0);
	return 0;
}

+1 −2
Original line number Diff line number Diff line
@@ -451,10 +451,9 @@ void
spdk_bdev_poller_start(struct spdk_bdev_poller **ppoller,
		       spdk_bdev_poller_fn fn,
		       void *arg,
		       uint32_t lcore,
		       uint64_t period_microseconds)
{
	g_bdev_mgr.start_poller_fn(ppoller, fn, arg, lcore, period_microseconds);
	g_bdev_mgr.start_poller_fn(ppoller, fn, arg, period_microseconds);
}

void
Loading