demystify vport(4) in vport(4) and ifconfigt(8)

2021-10-26 Thread Solene Rapenne
I tried to figure out how to use veb interfaces but the man page
wasn't obvious in regards to the "vport" thing. It turns out it's
a kind of interface that can be created with ifconfig.

I think we should make this clearer.

Because ifconfig(8) mentions many type of interfaces I've searched
for "vport" without success while "most" types are referenced in
the man page. Like I added veb(4) recently, the diff adds vport(4)
and missing mpip(4) so a search would give a clue it's related to
ifconfig.

in veb(4), I think we should add vport in the synposis because the
man page is shared for veb and vport interfaces but at first look
it seems only veb is a type of interface.

And finally, I added a mention that vport can be created with
ifconfig(8) so it's really obvious. Maybe it's too much and can be
removed.

comments? ok?

Index: share/man/man4//veb.4
===
RCS file: /home/reposync/src/share/man/man4/veb.4,v
retrieving revision 1.2
diff -u -p -r1.2 veb.4
--- share/man/man4//veb.4   23 Feb 2021 11:43:41 -  1.2
+++ share/man/man4//veb.4   26 Oct 2021 19:10:17 -
@@ -23,6 +23,7 @@
 .Nd Virtual Ethernet Bridge network device
 .Sh SYNOPSIS
 .Cd "pseudo-device veb"
+.Cd "pseudo-device vport"
 .Sh DESCRIPTION
 The
 .Nm veb
@@ -37,7 +38,9 @@ by
 .Nm veb
 by creating a
 .Nm vport
-interface and attaching it as a port to the bridge.
+interface using
+.Xr ifconfig 8
+and attaching it as a port to the bridge.
 From the perspective of the host network stack, a
 .Nm vport
 interface acts as a normal interface connected to an Ethernet
Index: sbin/ifconfig//ifconfig.8
===
RCS file: /home/reposync/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.375
diff -u -p -r1.375 ifconfig.8
--- sbin/ifconfig//ifconfig.8   18 Aug 2021 18:10:33 -  1.375
+++ sbin/ifconfig//ifconfig.8   26 Oct 2021 19:13:27 -
@@ -192,6 +192,7 @@ At least the following devices can be cr
 .Xr lo 4 ,
 .Xr mgre 4 ,
 .Xr mpe 4 ,
+.Xr mpip 4 ,
 .Xr mpw 4 ,
 .Xr nvgre 4 ,
 .Xr pair 4 ,
@@ -209,6 +210,7 @@ At least the following devices can be cr
 .Xr veb 4 ,
 .Xr vether 4 ,
 .Xr vlan 4 ,
+.Xr vport 4 ,
 .Xr vxlan 4 ,
 .Xr wg 4
 .It Cm debug



Re: demystify vport(4) in vport(4) and ifconfigt(8)

2021-10-26 Thread David Gwynne
On Tue, Oct 26, 2021 at 09:18:30PM +0200, Solene Rapenne wrote:
> I tried to figure out how to use veb interfaces but the man page
> wasn't obvious in regards to the "vport" thing. It turns out it's
> a kind of interface that can be created with ifconfig.
> 
> I think we should make this clearer.

agreed. the man page for veb/vport is definitely not... rigorous.

> Because ifconfig(8) mentions many type of interfaces I've searched
> for "vport" without success while "most" types are referenced in
> the man page. Like I added veb(4) recently, the diff adds vport(4)
> and missing mpip(4) so a search would give a clue it's related to
> ifconfig.

I'm ok with the ifconfig chunk.

> in veb(4), I think we should add vport in the synposis because the
> man page is shared for veb and vport interfaces but at first look
> it seems only veb is a type of interface.

The synopsis shows what you put into a kernel config file (eg 
src/sys/conf/GENERIC) to enable the driver, but "pseudo-device
vport" is not valid kernel config. You enable the veb driver and that
one driver provides both veb and vport interfaces. Another example of
this is the gre driver which provides gre, egre, mgre, nvgre, and eoip
interfaces.

> And finally, I added a mention that vport can be created with
> ifconfig(8) so it's really obvious. Maybe it's too much and can be
> removed.

It should definitely be said. The other man pages for clonable
interfaces generally have a paragraph like this:

.Nm gre ,
.Nm mgre ,
.Nm egre ,
and
.Nm nvgre
interfaces can be created at runtime using the
.Ic ifconfig iface Ns Ar N Ic create
command or by setting up a
.Xr hostname.if 5
configuration file for
.Xr netstart 8 .

I just noticed vether.4 is also missing a paragraph like that too :(

> comments? ok?

Apart from it not being obvious where vport interfaces come from, is
there anything else not obvious about veb?

> Index: share/man/man4//veb.4
> ===
> RCS file: /home/reposync/src/share/man/man4/veb.4,v
> retrieving revision 1.2
> diff -u -p -r1.2 veb.4
> --- share/man/man4//veb.4 23 Feb 2021 11:43:41 -  1.2
> +++ share/man/man4//veb.4 26 Oct 2021 19:10:17 -
> @@ -23,6 +23,7 @@
>  .Nd Virtual Ethernet Bridge network device
>  .Sh SYNOPSIS
>  .Cd "pseudo-device veb"
> +.Cd "pseudo-device vport"
>  .Sh DESCRIPTION
>  The
>  .Nm veb
> @@ -37,7 +38,9 @@ by
>  .Nm veb
>  by creating a
>  .Nm vport
> -interface and attaching it as a port to the bridge.
> +interface using
> +.Xr ifconfig 8
> +and attaching it as a port to the bridge.
>  From the perspective of the host network stack, a
>  .Nm vport
>  interface acts as a normal interface connected to an Ethernet
> Index: sbin/ifconfig//ifconfig.8
> ===
> RCS file: /home/reposync/src/sbin/ifconfig/ifconfig.8,v
> retrieving revision 1.375
> diff -u -p -r1.375 ifconfig.8
> --- sbin/ifconfig//ifconfig.8 18 Aug 2021 18:10:33 -  1.375
> +++ sbin/ifconfig//ifconfig.8 26 Oct 2021 19:13:27 -
> @@ -192,6 +192,7 @@ At least the following devices can be cr
>  .Xr lo 4 ,
>  .Xr mgre 4 ,
>  .Xr mpe 4 ,
> +.Xr mpip 4 ,
>  .Xr mpw 4 ,
>  .Xr nvgre 4 ,
>  .Xr pair 4 ,
> @@ -209,6 +210,7 @@ At least the following devices can be cr
>  .Xr veb 4 ,
>  .Xr vether 4 ,
>  .Xr vlan 4 ,
> +.Xr vport 4 ,
>  .Xr vxlan 4 ,
>  .Xr wg 4
>  .It Cm debug
> 



Re: demystify vport(4) in vport(4) and ifconfigt(8)

2021-10-26 Thread Sebastian Benoit
Solene Rapenne(sol...@perso.pw) on 2021.10.26 21:18:30 +0200:
> I tried to figure out how to use veb interfaces but the man page
> wasn't obvious in regards to the "vport" thing. It turns out it's
> a kind of interface that can be created with ifconfig.
> 
> I think we should make this clearer.
> 
> Because ifconfig(8) mentions many type of interfaces I've searched
> for "vport" without success while "most" types are referenced in
> the man page. Like I added veb(4) recently, the diff adds vport(4)
> and missing mpip(4) so a search would give a clue it's related to
> ifconfig.
> 
> in veb(4), I think we should add vport in the synposis because the
> man page is shared for veb and vport interfaces but at first look
> it seems only veb is a type of interface.
> 
> And finally, I added a mention that vport can be created with
> ifconfig(8) so it's really obvious. Maybe it's too much and can be
> removed.
> 
> comments? ok?

ok

i think this can be expanded more.

vether(4) has a similar function for bridge(4). Maybe some text of vether(4)
can be adapted and added to veb(4).

/Benno

> Index: share/man/man4//veb.4
> ===
> RCS file: /home/reposync/src/share/man/man4/veb.4,v
> retrieving revision 1.2
> diff -u -p -r1.2 veb.4
> --- share/man/man4//veb.4 23 Feb 2021 11:43:41 -  1.2
> +++ share/man/man4//veb.4 26 Oct 2021 19:10:17 -
> @@ -23,6 +23,7 @@
>  .Nd Virtual Ethernet Bridge network device
>  .Sh SYNOPSIS
>  .Cd "pseudo-device veb"
> +.Cd "pseudo-device vport"
>  .Sh DESCRIPTION
>  The
>  .Nm veb
> @@ -37,7 +38,9 @@ by
>  .Nm veb
>  by creating a
>  .Nm vport
> -interface and attaching it as a port to the bridge.
> +interface using
> +.Xr ifconfig 8
> +and attaching it as a port to the bridge.
>  From the perspective of the host network stack, a
>  .Nm vport
>  interface acts as a normal interface connected to an Ethernet
> Index: sbin/ifconfig//ifconfig.8
> ===
> RCS file: /home/reposync/src/sbin/ifconfig/ifconfig.8,v
> retrieving revision 1.375
> diff -u -p -r1.375 ifconfig.8
> --- sbin/ifconfig//ifconfig.8 18 Aug 2021 18:10:33 -  1.375
> +++ sbin/ifconfig//ifconfig.8 26 Oct 2021 19:13:27 -
> @@ -192,6 +192,7 @@ At least the following devices can be cr
>  .Xr lo 4 ,
>  .Xr mgre 4 ,
>  .Xr mpe 4 ,
> +.Xr mpip 4 ,
>  .Xr mpw 4 ,
>  .Xr nvgre 4 ,
>  .Xr pair 4 ,
> @@ -209,6 +210,7 @@ At least the following devices can be cr
>  .Xr veb 4 ,
>  .Xr vether 4 ,
>  .Xr vlan 4 ,
> +.Xr vport 4 ,
>  .Xr vxlan 4 ,
>  .Xr wg 4
>  .It Cm debug
>