Commit e407385e authored by Jim Harris's avatar Jim Harris
Browse files

env_dpdk: add ERRLOGs to help debug issue #2983



Issue #2983 shows a case where we seem to get a
device remove notification from DPDK (via vfio
path) after we have already detached the device
explicitly by SPDK.

This issue has proven difficult to reproduce
outside of the one observed failure so far, so
adding a couple of ERRLOGs into this path to help
confirm the this theory should it happen again.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I0fda4229fe150ca17417b227e8587cd7fbda6692
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17631


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent aadd13f4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -233,6 +233,13 @@ pci_device_rte_dev_event(const char *device_name,
		TAILQ_FOREACH(dev, &g_pci_devices, internal.tailq) {
			struct rte_pci_device *rte_dev = dev->dev_handle;

			/* Note: these ERRLOGs are useful for triaging issue #2983. */
			if (dev->internal.pending_removal || dev->internal.removed) {
				SPDK_ERRLOG("Received event for device SPDK already tried to remove\n");
				SPDK_ERRLOG("pending_removal=%d removed=%d\n", dev->internal.pending_removal,
					    dev->internal.removed);
			}

			if (strcmp(dpdk_pci_device_get_name(rte_dev), device_name) == 0 &&
			    !dev->internal.pending_removal) {
				can_detach = !dev->internal.attached;