Commit 48b2ac7a authored by Ziye Yang's avatar Ziye Yang Committed by Tomasz Zawadzki
Browse files

sock/posix: fix the zero copy enabling in initiator.



When zero copy is enabled in initiator, there could
be the case that a socket connection does not belong
to a polling group, i.e, the application does not use
socket polling  group. Then we should actively call
_sock_check_zcopy in posix_sock_flush function when zero
copy policy is enabled.

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: Idceaa7557eb265daa878db40c922494c3de35ea8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5423


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
parent b1687cd4
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -842,9 +842,17 @@ _sock_flush(struct spdk_sock *sock)
}

static int
posix_sock_flush(struct spdk_sock *_sock)
posix_sock_flush(struct spdk_sock *sock)
{
	return _sock_flush(_sock);
#ifdef SPDK_ZEROCOPY
	struct spdk_posix_sock *psock = __posix_sock(sock);

	if (psock->zcopy && !TAILQ_EMPTY(&sock->pending_reqs)) {
		_sock_check_zcopy(sock);
	}
#endif

	return _sock_flush(sock);
}

static ssize_t