From e588603d3e3973817ac1c8d2f7643f424c83004c Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Wed, 15 Sep 2021 09:02:24 +0200 Subject: [PATCH] Revert "sock/posix: fix the socket pipe_has_data or socket_has_data." This reverts commit 2cd948c4a6fb0b26a495dfc861d26f7dfe9bc90d. This commit caused drop in performance tests. More info in issue https://github.com/spdk/spdk/issues/2158 Signed-off-by: Maciej Wawryk Change-Id: Id5d353535323c79e773e33377af388dae47238cb Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9510 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- module/sock/posix/posix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/sock/posix/posix.c b/module/sock/posix/posix.c index 46921f4ff9..ba01f6477f 100644 --- a/module/sock/posix/posix.c +++ b/module/sock/posix/posix.c @@ -883,7 +883,10 @@ posix_sock_read(struct spdk_posix_sock *sock) #endif sock->pipe_has_data = true; - sock->socket_has_data = false; + if (bytes_recvd < bytes_avail) { + /* We drained the kernel socket entirely. */ + sock->socket_has_data = false; + } return bytes_recvd; } @@ -1376,7 +1379,6 @@ posix_sock_group_impl_poll(struct spdk_sock_group_impl *_group, int max_events, if (!psock->socket_has_data && !psock->pipe_has_data) { TAILQ_INSERT_TAIL(&group->socks_with_data, psock, link); } - psock->socket_has_data = true; }