From 83b1102f7b0ffe8b0356157614507135a66f6c86 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Mon, 15 Oct 2018 06:37:44 +0200 Subject: [PATCH] env/pci: do the sleep-after-reset workaround only in primary process All PCI device management is done only by the primary process, so there's no need to delay device initialization in secondary processes. If device is being initialized in a secondary process, then it must have been already initialized by the primary. Change-Id: I087da77f981018dabf3feed59c76b294a16ca88d Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/429413 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/env_dpdk/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/env_dpdk/pci.c b/lib/env_dpdk/pci.c index 2fbf3a292..668d0932a 100644 --- a/lib/env_dpdk/pci.c +++ b/lib/env_dpdk/pci.c @@ -59,7 +59,7 @@ spdk_pci_device_init(struct rte_pci_driver *driver, return 1; } - if (device->kdrv == RTE_KDRV_VFIO) { + if (device->kdrv == RTE_KDRV_VFIO && spdk_process_is_primary()) { /* * TODO: This is a workaround for an issue where the device is not ready after VFIO reset. * Figure out what is actually going wrong and remove this sleep.