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: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3446 Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
45528bfef6
commit
3759b87082
@ -69,7 +69,6 @@ struct spdk_pci_driver {
|
|||||||
struct rte_pci_driver driver;
|
struct rte_pci_driver driver;
|
||||||
spdk_pci_enum_cb cb_fn;
|
spdk_pci_enum_cb cb_fn;
|
||||||
void *cb_arg;
|
void *cb_arg;
|
||||||
bool is_registered;
|
|
||||||
TAILQ_ENTRY(spdk_pci_driver) tailq;
|
TAILQ_ENTRY(spdk_pci_driver) tailq;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -244,22 +244,7 @@ pci_env_init(void)
|
|||||||
{
|
{
|
||||||
struct spdk_pci_driver *driver;
|
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) {
|
TAILQ_FOREACH(driver, &g_pci_drivers, tailq) {
|
||||||
assert(!driver->is_registered);
|
|
||||||
driver->is_registered = true;
|
|
||||||
rte_pci_register(&driver->driver);
|
rte_pci_register(&driver->driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,11 +482,6 @@ spdk_pci_device_attach(struct spdk_pci_driver *driver,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!driver->is_registered) {
|
|
||||||
driver->is_registered = true;
|
|
||||||
rte_pci_register(&driver->driver);
|
|
||||||
}
|
|
||||||
|
|
||||||
driver->cb_fn = enum_cb;
|
driver->cb_fn = enum_cb;
|
||||||
driver->cb_arg = enum_ctx;
|
driver->cb_arg = enum_ctx;
|
||||||
|
|
||||||
@ -579,11 +559,6 @@ spdk_pci_enumerate(struct spdk_pci_driver *driver,
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&g_pci_mutex);
|
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) {
|
if (scan_pci_bus(true) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,6 @@ static struct spdk_pci_driver g_idxd_pci_drv = {
|
|||||||
|
|
||||||
.cb_fn = NULL,
|
.cb_fn = NULL,
|
||||||
.cb_arg = NULL,
|
.cb_arg = NULL,
|
||||||
.is_registered = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_pci_driver *
|
struct spdk_pci_driver *
|
||||||
|
@ -100,7 +100,6 @@ static struct spdk_pci_driver g_ioat_pci_drv = {
|
|||||||
|
|
||||||
.cb_fn = NULL,
|
.cb_fn = NULL,
|
||||||
.cb_arg = NULL,
|
.cb_arg = NULL,
|
||||||
.is_registered = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_pci_driver *
|
struct spdk_pci_driver *
|
||||||
|
@ -59,7 +59,6 @@ static struct spdk_pci_driver g_nvme_pci_drv = {
|
|||||||
|
|
||||||
.cb_fn = NULL,
|
.cb_fn = NULL,
|
||||||
.cb_arg = NULL,
|
.cb_arg = NULL,
|
||||||
.is_registered = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_pci_driver *
|
struct spdk_pci_driver *
|
||||||
|
@ -56,7 +56,6 @@ static struct spdk_pci_driver g_virtio_pci_drv = {
|
|||||||
|
|
||||||
.cb_fn = NULL,
|
.cb_fn = NULL,
|
||||||
.cb_arg = NULL,
|
.cb_arg = NULL,
|
||||||
.is_registered = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_pci_driver *
|
struct spdk_pci_driver *
|
||||||
|
@ -53,7 +53,6 @@ static struct spdk_pci_driver g_vmd_pci_drv = {
|
|||||||
|
|
||||||
.cb_fn = NULL,
|
.cb_fn = NULL,
|
||||||
.cb_arg = NULL,
|
.cb_arg = NULL,
|
||||||
.is_registered = false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_pci_driver *
|
struct spdk_pci_driver *
|
||||||
|
4
test/env/pci/pci_ut.c
vendored
4
test/env/pci/pci_ut.c
vendored
@ -59,9 +59,7 @@ pci_claim_test(struct spdk_pci_device *dev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spdk_pci_driver ut_pci_driver = {
|
static struct spdk_pci_driver ut_pci_driver;
|
||||||
.is_registered = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ut_pci_dev {
|
struct ut_pci_dev {
|
||||||
struct spdk_pci_device pci;
|
struct spdk_pci_device pci;
|
||||||
|
Loading…
Reference in New Issue
Block a user