Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: mtk.manpages@gmail.com, Jorgen Hansen <jhansen@vmware.com>,
	netdev@vger.kernel.org, linux-man@vger.kernel.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Dexuan Cui <decui@microsoft.com>
Subject: Re: [PATCH v4] vsock.7: add VMADDR_CID_LOCAL description
Date: Sat, 14 Mar 2020 23:02:19 +0100
Message-ID: <b3289245-ba42-24d4-b96c-267d09b2e37a@gmail.com> (raw)
In-Reply-To: <20200218155435.172860-1-sgarzare@redhat.com>

Hello Stefano,

On 2/18/20 4:54 PM, Stefano Garzarella wrote:
> Linux 5.6 added the new well-known VMADDR_CID_LOCAL for
> local communication.
> 
> This patch explains how to use it and remove the legacy
> VMADDR_CID_RESERVED no longer available.
> 
> Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
> ---
> v4:
>     * removed "The" in the "Local communication" section [Stefan]
> v3:
>     * rephrased "Previous versions" part [Jorgen]
> v2:
>     * rephrased "Local communication" description [Stefan]
>     * added a mention of previous versions that supported
>       loopback only in the guest [Stefan]

Thanks. Patch applied.

Cheers,

Michael


> ---
>  man7/vsock.7 | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/man7/vsock.7 b/man7/vsock.7
> index c5ffcf07d..fa2c6e17e 100644
> --- a/man7/vsock.7
> +++ b/man7/vsock.7
> @@ -127,8 +127,8 @@ There are several special addresses:
>  means any address for binding;
>  .B VMADDR_CID_HYPERVISOR
>  (0) is reserved for services built into the hypervisor;
> -.B VMADDR_CID_RESERVED
> -(1) must not be used;
> +.B VMADDR_CID_LOCAL
> +(1) is the well-known address for local communication (loopback);
>  .B VMADDR_CID_HOST
>  (2)
>  is the well-known address of the host.
> @@ -164,6 +164,15 @@ Consider using
>  .B VMADDR_CID_ANY
>  when binding instead of getting the local CID with
>  .BR IOCTL_VM_SOCKETS_GET_LOCAL_CID .
> +.SS Local communication
> +.B VMADDR_CID_LOCAL
> +(1) directs packets to the same host that generated them. This is useful
> +for testing applications on a single host and for debugging.
> +.PP
> +The local CID obtained with
> +.BR IOCTL_VM_SOCKETS_GET_LOCAL_CID
> +can be used for the same purpose, but it is preferable to use
> +.B VMADDR_CID_LOCAL .
>  .SH ERRORS
>  .TP
>  .B EACCES
> @@ -222,6 +231,11 @@ are valid.
>  Support for VMware (VMCI) has been available since Linux 3.9.
>  KVM (virtio) is supported since Linux 4.8.
>  Hyper-V is supported since Linux 4.14.
> +.PP
> +VMADDR_CID_LOCAL is supported since Linux 5.6.
> +Local communication in the guest and on the host is available since Linux 5.6.
> +Previous versions only supported local communication within a guest
> +(not on the host), and only with some transports (VMCI and virtio).
>  .SH SEE ALSO
>  .BR bind (2),
>  .BR connect (2),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 15:54 Stefano Garzarella
2020-02-19 11:21 ` Stefan Hajnoczi
2020-03-14 22:02 ` Michael Kerrisk (man-pages) [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=b3289245-ba42-24d4-b96c-267d09b2e37a@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=decui@microsoft.com \
    --cc=jhansen@vmware.com \
    --cc=linux-man@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@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

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git