nvme/tcp: check for EAGAIN when flushing socket

The bahavior of spdk_sock_flush() was changed in 5433004ec to return the
number of flushed bytes and -1 with errno set to EAGAIN in case nothing
has been flushed (instead of returning 0).  Therefore, we shouldn't
treat EAGAIN as an error in nvme_tcp_qpair_process_completions().

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5473488b5b408cdc739921046f1a0cc2c98f98de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16643
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Konrad Sztyber 2023-01-27 14:21:27 +01:00 committed by Tomasz Zawadzki
parent 25b0c20c0a
commit 739c6d7c5a

View File

@ -1746,7 +1746,7 @@ nvme_tcp_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_c
if (qpair->poll_group == NULL) {
rc = spdk_sock_flush(tqpair->sock);
if (rc < 0) {
if (rc < 0 && errno != EAGAIN) {
SPDK_ERRLOG("Failed to flush tqpair=%p (%d): %s\n", tqpair,
errno, spdk_strerror(errno));
if (spdk_unlikely(tqpair->qpair.ctrlr->timeout_enabled)) {