From owner-freebsd-stable@freebsd.org Fri Oct 14 09:00:40 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED26DC112F5; Fri, 14 Oct 2016 09:00:40 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ACFEF82; Fri, 14 Oct 2016 09:00:40 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id u9E90aqQ076254; Fri, 14 Oct 2016 11:00:37 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net [IPv6:2001:a60:f0bb:1::3:1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id A3008E9B; Fri, 14 Oct 2016 11:00:36 +0200 (CEST) Message-ID: <58009EB4.30708@omnilan.de> Date: Fri, 14 Oct 2016 11:00:36 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: FreeBSD Net , FreeBSD Stable Subject: vale-ctl(-8), ifconfig(8), SIOCAIFADDR: Invalid argument [utilizing netmap(4) providing virtual switches+interfaces to BHyVe] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Fri, 14 Oct 2016 11:00:37 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 09:00:41 -0000 Dear all, I found great papers about netmap(4)s desigen and implementation details, and I'm sure it's one other masterpeace of rizzo-quality :-) Thanks to all participants for that great code! To be honest, I haven't read all of that, because I'm short in time and my first mission is to see if FreeBSD 11 will replace some of my ESXi machines. One key element seems netmap(4). It's quiet hard to find userland documentation. So far, I've discovered that there are three essential tools waiting in _usr/src/tools/tools/netmap_ to be compiled (resulting in *./vale-ctl*, *./bridge*, *./pkt-gen*) While the latter is often referenced in netmap(4) documentation, it's not of interest for me, because I'll be doing real-world performance tests and I'm convinced that all the impressive numbers presented in the netmap documentation are valid :-) So *vale-ctl(-8)* seems to be of interest (I'm using (-8) becaus currently there is no man8 part (I guess that's the reason for these tools not beeing integrated into base binaries)) Accidentally I found out that 'vale-ctl -n testif0' creates a artificial interface, which is reported by ifconfig(8): testif0: flags=8801 metric 0 mtu 1500 options=80000 ether 00:be:eb:8d:f8:00 nd6 options=21 But I can't assign a IP address: 'ifconfig testif0 203.0.113.1/24' ifconfig: ioctl (SIOCAIFADDR): Invalid argument I guess couldn't geti the picture of the netmap(4) world yet. Probably, testif0 is available only in netmap(4) world, not in "host world". I'm assuming, because I found vale-ctl(-8)s "-h" switch. So another very little peace I'm aware of the netmap(4) world, is how to attach physical interfaces to virtual switches: '/usr/src/tools/tools/netmap/vale-ctl -a vale0:em1' Now vale-ctl(-8) shows: bdg_ctl [149] bridge:0 port:0 vale0:em1 /* To share my experience: One cannot use any other than vale[[:digit:]] for defining the on-demand to be created virtual switch instance, so e.g. "vale-ctl -a vale-test:em1" doesn't work, although found in netmap(4) man page in FreeBSD-11: »valeXXX:YYY (arbitrary XXX and YYY) the file descriptor is bound to port YYY of a VALE switch called XXX, both dynamically created if necessary. The string cannot exceed IFNAMSIZ characters, and YYY cannot be the name of any existing OS network interface« I was about to give up on netmap(4) investigations because I thought it isn't production ready yet (in FreeBSD), since even andding the first physical interface fails: '/usr/src/tools/tools/netmap/vale-ctl -a vale-test:em1' vale-test:em1: Invalid argument Probably accidentally I used vale[[:digit:]] instead and wondered whay it suddenly works… To get back to vale-ctl(-8)s "-h" switch: */ If I add a physical interface with -h instead of -a, the host's IP stack doesn't get disconnected from the interface, so it's still usable by host applications and vale-ctl(-8) lists one line more: bdg_ctl [149] bridge:0 port:0 vale0:em1 bdg_ctl [149] bridge:0 port:1 vale0:em1^ So my assumption that netmap(4) lives decapsuled from the well known FreeBSD IP world. Now my question: How can I plug a jail's or vmm's artificial interface to a VALE virtual switch, bridging frames to real-world via physical interfaces? (the latter part should work with vale-ctl -h vale0:em1, but what interface to use for jail(8) vnet.interface and how to create/attach?) Thanks, -harry