public inbox for passt-user@passt.top
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: "Gianluca Stivan" <me@yawnt.com>
Cc: passt-user@passt.top
Subject: Re: Failed to open tun socket in namespace
Date: Mon, 27 Mar 2023 15:02:32 +0200	[thread overview]
Message-ID: <20230327150232.0cbc1ecc@elisabeth> (raw)
In-Reply-To: <a66da2ba-9b0a-49f4-8ff3-604311d902d2@app.fastmail.com>

On Mon, 27 Mar 2023 13:22:12 +0100
"Gianluca Stivan" <me@yawnt.com> wrote:

> Thanks for the reply!
> 
> Here is the ending of the log file:
> 
> ...
> <a lot a lot of STALLED and dropped...>
> 3944.3562:          TCP: index 19, timer expires in 2.000s
> 3944.3563:          TCP: index 19, timer expires in 2.000s
> 3944.3566:          TCP: index 19: STALLED
> 3944.3578:          TCP: index 7: STALLED dropped
> 3944.3579:          TCP: index 7, timer expires in 2.000s
> 3944.3584:          TCP: index 7: STALLED
> 3944.3586:          TCP: index 7: STALLED dropped
> 3944.3587:          TCP: index 7: ACK_FROM_TAP_DUE dropped
> 3944.3588:          TCP: index 7: ACK_FROM_TAP_DUE
> 3944.3588:          TCP: index 7, timer expires in 2.000s
> 3944.3589:          TCP: index 12: STALLED dropped
> 3944.3590:          TCP: index 12, timer expires in 2.000s
> 3944.3620:          tap write: No buffer space available
> 3944.3620:          TCP: index 17: STALLED dropped
> 3944.3620:          TCP: index 17: ACK_FROM_TAP_DUE dropped
> 3944.4420: ERROR:   Failed to open tun socket in namespace
> 
> No buffer space available seems interesting?

Interesting, I had never seen ENOBUFS from a tap file descriptor. Let me
find out where it might come from (and how pasta should react to it),
it might take a bit. What kernel version are you using by the way?

I mean, maybe we just have to try again (as if we received EAGAIN):

diff --git a/tap.c b/tap.c
index 68ef480..21a786d 100644
--- a/tap.c
+++ b/tap.c
@@ -323,7 +323,8 @@ static size_t tap_send_frames_pasta(struct ctx *c,
                if (write(c->fd_tap, (char *)iov[i].iov_base,
                          iov[i].iov_len) < 0) {
                        debug("tap write: %s", strerror(errno));
-                       if (errno != EAGAIN && errno != EWOULDBLOCK)
+                       if (errno != EAGAIN && errno != EWOULDBLOCK &&
+                           errno != ENOBUFS)
                                tap_handler(c, c->fd_tap, EPOLLERR, NULL);
                        i--;
                }

but I'm not sure it's correct. You could probably try that as a
workaround meanwhile.

> PS: let me know if you'd like the full file!

No no, thank you, that was enough!

About issue number 2. (the fact that we can't actually close and reopen
the tap file descriptor after this failure), I'll check if I can easily
reproduce that in a Podman setting.

-- 
Stefano


  reply	other threads:[~2023-03-27 13:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 12:42 Failed to open tun socket in namespace Gianluca Stivan
2023-03-27  9:47 ` Stefano Brivio
2023-03-27 12:22   ` Gianluca Stivan
2023-03-27 13:02     ` Stefano Brivio [this message]
2023-03-27 13:16       ` Gianluca Stivan

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=20230327150232.0cbc1ecc@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=me@yawnt.com \
    --cc=passt-user@passt.top \
    /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.
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).