Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2017 18:51:49 +0100
From:      Vincenzo Maffione <v.maffione@gmail.com>
To:        Harry Schmalzbauer <freebsd@omnilan.de>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Are ./valte-ctl and ./bridge friends or competitors?
Message-ID:  <CA%2B_eA9jYxRoi2HPcVjKbifTM43nnHeMQGDmmQvsw5UdXtLmFug@mail.gmail.com>
In-Reply-To: <58CBBF7A.8050604@omnilan.de>
References:  <58CBA727.3040108@omnilan.de> <58CBBF7A.8050604@omnilan.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

  ./bridge is a netmap application that implements a simple forwarder
between two netmap ports (given as input arguments). I don't see any way to
use that to let two bhyve VMs work together. It's an example application
that shows you how fast a netmap application can be in forwarding packets
between two NICs, when there is no "business logic".

./vale-ctl is a control tool to attach network interfaces to a VALE L2
switch. If the switch does not exists yet, it is created. So vale-ctl is
not a netmap application. Then, the bhyve VM typically attaches to the VALE
switch using a vale port, e.g. "vale0:guest1" in your example. The VALE
port has the same role as the tap(4) in the traditional if_bridge-based way
to connect VMs.
When using your physical NICs with netmap, you need to disable the
offloadings because netmap is not able to program the NIC to perform these
offloadings. This is a design decision that has been taken to preserve
simplicity and efficiency.
The promiscuous mode is necessary to accept the ethernet frames with MACs
corresponding to the VM virtual interfaces (virtio-net a.k.a. vtnet).

Actually, there is pending work on bhyve and netmap, that is going to be
merged soon, available at https://github.com/vmaffione/freebsd/ in branch
ptnet-head.

If you are interested, here there is some information
https://wiki.freebsd.org/DevSummit/201609?action=3DAttachFile&do=3Dview&tar=
get=3D20160923-freebsd-summit-ptnet.pdf
together with bhyve cmdlines.

Cheers,
  Vincenzo

2017-03-17 11:50 GMT+01:00 Harry Schmalzbauer <freebsd@omnilan.de>:

>  Bez=C3=BCglich Harry Schmalzbauer's Nachricht vom 17.03.2017 10:06 (loca=
ltime):
> >  Hello,
> >
> > I'm still having problems understanding netmap(4) and would highly
> > appreciate brief help.
> >
> > I'm running stable/11.  I'd like to replace if_bridge(4) with netmap(4)=
,
> > because virtio-net chops jumbu frames
> > (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215737) and
> > if_bridge(4) requires members to have the same mtu.
> >
> > I'm creating vmnet0 (tap(4)) and vale0 with an physical (keeping host
> > stack usage) port:
> > ifconfig create vmnet0
> > ./vale-ctl -h vale0:igb0
> > ./vale-ctl -a vale0:vmnet0
> > which results in
> > bdg_ctl [149] bridge:0 port:0 vale0:vlegn
> > bdg_ctl [149] bridge:0 port:1 vale0:vlegn^
> > bdg_ctl [149] bridge:0 port:2 vale0:vmnet0
>
> The above is wrong regarding bhyve(8) usage.
> For the records, and please correct me somone if I'm wrong:
>
> byhve(8) has some kind of native netmap(4) implementation, so one
> mustn't use if_tap(4) (vmnet), but simply a vale name (e.g. 'bhyve =E2=80=
=A6 -s
> 5,virtio-net,vale0:guest1 =E2=80=A6' instead of '=E2=80=A6 -s 5,e1000,vmn=
et0 =E2=80=A6')
>
> The physical interface connected to the vale switch must be put into
> promisc mode!
>
> No idea about the need to disable any offloading functions, since I
> don't know how it's implemented=E2=80=A6
>
> Thanks,
>
> -harry
>
> P.S.: Still don't understand the basic difference between ./bridge and
> ./vale-ctl
>
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



--=20
Vincenzo Maffione



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9jYxRoi2HPcVjKbifTM43nnHeMQGDmmQvsw5UdXtLmFug>