public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Laurent Vivier <lvivier@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH] udp: Rename udp_buf_sock_to_tap() and udp_vu_sock_to_tap()
Date: Sat, 13 Dec 2025 02:55:08 +0100	[thread overview]
Message-ID: <20251213025508.231f94ef@elisabeth> (raw)
In-Reply-To: <aTt-SCQqRJPjWNw9@zatzit>

On Fri, 12 Dec 2025 13:30:32 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Thu, Dec 11, 2025 at 03:16:26PM +0100, Laurent Vivier wrote:
> > The function udp_vu_sock_to_tap() sends data to the vhost-user interface,
> > not the tap interface. Rename it to udp_sock_to_vu() to accurately reflect
> > its destination.
> > 
> > The function udp_buf_sock_to_tap() includes a "buf_" prefix that is now
> > redundant. Since the functions can be distinguished by their destination
> > (to_tap vs. to_vu), drop the prefix and rename it to udp_sock_to_tap().
> > 
> > No functional change.
> > 
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>  
> 
> Eh, I mean using "tap" to mean the guest side interface, even if it's
> not based on /dev/net/tap is pretty well established at this point.
> 
> I do think udp_sock_to_vu() is a better name regardless.  I'm a bit
> less convinced on renaming udp_buf_sock_to_tap().  If we're trying to
> abandon the "tap means any guest interface" convention, then
> udp_sock_to_tap() is still inaccurate, since it can also send to a
> qemu socket.  If we're not trying to abandon that convention then it
> suggests that the function does any forwarding to the guest, not just
> the non-vu case.

Assuming we're not trying to abandon that convention: why can't "tap"
be "anything that's not vhost-user"? We could document that at the top
of tap.c and it would still be clearer than the current situation.

It would be still somewhat confusing that a big part of the code in
tap.c is also relevant for vhost-user, but in a number of places,
there, we call the vhost-user specific implementation and return early.

I got to dislike "buf" over timing because it's more typing and doesn't
mean much other than "non-vhost-user" (vhost-user uses buffers too).
Maybe we could live happier by letting "tap" be that magic word?

-- 
Stefano


  reply	other threads:[~2025-12-13  1:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 14:16 Laurent Vivier
2025-12-12  2:30 ` David Gibson
2025-12-13  1:55   ` Stefano Brivio [this message]
2025-12-15  2:05     ` 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=20251213025508.231f94ef@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@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.
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).