Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] vsock.7: add VMADDR_CID_LOCAL description
@ 2020-02-11 10:25 Stefano Garzarella
  2020-02-13  9:17 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Garzarella @ 2020-02-11 10:25 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Stefan Hajnoczi, netdev, linux-man, Dexuan Cui, Jorgen Hansen

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.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
 man7/vsock.7 | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/man7/vsock.7 b/man7/vsock.7
index c5ffcf07d..d7dc37dcc 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,16 @@ 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
+The
+.B VMADDR_CID_LOCAL
+(1) can be used to address itself. In this case all packets are redirected
+to the same host that generated them. Useful for testing and 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 +232,8 @@ 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.
 .SH SEE ALSO
 .BR bind (2),
 .BR connect (2),
-- 
2.24.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vsock.7: add VMADDR_CID_LOCAL description
  2020-02-11 10:25 [PATCH] vsock.7: add VMADDR_CID_LOCAL description Stefano Garzarella
@ 2020-02-13  9:17 ` Stefan Hajnoczi
  2020-02-13  9:44   ` Stefano Garzarella
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2020-02-13  9:17 UTC (permalink / raw)
  To: Stefano Garzarella
  Cc: mtk.manpages, netdev, linux-man, Dexuan Cui, Jorgen Hansen

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

On Tue, Feb 11, 2020 at 11:25:32AM +0100, Stefano Garzarella wrote:

Do you want to mention that loopback works in the guest and on the host
since Linux vX.Y and before that it only worked inside the guest?

> @@ -164,6 +164,16 @@ 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
> +The
> +.B VMADDR_CID_LOCAL
> +(1) can be used to address itself. In this case all packets are redirected
> +to the same host that generated them. Useful for testing and debugging.

This can be rephrased more naturally:

.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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vsock.7: add VMADDR_CID_LOCAL description
  2020-02-13  9:17 ` Stefan Hajnoczi
@ 2020-02-13  9:44   ` Stefano Garzarella
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Garzarella @ 2020-02-13  9:44 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: mtk.manpages, netdev, linux-man, Dexuan Cui, Jorgen Hansen

On Thu, Feb 13, 2020 at 09:17:48AM +0000, Stefan Hajnoczi wrote:
> On Tue, Feb 11, 2020 at 11:25:32AM +0100, Stefano Garzarella wrote:
> 
> Do you want to mention that loopback works in the guest and on the host
> since Linux vX.Y and before that it only worked inside the guest?

I didn't mention it, because it was only supported by some transports
(vmci, virtio), but it makes sense to say it, I'll add.

> 
> > @@ -164,6 +164,16 @@ 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
> > +The
> > +.B VMADDR_CID_LOCAL
> > +(1) can be used to address itself. In this case all packets are redirected
> > +to the same host that generated them. Useful for testing and debugging.
> 
> This can be rephrased more naturally:
> 
> .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.

Sure, it is better, I'll fix.

Thanks,
Stefano


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 10:25 [PATCH] vsock.7: add VMADDR_CID_LOCAL description Stefano Garzarella
2020-02-13  9:17 ` Stefan Hajnoczi
2020-02-13  9:44   ` Stefano Garzarella

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