From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top, Stefano Brivio <sbrivio@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v20 3/5] fixup?: loop on EGAIN in repair queue
Date: Thu, 13 Feb 2025 15:58:11 +1100 [thread overview]
Message-ID: <20250213045813.3767488-4-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20250213045813.3767488-1-david@gibson.dropbear.id.au>
On at least one occassion, I saw the repair queue fail with an EAGAIN.
libsoccr doesn't do this, so I'm not sure whether this is really the right
thing.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
tcp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tcp.c b/tcp.c
index f18b2913..39035e14 100644
--- a/tcp.c
+++ b/tcp.c
@@ -2957,6 +2957,8 @@ static int tcp_flow_repair_queue(int s, size_t len, uint8_t *buf)
ssize_t rc = send(s, p, MIN(len, chunk), 0);
if (rc < 0) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ continue;
if ((errno == ENOBUFS || errno == ENOMEM) &&
chunk >= TCP_MIGRATE_RESTORE_CHUNK_MIN) {
chunk /= 2;
--
@@ -2957,6 +2957,8 @@ static int tcp_flow_repair_queue(int s, size_t len, uint8_t *buf)
ssize_t rc = send(s, p, MIN(len, chunk), 0);
if (rc < 0) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ continue;
if ((errno == ENOBUFS || errno == ENOMEM) &&
chunk >= TCP_MIGRATE_RESTORE_CHUNK_MIN) {
chunk /= 2;
--
2.48.1
next prev parent reply other threads:[~2025-02-13 4:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 4:58 [PATCH v20 0/5] State migration David Gibson
2025-02-13 4:58 ` [PATCH v20 1/5] migrate: Migrate TCP flows David Gibson
2025-02-13 4:58 ` [PATCH v20 2/5] test: Add migration tests David Gibson
2025-02-13 4:58 ` David Gibson [this message]
2025-02-13 4:58 ` [PATCH v20 4/5] depause David Gibson
2025-02-13 4:58 ` [PATCH v20 5/5] fixup: TCP_REPAIR_WINDOW before send unsent David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213045813.3767488-4-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).