Commit 3759b870 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

env_dpdk/pci: remove driver->is_registered



Now that we support only DPDK 18.11+ and always have
to register pci drivers to DPDK on initialization we
don't need that flag - it's always true.

Change-Id: Ibf1d79155595609fe9093f58e056bea25db6fdb2
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3446


Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 45528bfe
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ struct spdk_pci_driver {
	struct rte_pci_driver		driver;
	spdk_pci_enum_cb		cb_fn;
	void				*cb_arg;
	bool				is_registered;
	TAILQ_ENTRY(spdk_pci_driver)	tailq;
};

+0 −25
Original line number Diff line number Diff line
@@ -244,22 +244,7 @@ pci_env_init(void)
{
	struct spdk_pci_driver *driver;

	/* We need to pre-register pci drivers for the pci devices to be
	 * attachable in multi-process with DPDK 18.11+.
	 *
	 * DPDK 18.11+ does its best to ensure all devices are equally
	 * attached or detached in all processes within a shared memory group.
	 * For SPDK it means that if a device is hotplugged in the primary,
	 * then DPDK will automatically send an IPC hotplug request to all other
	 * processes. Those other processes may not have the same SPDK PCI
	 * driver registered and may fail to attach the device. DPDK will send
	 * back the failure status, and the the primary process will also fail
	 * to hotplug the device. To prevent that, we need to pre-register the
	 * pci drivers here.
	 */
	TAILQ_FOREACH(driver, &g_pci_drivers, tailq) {
		assert(!driver->is_registered);
		driver->is_registered = true;
		rte_pci_register(&driver->driver);
	}

@@ -497,11 +482,6 @@ spdk_pci_device_attach(struct spdk_pci_driver *driver,
		return rc;
	}

	if (!driver->is_registered) {
		driver->is_registered = true;
		rte_pci_register(&driver->driver);
	}

	driver->cb_fn = enum_cb;
	driver->cb_arg = enum_ctx;

@@ -579,11 +559,6 @@ spdk_pci_enumerate(struct spdk_pci_driver *driver,
	}
	pthread_mutex_unlock(&g_pci_mutex);

	if (!driver->is_registered) {
		driver->is_registered = true;
		rte_pci_register(&driver->driver);
	}

	if (scan_pci_bus(true) != 0) {
		return -1;
	}
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ static struct spdk_pci_driver g_idxd_pci_drv = {

	.cb_fn = NULL,
	.cb_arg = NULL,
	.is_registered = false,
};

struct spdk_pci_driver *
+0 −1
Original line number Diff line number Diff line
@@ -100,7 +100,6 @@ static struct spdk_pci_driver g_ioat_pci_drv = {

	.cb_fn = NULL,
	.cb_arg = NULL,
	.is_registered = false,
};

struct spdk_pci_driver *
+0 −1
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ static struct spdk_pci_driver g_nvme_pci_drv = {

	.cb_fn = NULL,
	.cb_arg = NULL,
	.is_registered = false,
};

struct spdk_pci_driver *
Loading