public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Nikolay Edigaryev <edigaryev@gmail.com>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH] passt: introduce --fd-is-tap to allow passing TAP file descriptor
Date: Mon, 18 Sep 2023 17:44:10 +0400	[thread overview]
Message-ID: <CAFX5hXQT-Sow-VEXk4YsRUi_Ji62KukENaLG6uC3icetD7P54A@mail.gmail.com> (raw)
In-Reply-To: <20230916143241.2a7b6c77@elisabeth>

Stefano, David, thanks for the input!

I've submitted a new patch completely replacing the previous one
(because I forgot to add --signoff), but only changes the command-line
arguments part as suggested.

The rest is kept the same because I'm not sure if introducing more
than one FD in the passt's context will make sense at this time.

On Sat, Sep 16, 2023 at 4:34 PM Stefano Brivio <sbrivio@redhat.com> wrote:
>
> Hi Nikolay,
>
> On Fri, 15 Sep 2023 18:21:52 +0400
> Nikolay Edigaryev <edigaryev@gmail.com> wrote:
>
> > Problem: I have a Cloud Hypervisor virtual machine that needs both
> > (1) an internet access without fiddling with iptables/Netfilter and
> > (2) VM <-> host access (to be able to provision this VM over SSH)
> > without dealing with passt port forwarding it doesn't seem to be
> > possible to map the whole IP address, yet the users expect an IP
> > instead of IP:port combination.
> >
> > Requirement #1 is why I've choosen passt and it's pretty much
> > satisfied (thank you for this great piece of software!).
>
> And thanks for the patches! I'm glad to hear it's useful for you (and
> with Cloud Hypervisor :)).
>
> Two comments:
>
> > Requirement #2 implies some kind of bridge interface on the host
> > with one TAP interface for the VM and the other for the passt.
> >
> > However, only pasta can accept TAP interface FD's in it's -F/--fd,
> > which is OK, but it also configures unneeded namespacing, which in
> > turn results in unneeded complexity and performance overhead due
> > to the need of involving veth pairs to break away from the pasta
> > namespace to the host for the requirement #2 to be satisfied.
> >
> > I've also considered proxying the UNIX domain socket communication
> > to/from a TAP interface in my own Golang code, but it incurs
> > significant performance overhead.
> >
> > On the other hand passt seems to already can do everything I need,
> > it just needs some guidance on which type of FD it's dealing with.
> >
> > Solution: introduce --fd-is-tap command-line flag to tell passt
> > which type of FD it's being passed to and force it to use appropriate
> > system calls and offset calculation.
>
> Did you consider adding another parameter altogether, such as --tap-fd?
>
> I'm asking because we recently got a request to add another (similar)
> interface on that "side", that is, a VSOCK file descriptor, for usage
> with podman-machine. At that point, a further --fd-is-vsock would look
> a bit awkward.
>
> Further, David Gibson is working on a generalised flow table approach
> which *should* also allow us to have multiple "taps"... and at that
> point, somebody might want to pass multiple "--tap-fd" or -F options.
>
> I didn't really evaluate if there are drawbacks to that, though --
> maybe it's a lot more code.
>
> > This patch also clarifies the -F/--fd description for pasta to note
> > that we're expecting a TAP device and not a UNIX domain socket.
>
> You should add a Signed-off-by tag here (but in general I can fix up
> tags myself on merge). Other than that, the patch looks good to me in a
> general sense.
>
> --
> Stefano
>

      parent reply	other threads:[~2023-09-18 13:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 14:21 [PATCH] passt: introduce --fd-is-tap to allow passing TAP file descriptor Nikolay Edigaryev
2023-09-16 12:34 ` Stefano Brivio
2023-09-18  2:23   ` David Gibson
2023-09-18 13:37   ` [PATCH] passt: introduce --tap-fd " Nikolay Edigaryev
2023-09-19  0:45     ` David Gibson
2023-09-18 13:44   ` Nikolay Edigaryev [this message]

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=CAFX5hXQT-Sow-VEXk4YsRUi_Ji62KukENaLG6uC3icetD7P54A@mail.gmail.com \
    --to=edigaryev@gmail.com \
    --cc=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).