Commit 71828666 authored by Maciej Szulik's avatar Maciej Szulik Committed by Jim Harris
Browse files

sock/uring: fix check_zcopy idx rollover

There was a fix (https://review.spdk.io/c/spdk/spdk/+/17687

) in posix
for idx rollover. It should be applied for uring too.

Signed-off-by: default avatarMaciej Szulik <maciej.szulik@intel.com>
Change-Id: I6a9b4a8fda2af86e3c85b95cfa9bc64cb8a605eb
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/25656


Reviewed-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@nutanix.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
parent c7094274
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1174,7 +1174,8 @@ _sock_check_zcopy(struct spdk_sock *_sock, int status)
	 * we encounter one match we can stop looping as soon as a
	 * non-match is found.
	 */
	for (idx = serr->ee_info; idx <= serr->ee_data; idx++) {
	idx = serr->ee_info;
	while (true) {
		found = false;
		TAILQ_FOREACH_SAFE(req, &_sock->pending_reqs, internal.link, treq) {
			if (!req->internal.is_zcopy) {
@@ -1193,6 +1194,16 @@ _sock_check_zcopy(struct spdk_sock *_sock, int status)
				break;
			}
		}

		if (idx == serr->ee_data) {
			break;
		}

		if (idx == UINT32_MAX) {
			idx = 0;
		} else {
			idx++;
		}
	}

	return 0;