Commit 5411b296 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

env_dpdk: fix device loop when processing remove event



We only want to print the error messages for the device that matches
the event.

Fixes: e407385e ("env_dpdk: add ERRLOGs to help debug issue #2983")

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I3fe8d5c87f22d670da35128b2191ea7c28dca058
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21087


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 70401f58
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -226,6 +226,10 @@ 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;

			if (strcmp(dpdk_pci_device_get_name(rte_dev), device_name)) {
				continue;
			}

			/* 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");
@@ -233,8 +237,7 @@ pci_device_rte_dev_event(const char *device_name,
					    dev->internal.removed);
			}

			if (strcmp(dpdk_pci_device_get_name(rte_dev), device_name) == 0 &&
			    !dev->internal.pending_removal) {
			if (!dev->internal.pending_removal) {
				can_detach = !dev->internal.attached;
				/* prevent any further attaches */
				dev->internal.pending_removal = true;