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: Jim Harris <james.r.harris@intel.com>
Change-Id: I0fda4229fe150ca17417b227e8587cd7fbda6692
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17631
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Jim Harris 2023-04-18 17:56:59 +00:00
parent aadd13f444
commit e407385e03

View File

@ -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;