Commit 97f445d7 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

accel/idxd: fix off by one device selection



Selecting device iterated over all devices one too many times.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Icc66e9843af6d51946f6af3679d56b88d5b753c9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21012


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 84dbdf08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ idxd_select_device(struct idxd_io_channel *chan)
				      socket_id, spdk_idxd_get_socket(dev->dsa));
			return dev;
		}
	} while (count++ < g_num_devices);
	} while (++count < g_num_devices);

	/* We are out of available channels and/or devices for the local socket. We fix the number
	 * of channels that we allocate per device and only allocate devices on the same socket
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ idxd_select_device(struct idxd_io_channel *chan)
				      socket_id, spdk_idxd_get_socket(dev->iaa));
			return dev;
		}
	} while (count++ < g_num_devices);
	} while (++count < g_num_devices);

	/* We are out of available channels and/or devices for the local socket. We fix the number
	 * of channels that we allocate per device and only allocate devices on the same socket