From owner-freebsd-virtualization@FreeBSD.ORG Sun Aug 11 18:16:56 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75A1773 for ; Sun, 11 Aug 2013 18:16:56 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 389022142 for ; Sun, 11 Aug 2013 18:16:55 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id E6572129A1; Mon, 12 Aug 2013 04:16:47 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-67-161-27-37.hsd1.ca.comcast.net [67.161.27.37]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BNX71124 (AUTH peterg@ptree32.com.au); Mon, 12 Aug 2013 04:16:47 +1000 Message-ID: <5207D506.3010408@freebsd.org> Date: Sun, 11 Aug 2013 11:16:38 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Aryeh Friedman Subject: Re: 9.2. + bhyve References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2013 18:16:56 -0000 Hi Aryeh, > What is the status of bhyve in 9.2? bhyve won't be backported to 9-stable. 9.2 does run fine as a guest under CURRENT. later, Peter. From owner-freebsd-virtualization@FreeBSD.ORG Sun Aug 11 18:33:55 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5A449353 for ; Sun, 11 Aug 2013 18:33:55 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38FCA21EE for ; Sun, 11 Aug 2013 18:33:55 +0000 (UTC) Received: by mail-pd0-f179.google.com with SMTP id v10so2536360pde.10 for ; Sun, 11 Aug 2013 11:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=xUNatcyf175O47zBBNZaz1RdteAPv2tFpP8Q32IGKN4=; b=tf8ek49JO2PE0qJ/OUqcV286JWhkKnsG9VCUz85oANpenrGVRg99SXKxoNswIbi2rS Y+oCFBAsxybOOWh2nX69LXha/UTw0UpErvN9cgGn5WnIKpqCTk5YPmsxyXVWUE/NirDs IIbT0Gn6c5vUQhIJCNPQPqp+Yzdg4kFFJ9tc6Fv/HwlofknO4pSqz0WMyJVbb+8Hvrce 8x+ajP+zVezwsxR3oK3BiY77bszkrkPeNKaakF9AJjr1AqsAaP6hVCgOdtGbmgeQFt5E HtFi/BqoWBjdx6+4bg09Q78MMfuVvXl/Xu/NH5Ljak/eUfNfbsw2wCjHW4JyU9pIsbQU nL4g== MIME-Version: 1.0 X-Received: by 10.68.218.132 with SMTP id pg4mr20675691pbc.200.1376246034898; Sun, 11 Aug 2013 11:33:54 -0700 (PDT) Received: by 10.68.51.169 with HTTP; Sun, 11 Aug 2013 11:33:54 -0700 (PDT) Date: Sun, 11 Aug 2013 14:33:54 -0400 Message-ID: Subject: tech questions and development priorities for bhyve From: Aryeh Friedman To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2013 18:33:55 -0000 First the questions: 1. How do I add a second block device as a disk? 2. Same question but for net interfaces? What are the relative priorities of the following bhyve features: 1. Eliminate need for guest OS to have virtio 2. Boots via BIOS and not FreeBSD bootloader 3. Non-virtio pass through (specifically USB) 4. Nested virtualization From owner-freebsd-virtualization@FreeBSD.ORG Sun Aug 11 18:49:25 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BE61044A for ; Sun, 11 Aug 2013 18:49:25 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 80A572260 for ; Sun, 11 Aug 2013 18:49:25 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id C2A2C11C1F; Mon, 12 Aug 2013 04:49:23 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-67-161-27-37.hsd1.ca.comcast.net [67.161.27.37]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BNX71450 (AUTH peterg@ptree32.com.au); Mon, 12 Aug 2013 04:49:22 +1000 Message-ID: <5207DCB0.4030809@freebsd.org> Date: Sun, 11 Aug 2013 11:49:20 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Aryeh Friedman Subject: Re: tech questions and development priorities for bhyve References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2013 18:49:25 -0000 Hi Aryeh, > 1. How do I add a second block device as a disk? You have 32 virtual PCI slots to play around with. Simply add another virtio-block device and back it with a file to represent the block device e.g. -s 2,virtio-blk,/first/filesys/image \ -s 3,virtio-blk,/second/filesys/image \ -s 4,virtio-blk,/third/filesys/image ... etc. (Actually, the virtio block/net can also be assigned to PCI functions with no side-effects, so there are 32*8 available 'slots'. The function syntax uses a colon appended to the slot e.g. "-s 1:0,virtio-blk,/file") > 2. Same question but for net interfaces? Same answer, though there has to be available tap devices created -s 6,virtio-net,tap4 \ -s 7,virtio-net,tap5 ... etc. > What are the relative priorities of the following bhyve features: > > 1. Eliminate need for guest OS to have virtio > 2. Boots via BIOS and not FreeBSD bootloader > 3. Non-virtio pass through (specifically USB) > 4. Nested virtualization Tough call - they are all important. Work is being done on all 4, though at various stages. With non-virtio guest o/s's, there is a current GSoC project for AHCI emulation which should take care of disk, and there is some work being done on Intel NIC emulation. For the BIOS boot, there was a GSoC project last year on this that was almost there for FreeBSD. Booting using UEFI as a BIOS was demo'd at BSDCan, though that is currently for EFI-aware o/s's, and is still in the process of being made available. Not quite sure what you mean by 3 - is that PCI pass-through ? Note there is a GSoC project for USB emulation in bhyve. For nested, I'm looking at it :) later, Peter. From owner-freebsd-virtualization@FreeBSD.ORG Sun Aug 11 20:01:20 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3F0233ED for ; Sun, 11 Aug 2013 20:01:20 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D41B2562 for ; Sun, 11 Aug 2013 20:01:19 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id ea20so4250717lab.27 for ; Sun, 11 Aug 2013 13:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=m95fzA9Mn03JSU4ZpDdV/CTkok6QSysg/FI7CsAPQiM=; b=YUteQ65AMYeg1a/GCXRAPi0rlpObIWpcYB3QA7JyDKPcBga6O7Jm4/MUBa7E67LcyW k0R0G/Pfosbrl8x7M4voHru3du6tv9ao1an5KMlFwApMcWv3kVyPDdJTZpczZDFUD4QA 03mS4qtXfdU30z6eROpCK65cyDFxbUUzraUXGQmS0MYwGV7g3Jd84hmPil4JFnrKQigk mO913mAPMyeUx1JCuEIno68560djChyUxxIwfp7da2MTJwQrqNpz6DUlVi4NaiOXn/PJ 0W0k5yOOhNuxhkHg5hH5OHPiLLjohqZfIQjTtEmV00SvuBuGOlod0AzNlicpo1jH/m1H TdRQ== X-Received: by 10.112.50.72 with SMTP id a8mr8316283lbo.50.1376251277492; Sun, 11 Aug 2013 13:01:17 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id k6sm10549279lae.9.2013.08.11.13.01.15 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 Aug 2013 13:01:16 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 11 Aug 2013 23:01:12 +0300 From: Mikolaj Golub To: freebsd-virtualization@freebsd.org Subject: RFC: ipfw nat VIMAGE improvements Message-ID: <20130811200111.GA49895@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Marko Zec X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2013 20:01:20 -0000 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I would like to commit this patch that fixes some issues related to ipfw nat module load/unload on VIMAGE featured system. Any comments, objections? -- Mikolaj Golub --mP3DRpeJDSE+ciuQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="ip_fw_nat.c.VIMAGE.1.patch" commit 47338ad7fea6d0280461562f0345570557b0d9b1 Author: Mikolaj Golub Date: Sun Aug 4 13:49:50 2013 +0300 Make ipfw nat init/unint work correctly for VIMAGE: * Do per vnet instance cleanup (previously it was only for vnet0 on module unload, and led to libalias leaks and possible panics due to stale pointer dereferences). * When registering/deregistering ipfw hooks lock all vnets, not only vnet0. * Devirtualize ifaddr_event_tag as we run only one event handler for all vnets. * It is supposed that ifaddr_change event handler is called in the interface vnet context, so add the assertion. diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index 84852db..0f34f1d 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ -static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); -#define V_ifaddr_event_tag VNET(ifaddr_event_tag) +static eventhandler_tag ifaddr_event_tag; static void ifaddr_change(void *arg __unused, struct ifnet *ifp) @@ -63,6 +62,8 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp) struct ifaddr *ifa; struct ip_fw_chain *chain; + KASSERT(curvnet == ifp->if_vnet, + ("curvnet(%p) differs from iface vnet(%p)", curvnet, ifp->if_vnet)); chain = &V_layer3_chain; IPFW_WLOCK(chain); /* Check every nat entry... */ @@ -589,20 +590,57 @@ ipfw_nat_get_log(struct sockopt *sopt) return(0); } +static int +vnet_ipfw_nat_init(const void *arg __unused) +{ + + return (0); +} + +static int +vnet_ipfw_nat_uninit(const void *arg __unused) +{ + struct cfg_nat *ptr, *ptr_temp; + struct ip_fw_chain *chain; + + chain = &V_layer3_chain; + IPFW_WLOCK(chain); + LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) { + LIST_REMOVE(ptr, _next); + del_redir_spool_cfg(ptr, &ptr->redir_chain); + LibAliasUninit(ptr->lib); + free(ptr, M_IPFW); + } + flush_nat_ptrs(chain, -1 /* flush all */); + IPFW_WUNLOCK(chain); + return (0); +} + static void ipfw_nat_init(void) { + VNET_ITERATOR_DECL(vnet_iter); - IPFW_WLOCK(&V_layer3_chain); /* init ipfw hooks */ + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + IPFW_WLOCK(&V_layer3_chain); + CURVNET_RESTORE(); + } ipfw_nat_ptr = ipfw_nat; lookup_nat_ptr = lookup_nat; ipfw_nat_cfg_ptr = ipfw_nat_cfg; ipfw_nat_del_ptr = ipfw_nat_del; ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg; ipfw_nat_get_log_ptr = ipfw_nat_get_log; - IPFW_WUNLOCK(&V_layer3_chain); - V_ifaddr_event_tag = EVENTHANDLER_REGISTER( + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + IPFW_WUNLOCK(&V_layer3_chain); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + ifaddr_event_tag = EVENTHANDLER_REGISTER( ifaddr_event, ifaddr_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -610,19 +648,15 @@ ipfw_nat_init(void) static void ipfw_nat_destroy(void) { - struct cfg_nat *ptr, *ptr_temp; - struct ip_fw_chain *chain; - - chain = &V_layer3_chain; - IPFW_WLOCK(chain); - LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) { - LIST_REMOVE(ptr, _next); - del_redir_spool_cfg(ptr, &ptr->redir_chain); - LibAliasUninit(ptr->lib); - free(ptr, M_IPFW); + VNET_ITERATOR_DECL(vnet_iter); + + EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_event_tag); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + IPFW_WLOCK(&V_layer3_chain); + CURVNET_RESTORE(); } - EVENTHANDLER_DEREGISTER(ifaddr_event, V_ifaddr_event_tag); - flush_nat_ptrs(chain, -1 /* flush all */); /* deregister ipfw_nat */ ipfw_nat_ptr = NULL; lookup_nat_ptr = NULL; @@ -630,7 +664,12 @@ ipfw_nat_destroy(void) ipfw_nat_del_ptr = NULL; ipfw_nat_get_cfg_ptr = NULL; ipfw_nat_get_log_ptr = NULL; - IPFW_WUNLOCK(chain); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + IPFW_WUNLOCK(&V_layer3_chain); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); } static int @@ -640,11 +679,9 @@ ipfw_nat_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: - ipfw_nat_init(); break; case MOD_UNLOAD: - ipfw_nat_destroy(); break; default: @@ -660,8 +697,25 @@ static moduledata_t ipfw_nat_mod = { 0 }; -DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +/* Define startup order. */ +#define IPFW_NAT_SI_SUB_FIREWALL SI_SUB_PROTO_IFATTACHDOMAIN +#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 255) +#define IPFW_NAT_MODULE_ORDER (IPFW_NAT_MODEVENT_ORDER + 1) +#define IPFW_NAT_VNET_ORDER (IPFW_NAT_MODEVENT_ORDER + 2) + +DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, IPFW_NAT_SI_SUB_FIREWALL, SI_ORDER_ANY); MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1); MODULE_DEPEND(ipfw_nat, ipfw, 2, 2, 2); MODULE_VERSION(ipfw_nat, 1); + +SYSINIT(ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER, + ipfw_nat_init, NULL); +VNET_SYSINIT(vnet_ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_VNET_ORDER, + vnet_ipfw_nat_init, NULL); + +SYSUNINIT(ipfw_nat_destroy, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER, + ipfw_nat_destroy, NULL); +VNET_SYSUNINIT(vnet_ipfw_nat_uninit, IPFW_NAT_SI_SUB_FIREWALL, + IPFW_NAT_VNET_ORDER, vnet_ipfw_nat_uninit, NULL); + /* end of file */ --mP3DRpeJDSE+ciuQ-- From owner-freebsd-virtualization@FreeBSD.ORG Sun Aug 11 20:08:42 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F0E2859D; Sun, 11 Aug 2013 20:08:41 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C8DB258B; Sun, 11 Aug 2013 20:08:40 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id w10so4317375lbi.35 for ; Sun, 11 Aug 2013 13:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=MMu26IvLN4Qxf89iF8JpfLznnADBBKzyrL386LcsWRo=; b=sVtvpr+Xys0PDZb2QCGuSBd0X4YQDfnfVRvD0BugUNRTAb8vvLAdiAZgoAQmxBsEFh vuoopZx1lo5Rxy3Gi3LHcqH7RiWWo7eqamQbo9rETYnbMqIsGSOMGdTkSV65lM/kaSuo UlPWM30npvL4zkScT7GOIhLBTBRj7Mqp3M6RTcPa3gd6yUYZBhzh9Q8un6nS4DsDfOG+ pOnPZWVU85QWjV2OIgtU8EAenAisSQBKFi7cj1diNH5HEIjuzrDeKWMQN4FG+WlrSbBo EQXIlojkhyC73GsegP1AAOoRZ//V9dR7yL/kwujnhpB2tresEPs78W0/Zvj1/ZsxJLxw uilA== X-Received: by 10.112.57.49 with SMTP id f17mr3037017lbq.26.1376251718953; Sun, 11 Aug 2013 13:08:38 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id f17sm6150406lbo.12.2013.08.11.13.08.37 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 Aug 2013 13:08:38 -0700 (PDT) Sender: Mikolaj Golub Date: Sun, 11 Aug 2013 23:08:35 +0300 From: Mikolaj Golub To: freebsd-virtualization@freebsd.org Subject: RFC: carp(4): improved VIMAGE support Message-ID: <20130811200834.GB49895@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Gleb Smirnoff X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2013 20:08:42 -0000 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I would like to virtualize carp(4) variables to have per vnet control. Any comments, objections? -- Mikolaj Golub --cvVnyQ+4j833TQvp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="ip_carp.c.VIMAGE.1.patch" commit 646e0b161ae7782259335cec652e178652ed7af3 Author: Mikolaj Golub Date: Tue Aug 6 23:47:31 2013 +0300 Virtualize carp(4) variables for per vnet control. diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 9228a8f..2ac39b7 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -187,28 +187,47 @@ static int proto_reg[] = {-1, -1}; * dereferencing our function pointers. */ -static int carp_allow = 1; /* Accept incoming CARP packets. */ -static int carp_preempt = 0; /* Preempt slower nodes. */ -static int carp_log = 1; /* Log level. */ -static int carp_demotion = 0; /* Global advskew demotion. */ -static int carp_senderr_adj = CARP_MAXSKEW; /* Send error demotion factor */ -static int carp_ifdown_adj = CARP_MAXSKEW; /* Iface down demotion factor */ +/* Accept incoming CARP packets. */ +static VNET_DEFINE(int, carp_allow) = 1; +#define V_carp_allow VNET(carp_allow) + +/* Preempt slower nodes. */ +static VNET_DEFINE(int, carp_preempt) = 0; +#define V_carp_preempt VNET(carp_preempt) + +/* Log level. */ +static VNET_DEFINE(int, carp_log) = 1; +#define V_carp_log VNET(carp_log) + +/* Global advskew demotion. */ +static VNET_DEFINE(int, carp_demotion) = 0; +#define V_carp_demotion VNET(carp_demotion) + +/* Send error demotion factor. */ +static VNET_DEFINE(int, carp_senderr_adj) = CARP_MAXSKEW; +#define V_carp_senderr_adj VNET(carp_senderr_adj) + +/* Iface down demotion factor. */ +static VNET_DEFINE(int, carp_ifdown_adj) = CARP_MAXSKEW; +#define V_carp_ifdown_adj VNET(carp_ifdown_adj) + static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_RW, &carp_allow, 0, - "Accept incoming CARP packets"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_RW, &carp_preempt, 0, - "High-priority backup preemption mode"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_RW, &carp_log, 0, - "CARP log level"); -SYSCTL_PROC(_net_inet_carp, OID_AUTO, demotion, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_RW, + &VNET_NAME(carp_allow), 0, "Accept incoming CARP packets"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_RW, + &VNET_NAME(carp_preempt), 0, "High-priority backup preemption mode"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_RW, + &VNET_NAME(carp_log), 0, "CARP log level"); +SYSCTL_VNET_PROC(_net_inet_carp, OID_AUTO, demotion, CTLTYPE_INT|CTLFLAG_RW, 0, 0, carp_demote_adj_sysctl, "I", "Adjust demotion factor (skew of advskew)"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_RW, - &carp_senderr_adj, 0, "Send error demotion factor adjustment"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW, - &carp_ifdown_adj, 0, "Interface down demotion factor adjustment"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_RW, + &VNET_NAME(carp_senderr_adj), 0, "Send error demotion factor adjustment"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW, + &VNET_NAME(carp_ifdown_adj), 0, + "Interface down demotion factor adjustment"); static counter_u64_t carpstats[sizeof(struct carpstats) / sizeof(uint64_t)]; #define CARPSTATS_ADD(name, val) \ @@ -251,12 +270,12 @@ SYSCTL_PROC(_net_inet_carp, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RW, } while (0) #define CARP_LOG(...) do { \ - if (carp_log > 0) \ + if (V_carp_log > 0) \ log(LOG_INFO, "carp: " __VA_ARGS__); \ } while (0) #define CARP_DEBUG(...) do { \ - if (carp_log > 1) \ + if (V_carp_log > 1) \ log(LOG_DEBUG, __VA_ARGS__); \ } while (0) @@ -277,8 +296,8 @@ SYSCTL_PROC(_net_inet_carp, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RW, TAILQ_FOREACH((sc), &(ifp)->if_carp->cif_vrs, sc_list) #define DEMOTE_ADVSKEW(sc) \ - (((sc)->sc_advskew + carp_demotion > CARP_MAXSKEW) ? \ - CARP_MAXSKEW : ((sc)->sc_advskew + carp_demotion)) + (((sc)->sc_advskew + V_carp_demotion > CARP_MAXSKEW) ? \ + CARP_MAXSKEW : ((sc)->sc_advskew + V_carp_demotion)) static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); static struct carp_softc @@ -430,7 +449,7 @@ carp_input(struct mbuf *m, int hlen) CARPSTATS_INC(carps_ipackets); - if (!carp_allow) { + if (!V_carp_allow) { m_freem(m); return; } @@ -513,7 +532,7 @@ carp6_input(struct mbuf **mp, int *offp, int proto) CARPSTATS_INC(carps_ipackets6); - if (!carp_allow) { + if (!V_carp_allow) { m_freem(m); return (IPPROTO_DONE); } @@ -647,7 +666,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) * If we're pre-empting masters who advertise slower than us, * and this one claims to be slower, treat him as down. */ - if (carp_preempt && timevalcmp(&sc_tv, &ch_tv, <)) { + if (V_carp_preempt && timevalcmp(&sc_tv, &ch_tv, <)) { CARP_LOG("VHID %u@%s: BACKUP -> MASTER " "(preempting a slower master)\n", sc->sc_vhid, @@ -830,13 +849,14 @@ carp_send_ad_locked(struct carp_softc *sc) if (sc->sc_sendad_errors < INT_MAX) sc->sc_sendad_errors++; if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(carp_senderr_adj, "send error"); + carp_demote_adj(V_carp_senderr_adj, + "send error"); sc->sc_sendad_success = 0; } else { if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { if (++sc->sc_sendad_success >= CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-carp_senderr_adj, + carp_demote_adj(-V_carp_senderr_adj, "send ok"); sc->sc_sendad_errors = 0; } @@ -903,14 +923,14 @@ carp_send_ad_locked(struct carp_softc *sc) if (sc->sc_sendad_errors < INT_MAX) sc->sc_sendad_errors++; if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(carp_senderr_adj, + carp_demote_adj(V_carp_senderr_adj, "send6 error"); sc->sc_sendad_success = 0; } else { if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { if (++sc->sc_sendad_success >= CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-carp_senderr_adj, + carp_demote_adj(-V_carp_senderr_adj, "send6 ok"); sc->sc_sendad_errors = 0; } @@ -1541,7 +1561,7 @@ carp_destroy(struct carp_softc *sc) CARP_LOCK(sc); if (sc->sc_suppress) - carp_demote_adj(-carp_ifdown_adj, "vhid removed"); + carp_demote_adj(-V_carp_ifdown_adj, "vhid removed"); callout_drain(&sc->sc_ad_tmo); #ifdef INET callout_drain(&sc->sc_md_tmo); @@ -2006,13 +2026,13 @@ carp_sc_state(struct carp_softc *sc) carp_set_state(sc, INIT); carp_setrun(sc, 0); if (!sc->sc_suppress) - carp_demote_adj(carp_ifdown_adj, "interface down"); + carp_demote_adj(V_carp_ifdown_adj, "interface down"); sc->sc_suppress = 1; } else { carp_set_state(sc, INIT); carp_setrun(sc, 0); if (sc->sc_suppress) - carp_demote_adj(-carp_ifdown_adj, "interface up"); + carp_demote_adj(-V_carp_ifdown_adj, "interface up"); sc->sc_suppress = 0; } } @@ -2020,8 +2040,8 @@ carp_sc_state(struct carp_softc *sc) static void carp_demote_adj(int adj, char *reason) { - atomic_add_int(&carp_demotion, adj); - CARP_LOG("demoted by %d to %d (%s)\n", adj, carp_demotion, reason); + atomic_add_int(&V_carp_demotion, adj); + CARP_LOG("demoted by %d to %d (%s)\n", adj, V_carp_demotion, reason); taskqueue_enqueue(taskqueue_swi, &carp_sendall_task); } @@ -2030,7 +2050,7 @@ carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS) { int new, error; - new = carp_demotion; + new = V_carp_demotion; error = sysctl_handle_int(oidp, &new, 0, req); if (error || !req->newptr) return (error); --cvVnyQ+4j833TQvp-- From owner-freebsd-virtualization@FreeBSD.ORG Mon Aug 12 10:16:24 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 762F3FBC; Mon, 12 Aug 2013 10:16:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D65852C4E; Mon, 12 Aug 2013 10:16:22 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r7CAGFsw092151; Mon, 12 Aug 2013 14:16:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r7CAGFfu092150; Mon, 12 Aug 2013 14:16:15 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 12 Aug 2013 14:16:15 +0400 From: Gleb Smirnoff To: Mikolaj Golub Subject: Re: RFC: carp(4): improved VIMAGE support Message-ID: <20130812101615.GD20104@glebius.int.ru> References: <20130811200834.GB49895@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130811200834.GB49895@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Aug 2013 10:16:24 -0000 On Sun, Aug 11, 2013 at 11:08:35PM +0300, Mikolaj Golub wrote: M> Hi, M> M> I would like to virtualize carp(4) variables to have per vnet control. M> M> Any comments, objections? No objections! -- Totus tuus, Glebius. From owner-freebsd-virtualization@FreeBSD.ORG Mon Aug 12 11:06:55 2013 Return-Path: Delivered-To: freebsd-virtualization@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7840FB45 for ; Mon, 12 Aug 2013 11:06:55 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64DF12155 for ; Mon, 12 Aug 2013 11:06:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r7CB6tfM085222 for ; Mon, 12 Aug 2013 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r7CB6sbD085220 for freebsd-virtualization@FreeBSD.org; Mon, 12 Aug 2013 11:06:54 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 12 Aug 2013 11:06:54 GMT Message-Id: <201308121106.r7CB6sbD085220@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-virtualization@FreeBSD.org Subject: Current problem reports assigned to freebsd-virtualization@FreeBSD.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Aug 2013 11:06:55 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/165252 virtualization[vimage] [pf] [panic] kernel panics with VIMAGE and PF o kern/161094 virtualization[vimage] [pf] [panic] kernel panic with pf + VIMAGE wh o kern/160541 virtualization[vimage][pf][patch] panic: userret: Returning on td 0x o kern/160496 virtualization[vimage] [pf] [patch] kernel panic with pf + VIMAGE o kern/148155 virtualization[vimage] [pf] Kernel panic with PF + VIMAGE kernel opt a kern/147950 virtualization[vimage] [carp] VIMAGE + CARP = kernel crash s kern/143808 virtualization[pf] pf does not work inside jail 7 problems total. From owner-freebsd-virtualization@FreeBSD.ORG Mon Aug 12 19:45:24 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45234C52; Mon, 12 Aug 2013 19:45:24 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45B6226DE; Mon, 12 Aug 2013 19:45:23 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id w10so5056401lbi.7 for ; Mon, 12 Aug 2013 12:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=KWLklENdkAHhwLtj2RpztmUyYKtZZLwpr6IkpND/noA=; b=iyc+INluxicpgNWjnz9TH6iW65dKNJLA0UzTPQ/sfHs+L9DMbGvDlD3nr6FgM7r7ZO WQqb9jpJQK2cyWRJblsX8+pawrYnsVl+SdeFvWoarGJYIif6IXNAsVL4szev0U0bLPWz ZdlQbyNlbknIgan4oR7KRyfOyfD+Jfz1mHoYzuyOeJiTK0hamI6JfuFmSXDeAiDllH5T A2rJgqDvMlEliiq/BWW8fb0tMM/TJ6M1HRK91sDweIHV1dGwT/KGyEFMf6WaSv9cGaJ9 nRH3sG50tnTL18hGAVqKTjQdSnTnE/t6UrUFKu9nI8VTp6KkvHwxf3Y6pxvs/4I/RsVQ 995A== X-Received: by 10.112.55.173 with SMTP id t13mr382184lbp.39.1376336721214; Mon, 12 Aug 2013 12:45:21 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id rd5sm12415776lbb.16.2013.08.12.12.45.19 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 12:45:20 -0700 (PDT) Sender: Mikolaj Golub Date: Mon, 12 Aug 2013 22:45:17 +0300 From: Mikolaj Golub To: Gleb Smirnoff Subject: Re: RFC: carp(4): improved VIMAGE support Message-ID: <20130812194516.GB4278@gmail.com> References: <20130811200834.GB49895@gmail.com> <20130812101615.GD20104@glebius.int.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <20130812101615.GD20104@glebius.int.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "Andrey V. Elsukov" , freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Aug 2013 19:45:24 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Aug 12, 2013 at 02:16:15PM +0400, Gleb Smirnoff wrote: > On Sun, Aug 11, 2013 at 11:08:35PM +0300, Mikolaj Golub wrote: > M> Hi, > M> > M> I would like to virtualize carp(4) variables to have per vnet control. > M> > M> Any comments, objections? > > No objections! Andrey pointed out (on irc) that carpstats was missing virtualization too. Here is an updated patch. -- Mikolaj Golub --5vNYLRcllDrimb99 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="ip_carp.c.VIMAGE.2.patch" commit ac71429a70862ca75a614bb798dcfb62e67faca3 Author: Mikolaj Golub Date: Tue Aug 6 23:47:31 2013 +0300 Virtualize carp(4) variables to have per vnet control. diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 9228a8f..436385d 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -187,48 +187,59 @@ static int proto_reg[] = {-1, -1}; * dereferencing our function pointers. */ -static int carp_allow = 1; /* Accept incoming CARP packets. */ -static int carp_preempt = 0; /* Preempt slower nodes. */ -static int carp_log = 1; /* Log level. */ -static int carp_demotion = 0; /* Global advskew demotion. */ -static int carp_senderr_adj = CARP_MAXSKEW; /* Send error demotion factor */ -static int carp_ifdown_adj = CARP_MAXSKEW; /* Iface down demotion factor */ +/* Accept incoming CARP packets. */ +static VNET_DEFINE(int, carp_allow) = 1; +#define V_carp_allow VNET(carp_allow) + +/* Preempt slower nodes. */ +static VNET_DEFINE(int, carp_preempt) = 0; +#define V_carp_preempt VNET(carp_preempt) + +/* Log level. */ +static VNET_DEFINE(int, carp_log) = 1; +#define V_carp_log VNET(carp_log) + +/* Global advskew demotion. */ +static VNET_DEFINE(int, carp_demotion) = 0; +#define V_carp_demotion VNET(carp_demotion) + +/* Send error demotion factor. */ +static VNET_DEFINE(int, carp_senderr_adj) = CARP_MAXSKEW; +#define V_carp_senderr_adj VNET(carp_senderr_adj) + +/* Iface down demotion factor. */ +static VNET_DEFINE(int, carp_ifdown_adj) = CARP_MAXSKEW; +#define V_carp_ifdown_adj VNET(carp_ifdown_adj) + static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_RW, &carp_allow, 0, - "Accept incoming CARP packets"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_RW, &carp_preempt, 0, - "High-priority backup preemption mode"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_RW, &carp_log, 0, - "CARP log level"); -SYSCTL_PROC(_net_inet_carp, OID_AUTO, demotion, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_RW, + &VNET_NAME(carp_allow), 0, "Accept incoming CARP packets"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_RW, + &VNET_NAME(carp_preempt), 0, "High-priority backup preemption mode"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_RW, + &VNET_NAME(carp_log), 0, "CARP log level"); +SYSCTL_VNET_PROC(_net_inet_carp, OID_AUTO, demotion, CTLTYPE_INT|CTLFLAG_RW, 0, 0, carp_demote_adj_sysctl, "I", "Adjust demotion factor (skew of advskew)"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_RW, - &carp_senderr_adj, 0, "Send error demotion factor adjustment"); -SYSCTL_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW, - &carp_ifdown_adj, 0, "Interface down demotion factor adjustment"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_RW, + &VNET_NAME(carp_senderr_adj), 0, "Send error demotion factor adjustment"); +SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW, + &VNET_NAME(carp_ifdown_adj), 0, + "Interface down demotion factor adjustment"); + +VNET_PCPUSTAT_DEFINE(struct carpstats, carpstats); +VNET_PCPUSTAT_SYSINIT(carpstats); +VNET_PCPUSTAT_SYSUNINIT(carpstats); -static counter_u64_t carpstats[sizeof(struct carpstats) / sizeof(uint64_t)]; #define CARPSTATS_ADD(name, val) \ - counter_u64_add(carpstats[offsetof(struct carpstats, name) / \ + counter_u64_add(VNET(carpstats)[offsetof(struct carpstats, name) / \ sizeof(uint64_t)], (val)) #define CARPSTATS_INC(name) CARPSTATS_ADD(name, 1) -static int -carpstats_sysctl(SYSCTL_HANDLER_ARGS) -{ - struct carpstats s; - - COUNTER_ARRAY_COPY(carpstats, &s, sizeof(s) / sizeof(uint64_t)); - if (req->newptr) - COUNTER_ARRAY_ZERO(carpstats, sizeof(s) / sizeof(uint64_t)); - return (SYSCTL_OUT(req, &s, sizeof(s))); -} -SYSCTL_PROC(_net_inet_carp, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RW, - NULL, 0, carpstats_sysctl, "I", - "CARP statistics (struct carpstats, netinet/ip_carp.h)"); +SYSCTL_VNET_PCPUSTAT(_net_inet_carp, OID_AUTO, stats, struct carpstats, + carpstats, "CARP statistics (struct carpstats, netinet/ip_carp.h)"); #define CARP_LOCK_INIT(sc) mtx_init(&(sc)->sc_mtx, "carp_softc", \ NULL, MTX_DEF) @@ -251,12 +262,12 @@ SYSCTL_PROC(_net_inet_carp, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RW, } while (0) #define CARP_LOG(...) do { \ - if (carp_log > 0) \ + if (V_carp_log > 0) \ log(LOG_INFO, "carp: " __VA_ARGS__); \ } while (0) #define CARP_DEBUG(...) do { \ - if (carp_log > 1) \ + if (V_carp_log > 1) \ log(LOG_DEBUG, __VA_ARGS__); \ } while (0) @@ -277,8 +288,8 @@ SYSCTL_PROC(_net_inet_carp, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RW, TAILQ_FOREACH((sc), &(ifp)->if_carp->cif_vrs, sc_list) #define DEMOTE_ADVSKEW(sc) \ - (((sc)->sc_advskew + carp_demotion > CARP_MAXSKEW) ? \ - CARP_MAXSKEW : ((sc)->sc_advskew + carp_demotion)) + (((sc)->sc_advskew + V_carp_demotion > CARP_MAXSKEW) ? \ + CARP_MAXSKEW : ((sc)->sc_advskew + V_carp_demotion)) static void carp_input_c(struct mbuf *, struct carp_header *, sa_family_t); static struct carp_softc @@ -430,7 +441,7 @@ carp_input(struct mbuf *m, int hlen) CARPSTATS_INC(carps_ipackets); - if (!carp_allow) { + if (!V_carp_allow) { m_freem(m); return; } @@ -513,7 +524,7 @@ carp6_input(struct mbuf **mp, int *offp, int proto) CARPSTATS_INC(carps_ipackets6); - if (!carp_allow) { + if (!V_carp_allow) { m_freem(m); return (IPPROTO_DONE); } @@ -647,7 +658,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) * If we're pre-empting masters who advertise slower than us, * and this one claims to be slower, treat him as down. */ - if (carp_preempt && timevalcmp(&sc_tv, &ch_tv, <)) { + if (V_carp_preempt && timevalcmp(&sc_tv, &ch_tv, <)) { CARP_LOG("VHID %u@%s: BACKUP -> MASTER " "(preempting a slower master)\n", sc->sc_vhid, @@ -830,13 +841,14 @@ carp_send_ad_locked(struct carp_softc *sc) if (sc->sc_sendad_errors < INT_MAX) sc->sc_sendad_errors++; if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(carp_senderr_adj, "send error"); + carp_demote_adj(V_carp_senderr_adj, + "send error"); sc->sc_sendad_success = 0; } else { if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { if (++sc->sc_sendad_success >= CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-carp_senderr_adj, + carp_demote_adj(-V_carp_senderr_adj, "send ok"); sc->sc_sendad_errors = 0; } @@ -903,14 +915,14 @@ carp_send_ad_locked(struct carp_softc *sc) if (sc->sc_sendad_errors < INT_MAX) sc->sc_sendad_errors++; if (sc->sc_sendad_errors == CARP_SENDAD_MAX_ERRORS) - carp_demote_adj(carp_senderr_adj, + carp_demote_adj(V_carp_senderr_adj, "send6 error"); sc->sc_sendad_success = 0; } else { if (sc->sc_sendad_errors >= CARP_SENDAD_MAX_ERRORS) { if (++sc->sc_sendad_success >= CARP_SENDAD_MIN_SUCCESS) { - carp_demote_adj(-carp_senderr_adj, + carp_demote_adj(-V_carp_senderr_adj, "send6 ok"); sc->sc_sendad_errors = 0; } @@ -1541,7 +1553,7 @@ carp_destroy(struct carp_softc *sc) CARP_LOCK(sc); if (sc->sc_suppress) - carp_demote_adj(-carp_ifdown_adj, "vhid removed"); + carp_demote_adj(-V_carp_ifdown_adj, "vhid removed"); callout_drain(&sc->sc_ad_tmo); #ifdef INET callout_drain(&sc->sc_md_tmo); @@ -2006,13 +2018,13 @@ carp_sc_state(struct carp_softc *sc) carp_set_state(sc, INIT); carp_setrun(sc, 0); if (!sc->sc_suppress) - carp_demote_adj(carp_ifdown_adj, "interface down"); + carp_demote_adj(V_carp_ifdown_adj, "interface down"); sc->sc_suppress = 1; } else { carp_set_state(sc, INIT); carp_setrun(sc, 0); if (sc->sc_suppress) - carp_demote_adj(-carp_ifdown_adj, "interface up"); + carp_demote_adj(-V_carp_ifdown_adj, "interface up"); sc->sc_suppress = 0; } } @@ -2020,8 +2032,8 @@ carp_sc_state(struct carp_softc *sc) static void carp_demote_adj(int adj, char *reason) { - atomic_add_int(&carp_demotion, adj); - CARP_LOG("demoted by %d to %d (%s)\n", adj, carp_demotion, reason); + atomic_add_int(&V_carp_demotion, adj); + CARP_LOG("demoted by %d to %d (%s)\n", adj, V_carp_demotion, reason); taskqueue_enqueue(taskqueue_swi, &carp_sendall_task); } @@ -2030,7 +2042,7 @@ carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS) { int new, error; - new = carp_demotion; + new = V_carp_demotion; error = sysctl_handle_int(oidp, &new, 0, req); if (error || !req->newptr) return (error); @@ -2101,8 +2113,6 @@ carp_mod_cleanup(void) mtx_unlock(&carp_mtx); taskqueue_drain(taskqueue_swi, &carp_sendall_task); mtx_destroy(&carp_mtx); - COUNTER_ARRAY_FREE(carpstats, - sizeof(struct carpstats) / sizeof(uint64_t)); } static int @@ -2112,8 +2122,6 @@ carp_mod_load(void) mtx_init(&carp_mtx, "carp_mtx", NULL, MTX_DEF); LIST_INIT(&carp_list); - COUNTER_ARRAY_ALLOC(carpstats, - sizeof(struct carpstats) / sizeof(uint64_t), M_WAITOK); carp_get_vhid_p = carp_get_vhid; carp_forus_p = carp_forus; carp_output_p = carp_output; --5vNYLRcllDrimb99-- From owner-freebsd-virtualization@FreeBSD.ORG Mon Aug 12 20:45:15 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D5070A55; Mon, 12 Aug 2013 20:45:15 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB91A2A83; Mon, 12 Aug 2013 20:45:15 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id kl13so8003194pab.34 for ; Mon, 12 Aug 2013 13:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DbY+kz+kwFdHni9aUAAPc/4c2Tha46u+pDMVmoQroEI=; b=aaAzGbJGISFrixIZX29ELezhu7007uQBNPBCeO/WDKL0vl1us5z/YqKScT8Nm9894h rHbAIGt03EI346fRDO5xYGDUE6167M4wl9w9vHBh8e2Z0ma5SZi81duZaSqO2eogXi7v vtfixfmTu9kTS6AkTW+ZHnrUWB23JWmL8J1WuxyaJKegANGfIHsKPxpH+1l0Wo1MVCvA 3UTKzuqt5zgSiUcdg4jWP3CXTk+soiiYG6dqnMT+KRFpu/O/UQRhQa586ctTYpvE6v17 jLqK+hRt0Yn6jQNBQP9D6ks7q74JeQoI+hgGYqtt70A922SkQaFd+wbDHpbLA0l/U2li 6YXQ== MIME-Version: 1.0 X-Received: by 10.66.155.36 with SMTP id vt4mr875594pab.93.1376340315331; Mon, 12 Aug 2013 13:45:15 -0700 (PDT) Received: by 10.68.51.169 with HTTP; Mon, 12 Aug 2013 13:45:15 -0700 (PDT) In-Reply-To: <5207DCB0.4030809@freebsd.org> References: <5207DCB0.4030809@freebsd.org> Date: Mon, 12 Aug 2013 16:45:15 -0400 Message-ID: Subject: Re: tech questions and development priorities for bhyve From: Aryeh Friedman To: Peter Grehan Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Aug 2013 20:45:15 -0000 >> 3. Non-virtio pass through (specifically USB) > Not quite sure what you mean by 3 - is that PCI pass-through ? Note there > is a GSoC project for USB emulation in bhyve. A user story might help here.... one of the motivating factors for us getting involved with virtualization was we have a web based app that uses an automatic upload from flash drive via java web start program.... the auto upload only works if you run it on windows and all other OS's get a file chooser... my preferred OS for almost all work is FreeBSD (and has been since almost 2.0.5) and we have very limited space for new computers (or the money) so we decided to try virtual box and found that it couldn't be used to test auto upload because the insertion of a flash drive into the host did not get passed along to the guest... we tried qemu and even tried some openstack based solutions (finding out how ungodly awful openstack is the other main motivating factor for our virtualization work) and none of them passed the USB along to the guest... about this time we got a contract to do some openstack work (that was later canceled) so we ended up buying 2 machines (long story but win 32 and win 64 do not live well on the same machine) one for openstack and one for doing multibooting of different win32's (the win64's where handled by my desktop)... so when the openstack project was canceled we had learned enough about cloud computing to see a better solution and decided to base it around bhyve... and since we already had the ears of the bhyve community why not ask about the usb pass through issue From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 07:26:47 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8EF625F1; Tue, 13 Aug 2013 07:26:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 782342F7C; Tue, 13 Aug 2013 07:26:46 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id r7D7QVCk098715; Tue, 13 Aug 2013 11:26:31 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id r7D7QV99098714; Tue, 13 Aug 2013 11:26:31 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 13 Aug 2013 11:26:31 +0400 From: Gleb Smirnoff To: Mikolaj Golub Subject: Re: RFC: carp(4): improved VIMAGE support Message-ID: <20130813072631.GH20104@glebius.int.ru> References: <20130811200834.GB49895@gmail.com> <20130812101615.GD20104@glebius.int.ru> <20130812194516.GB4278@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20130812194516.GB4278@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "Andrey V. Elsukov" , freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 07:26:47 -0000 On Mon, Aug 12, 2013 at 10:45:17PM +0300, Mikolaj Golub wrote: M> On Mon, Aug 12, 2013 at 02:16:15PM +0400, Gleb Smirnoff wrote: M> > On Sun, Aug 11, 2013 at 11:08:35PM +0300, Mikolaj Golub wrote: M> > M> Hi, M> > M> M> > M> I would like to virtualize carp(4) variables to have per vnet control. M> > M> M> > M> Any comments, objections? M> > M> > No objections! M> M> Andrey pointed out (on irc) that carpstats was missing virtualization M> too. Here is an updated patch. Thanks. As before, no objections from me. -- Totus tuus, Glebius. From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 17:17:04 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6944EA3A for ; Tue, 13 Aug 2013 17:17:04 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 477F725D0 for ; Tue, 13 Aug 2013 17:17:04 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id lb1so9138856pab.26 for ; Tue, 13 Aug 2013 10:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=DICPg29/pDqhBKewSDbmmRjn+8qQFlG7AMDVZ32DoLI=; b=jFThhoBBv/0OrLil21SXMRReQnjfJ6sBL0YwBeWabLmK8p0XyiFiQ878kXXww8+zWq kGnnB+h10QQv2+bSvtvOX7iU581mdAUdwbyBzVntH4qlwX7lcEg4vWccc6AVldJOdow4 gPYhENnr0s0HuaSGPLa8OTkdSVJ/lXqwooXiPQpEwToj8s8o/Wh8h5Ul9te0qDERu1P2 txzn0JXq8GpBeunQAI29xIS2Z8VzziJsT5FCW99Ww16dkowD1V1gX+UbwnaLLDF4pRmJ HpqGRdNLnU3UGc+4B76QwC4pb6POW2qvZfBShXdVWC3DwLEh9mx6yL4dQ2vxWq92pwM7 Tecw== MIME-Version: 1.0 X-Received: by 10.68.240.72 with SMTP id vy8mr5532175pbc.161.1376414223951; Tue, 13 Aug 2013 10:17:03 -0700 (PDT) Received: by 10.68.51.169 with HTTP; Tue, 13 Aug 2013 10:17:03 -0700 (PDT) Date: Tue, 13 Aug 2013 13:17:03 -0400 Message-ID: Subject: ot: who to report a bug in if_tap to? From: Aryeh Friedman To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 17:17:04 -0000 It appears that a bridged if_tap does not understand DHCP on the physical NIC... who do I report this to? From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 17:19:44 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B6062B84 for ; Tue, 13 Aug 2013 17:19:44 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 77F5A25EA for ; Tue, 13 Aug 2013 17:19:44 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 0532712205; Wed, 14 Aug 2013 03:19:37 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-69-181-164-196.hsd1.ca.comcast.net [69.181.164.196]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BNY87719 (AUTH peterg@ptree32.com.au); Wed, 14 Aug 2013 03:19:36 +1000 Message-ID: <520A6A9C.7090209@freebsd.org> Date: Tue, 13 Aug 2013 10:19:24 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Aryeh Friedman Subject: Re: ot: who to report a bug in if_tap to? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 17:19:44 -0000 Hi Aryeh, > It appears that a bridged if_tap does not understand DHCP on the > physical NIC... who do I report this to? First, what's your configuration ? Is the DHCP server connected via the physical NIC ? What does a tcpdump show ? later, Peter. From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 17:43:07 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C14C7FE; Tue, 13 Aug 2013 17:43:07 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pa0-x22c.google.com (mail-pa0-x22c.google.com [IPv6:2607:f8b0:400e:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51B9828AB; Tue, 13 Aug 2013 17:43:07 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id fz6so4717836pac.17 for ; Tue, 13 Aug 2013 10:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DK7ihXCEEsQbPJ21W//Kjttij9uAwqbmEFLdxD200hQ=; b=h9gq12Yo1iMuhqKbf8Ogqx8U+XOTsGcV4745gSdmXnvd5Y0D1V1Is1+DXUOwsVcZF5 E5beDRQ83orMKSdi/f22ym3IiOaB1DjWPOTEnO8GnaFBLVc29VdC/X+uFQyuBoF2TcOU nlEbYI2or7ED5tdwjIjgyR2fGtR02CihZl6Dg6VfOKKeNePoevDhGVusik6tTjFmbdQs ML3Zingti0mjvWyJPCX+5cH+2iPshmxEUfvwbKAFDDPTZUX7iE2JjkZKGW3DjyXrgL2A Gz1NX/Hx5wa6ohuxCrgqp6+TkPvmnvBTwXL4H3nn/AfWOXISE8uV+c89PqoGKRIKIjT4 SgzA== MIME-Version: 1.0 X-Received: by 10.68.223.225 with SMTP id qx1mr5609315pbc.157.1376415787038; Tue, 13 Aug 2013 10:43:07 -0700 (PDT) Received: by 10.68.51.169 with HTTP; Tue, 13 Aug 2013 10:43:06 -0700 (PDT) In-Reply-To: <520A6A9C.7090209@freebsd.org> References: <520A6A9C.7090209@freebsd.org> Date: Tue, 13 Aug 2013 13:43:06 -0400 Message-ID: Subject: Re: ot: who to report a bug in if_tap to? From: Aryeh Friedman To: Peter Grehan Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 17:43:07 -0000 It is connected to the physical nic via a switch (no intermediate routers). DHCP doesn't even attempt because there is no carrier on tap0: em0: flags=8843 metric 0 mtu 1500 options=4219b ether 30:85:a9:ec:24:95 inet 10.0.10.10 netmask 0xffffff00 broadcast 10.0.10.255 inet6 fe80::3285:a9ff:feec:2495%em0 prefixlen 64 scopeid 0x1 nd6 options=21 media: Ethernet autoselect (100baseTX ) status: active re0: flags=8802 metric 0 mtu 1500 options=8209b ether 90:f6:52:00:40:e6 nd6 options=21 media: Ethernet autoselect (100baseTX ) status: no carrier lo0: flags=8049 metric 0 mtu 16384 options=600003 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 nd6 options=21 tap0: flags=8843 metric 0 mtu 1500 options=80000 ether 00:bd:0c:6e:02:00 inet6 fe80::2bd:cff:fe6e:200%tap0 prefixlen 64 scopeid 0x4 nd6 options=21 media: Ethernet autoselect status: no carrier root@petitecloud:/home/aryeh # if if ifconfig ifmcstat root@petitecloud:/home/aryeh # ifconfig bridge0 create root@petitecloud:/home/aryeh # ifconfig bridge0 addm em0 addm tap0 root@petitecloud:/home/aryeh # ifconfig tap0 10.0.10.3 root@petitecloud:/home/aryeh # ifconfig -a em0: flags=8943 metric 0 mtu 1500 options=42098 ether 30:85:a9:ec:24:95 inet 10.0.10.10 netmask 0xffffff00 broadcast 10.0.10.255 inet6 fe80::3285:a9ff:feec:2495%em0 prefixlen 64 scopeid 0x1 nd6 options=21 media: Ethernet autoselect (100baseTX ) status: active tap0: flags=8943 metric 0 mtu 1500 options=80000 ether 00:bd:0c:6e:02:00 inet6 fe80::2bd:cff:fe6e:200%tap0 prefixlen 64 scopeid 0x4 inet 10.0.10.3 netmask 0xff000000 broadcast 10.255.255.255 nd6 options=21 media: Ethernet autoselect status: no carrier bridge0: flags=8802 metric 0 mtu 1500 ether f6:3c:f0:0f:b9:48 nd6 options=1 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0 member: tap0 flags=143 ifmaxaddr 0 port 4 priority 128 path cost 2000000 member: em0 flags=143 ifmaxaddr 0 port 1 priority 128 path cost 200000 root@vcloud:/home/aryeh # dhclient tap0 tap0: no link .............. giving up On Tue, Aug 13, 2013 at 1:19 PM, Peter Grehan wrote: > Hi Aryeh, > > >> It appears that a bridged if_tap does not understand DHCP on the >> physical NIC... who do I report this to? > > > First, what's your configuration ? Is the DHCP server connected via the > physical NIC ? What does a tcpdump show ? > > later, > > Peter. > From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 19:49:29 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A63FCA26 for ; Tue, 13 Aug 2013 19:49:29 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pb0-x22f.google.com (mail-pb0-x22f.google.com [IPv6:2607:f8b0:400e:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 847FE2036 for ; Tue, 13 Aug 2013 19:49:29 +0000 (UTC) Received: by mail-pb0-f47.google.com with SMTP id rr4so7346532pbb.34 for ; Tue, 13 Aug 2013 12:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=oew4r7RPcoOpIEmEUy13Q2lOcnp+th3j6yqBLeHsJLM=; b=PCuwHBw15ciZR7T1C09tVPCsnDXm22QkmHJJmZFAHhQskZ3l3kJ3lYO+Nz7mSt8QN+ +vxvq3QeB5PunOioDDt1rIPMEHOghsXjgLKzNyfIFHElZTiTs9qROXgKT28SJxz4NhSO Nz224i2KrHRxGedi4bk6Mqihu+Y6JebbuseAP4Dv9IDjyRyDH8lxMbsBsNwLHDHzuIZr s7n3ECOGNhslYVjfE2ud+KTru+3w1HqaOjSlkM2+6XKshGmEiUmS2H8n78EHLeQ3yZUv Syu1u+iko7ZPb+he2dPJd0VKqIsXpb8yacjyvQTNt2b547r6UsPks0SWSJOGSDhKMICp kq9g== MIME-Version: 1.0 X-Received: by 10.66.189.194 with SMTP id gk2mr4533305pac.166.1376423369212; Tue, 13 Aug 2013 12:49:29 -0700 (PDT) Received: by 10.68.51.169 with HTTP; Tue, 13 Aug 2013 12:49:29 -0700 (PDT) Date: Tue, 13 Aug 2013 15:49:29 -0400 Message-ID: Subject: bhyve bug report: vtnet fails to init on r253930 From: Aryeh Friedman To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 19:49:29 -0000 Bug: In order to make vtnet available to the guest the host must set a IP on it's end of the port How to repeat: Attempt to use vmrun.sh on the above 10-CURRENT version How to fix: After booting with vmrun.sh add an ip to the host end of tap0: ifconfig tap0 10.0.0.2 From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 20:55:55 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7CFDE350; Tue, 13 Aug 2013 20:55:55 +0000 (UTC) (envelope-from bryanv@daemoninthecloset.org) Received: from torment.daemoninthecloset.org (torment.daemoninthecloset.org [94.242.209.234]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BF6724C0; Tue, 13 Aug 2013 20:55:55 +0000 (UTC) Received: from sage.daemoninthecloset.org (unknown [70.114.209.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "sage.daemoninthecloset.org", Issuer "daemoninthecloset.org" (verified OK)) by torment.daemoninthecloset.org (Postfix) with ESMTPS id C2E2242C2659; Tue, 13 Aug 2013 23:00:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemoninthecloset.org X-Virus-Scanned: amavisd-new at daemoninthecloset.org Date: Tue, 13 Aug 2013 15:55:43 -0500 (CDT) From: Bryan Venteicher To: Aryeh Friedman Message-ID: <407363932.15961.1376427343454.JavaMail.root@daemoninthecloset.org> In-Reply-To: References: <520A6A9C.7090209@freebsd.org> Subject: Re: ot: who to report a bug in if_tap to? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.51.1.6] X-Mailer: Zimbra 8.0.2_GA_5569 (ZimbraWebClient - GC28 (Mac)/8.0.2_GA_5569) Thread-Topic: who to report a bug in if_tap to? Thread-Index: 5KHVRr5cLo81hgH1XNHis7786joi6A== Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 20:55:55 -0000 ----- Original Message ----- > It is connected to the physical nic via a switch (no intermediate > routers). DHCP doesn't even attempt because there is no carrier on > tap0: > > em0: flags=8843 metric 0 mtu 1500 > options=4219b > ether 30:85:a9:ec:24:95 > inet 10.0.10.10 netmask 0xffffff00 broadcast 10.0.10.255 > inet6 fe80::3285:a9ff:feec:2495%em0 prefixlen 64 scopeid 0x1 > nd6 options=21 > media: Ethernet autoselect (100baseTX ) > status: active > re0: flags=8802 metric 0 mtu 1500 > options=8209b > ether 90:f6:52:00:40:e6 > nd6 options=21 > media: Ethernet autoselect (100baseTX ) > status: no carrier > lo0: flags=8049 metric 0 mtu 16384 > options=600003 > inet 127.0.0.1 netmask 0xff000000 > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 > nd6 options=21 > tap0: flags=8843 metric 0 mtu 1500 > options=80000 > ether 00:bd:0c:6e:02:00 > inet6 fe80::2bd:cff:fe6e:200%tap0 prefixlen 64 scopeid 0x4 > nd6 options=21 > media: Ethernet autoselect > status: no carrier > root@petitecloud:/home/aryeh # if > if ifconfig ifmcstat > root@petitecloud:/home/aryeh # ifconfig bridge0 create > root@petitecloud:/home/aryeh # ifconfig bridge0 addm em0 addm tap0 > root@petitecloud:/home/aryeh # ifconfig tap0 10.0.10.3 You need to at least up the bridge. > bridge0: flags=8802 metric 0 mtu 1500 > ether f6:3c:f0:0f:b9:48 > nd6 options=1 > id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 > root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0 > member: tap0 flags=143 > ifmaxaddr 0 port 4 priority 128 path cost 2000000 > member: em0 flags=143 > ifmaxaddr 0 port 1 priority 128 path cost 200000 > root@vcloud:/home/aryeh # dhclient tap0 > tap0: no link .............. giving up > From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 13 23:26:39 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C16FBB52; Tue, 13 Aug 2013 23:26:39 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 956872DB9; Tue, 13 Aug 2013 23:26:39 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id kx10so3982630pab.13 for ; Tue, 13 Aug 2013 16:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2SMEiBSKGDOS0T4+6RoAQpyipe2UKl/MRIpabHXOJNc=; b=l8ok2djcezkmQcmOc8VlGxyfUE+4ITV8cqCIl3hzJMefwjaUtbPuMFsNPwp7I78fGd +WPROyLlD4F4tocwabTCQVfH1wlZHuRxWkmuOSoONgjMbarYKDqORZ/S2D+oRwu0mwG+ eroAF8Zua8f0HwiQrqB/72/FGJQv4gjg3rKYX03R9WE2uQQ3KHBtWMgv9O4rH1BaZQvx vsYqgbsfYFW2gaNKlvsczb8uIBj/Bzo2Az4B2MP3cshQdnrjdBtrgwa5fgaTACwcAhXL sfNtv1cIVNStp5N+/5yaBz0sJfZdoE1cLA/AyiH4VK5618+5wSnFWYV2bmFFIG+Qvn+I v9LA== MIME-Version: 1.0 X-Received: by 10.66.121.195 with SMTP id lm3mr6840080pab.116.1376436399332; Tue, 13 Aug 2013 16:26:39 -0700 (PDT) Received: by 10.68.51.169 with HTTP; Tue, 13 Aug 2013 16:26:39 -0700 (PDT) In-Reply-To: <407363932.15961.1376427343454.JavaMail.root@daemoninthecloset.org> References: <520A6A9C.7090209@freebsd.org> <407363932.15961.1376427343454.JavaMail.root@daemoninthecloset.org> Date: Tue, 13 Aug 2013 19:26:39 -0400 Message-ID: Subject: Re: ot: who to report a bug in if_tap to? From: Aryeh Friedman To: Bryan Venteicher Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 23:26:39 -0000 > You need to at least up the bridge. further experimentation shows it doesn't matter if it is up or down it is an issue of the link state never goes active..... peter has a separate bug report on the details From owner-freebsd-virtualization@FreeBSD.ORG Wed Aug 14 14:13:55 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92FFD92E; Wed, 14 Aug 2013 14:13:55 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ea0-x235.google.com (mail-ea0-x235.google.com [IPv6:2a00:1450:4013:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9F142DCD; Wed, 14 Aug 2013 14:13:54 +0000 (UTC) Received: by mail-ea0-f181.google.com with SMTP id d10so4890830eaj.40 for ; Wed, 14 Aug 2013 07:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=jgq4F7dwMHu9vFJvRCjXssHJGh2cBevePcbIQ3OC5IU=; b=G6chdOLjmi/iMWhJXX9KfDPtGXZq3Z3+OSBSKt7BwXuJ7oItLQbofBFhir8pVK7Kru 8SIfLb3nr6zdnC22dNx8CGQMI7gxbExBEiSXB+AUY1YzjeudCK5V/7Flg6lAWBt8rp28 66DDVFKaki1xOjcl0FsbcIdcOXjjDgxoCMNKEkeaN8Zc/kVCWAuJgmpQvwJtd38L5uua VdzDJnYAMdLMxtilKwdadab3lzRfRhKFlGjc0pKIAOscZuz2MwM6HkIWI55VfMMcInnW zNKpUGaRazzTs0X8bEWB0FW8YygdYzqJEVAJFZ/uQbh7wOJA1vhZ6u+zTL1TI1jeJutO BohA== X-Received: by 10.14.211.1 with SMTP id v1mr15236001eeo.5.1376489633006; Wed, 14 Aug 2013 07:13:53 -0700 (PDT) Received: from localhost ([188.230.122.226]) by mx.google.com with ESMTPSA id k7sm75494868eeg.13.2013.08.14.07.13.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 14 Aug 2013 07:13:52 -0700 (PDT) Date: Wed, 14 Aug 2013 17:13:50 +0300 From: Mikolaj Golub To: Gleb Smirnoff Subject: Re: RFC: carp(4): improved VIMAGE support Message-ID: <20130814141349.GA6117@gmail.com> References: <20130811200834.GB49895@gmail.com> <20130812101615.GD20104@glebius.int.ru> <20130812194516.GB4278@gmail.com> <20130813072631.GH20104@glebius.int.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130813072631.GH20104@glebius.int.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "Andrey V. Elsukov" , freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 14:13:55 -0000 On Tue, Aug 13, 2013 at 11:26:31AM +0400, Gleb Smirnoff wrote: > On Mon, Aug 12, 2013 at 10:45:17PM +0300, Mikolaj Golub wrote: > M> On Mon, Aug 12, 2013 at 02:16:15PM +0400, Gleb Smirnoff wrote: > M> > On Sun, Aug 11, 2013 at 11:08:35PM +0300, Mikolaj Golub wrote: > M> > M> Hi, > M> > M> > M> > M> I would like to virtualize carp(4) variables to have per vnet control. > M> > M> > M> > M> Any comments, objections? > M> > > M> > No objections! > M> > M> Andrey pointed out (on irc) that carpstats was missing virtualization > M> too. Here is an updated patch. > > Thanks. As before, no objections from me. Thanks. Committed as r254292. -- Mikolaj Golub From owner-freebsd-virtualization@FreeBSD.ORG Wed Aug 14 15:29:32 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 584EBC43; Wed, 14 Aug 2013 15:29:32 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF191222B; Wed, 14 Aug 2013 15:29:31 +0000 (UTC) Received: from x23.lan (89.164.9.9) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Wed, 14 Aug 2013 17:28:18 +0200 From: Marko Zec To: Mikolaj Golub Subject: Re: RFC: ipfw nat VIMAGE improvements Date: Wed, 14 Aug 2013 17:28:31 +0200 User-Agent: KMail/1.9.10 References: <20130811200111.GA49895@gmail.com> In-Reply-To: <20130811200111.GA49895@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201308141728.31361.zec@fer.hr> X-Originating-IP: [89.164.9.9] Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 15:29:32 -0000 On Sunday 11 August 2013 22:01:12 Mikolaj Golub wrote: > Hi, > > I would like to commit this patch that fixes some issues related to > ipfw nat module load/unload on VIMAGE featured system. > > Any comments, objections? Far from being an expert in ipfw, I'm worried that the proposed approach of simultaneously acquiring locks on _all_ ipfw instances might be calling for trouble: + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + IPFW_WLOCK(&V_layer3_chain); + CURVNET_RESTORE(); + } ipfw_nat_ptr = ipfw_nat; lookup_nat_ptr = lookup_nat; ipfw_nat_cfg_ptr = ipfw_nat_cfg; ipfw_nat_del_ptr = ipfw_nat_del; ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg; ipfw_nat_get_log_ptr = ipfw_nat_get_log; - IPFW_WUNLOCK(&V_layer3_chain); - V_ifaddr_event_tag = EVENTHANDLER_REGISTER( + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + IPFW_WUNLOCK(&V_layer3_chain); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); Why couldn't we introduce a per-vnet flag, say V_ipfw_nat_ready, and use it as #define IPFW_NAT_LOADED (V_ipfw_nat_ready) instead of current version of that macro: #define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) I.e., perhaps in ipfw_nat_init() we could first set all the function pointers, and then iterate over all vnets and set V_ipfw_nat ready there. In ipfw_nat_destroy() we would first iterate over all vnets to clear the flag, before clearing function pointers? Marko From owner-freebsd-virtualization@FreeBSD.ORG Wed Aug 14 20:43:11 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A4C39BAB for ; Wed, 14 Aug 2013 20:43:11 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 101D12590 for ; Wed, 14 Aug 2013 20:43:10 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id w10so72461lbi.7 for ; Wed, 14 Aug 2013 13:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=AXnNYCX4VlhtEUgmiEfy81oRWROlhDgurkD6tChX6zw=; b=SXgwVgx+vyWkrm8VyJ7CByVZdRC129AY1Z4JLu9AkPKl6Fh/tC6PSVDZYyvFOv6yTV iPTs8o57LQICJExqSYm0k3/qV1Y5Z1m3Q8BCb351LXyPrqSR5f6TwjddAdZxwuifYWru 8y5LH5YRewDPUajUDkHK1l9i1kkv1WT/8/ywebwdmPxuV1XCNjlLc83MVt39VqDbGVk7 7RNnqeLgrg/2MSHxDJ1zAMBtn5a/MgPr+cM86HQtfw4VaMlWJMaAiRdmxXO0FttUbt4k E4Yr6Il0XtHSYBxi2P6ciOyqhD6lFuQfHm3pDzkljfH70u5snF5ld6/aHSkOm2Q3ux3p 2gng== X-Received: by 10.112.51.166 with SMTP id l6mr9667404lbo.5.1376512988633; Wed, 14 Aug 2013 13:43:08 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id ua4sm16526590lbb.17.2013.08.14.13.43.06 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 13:43:07 -0700 (PDT) Sender: Mikolaj Golub Date: Wed, 14 Aug 2013 23:43:05 +0300 From: Mikolaj Golub To: Marko Zec Subject: Re: RFC: ipfw nat VIMAGE improvements Message-ID: <20130814204303.GA13541@gmail.com> References: <20130811200111.GA49895@gmail.com> <201308141728.31361.zec@fer.hr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <201308141728.31361.zec@fer.hr> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 20:43:11 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Aug 14, 2013 at 05:28:31PM +0200, Marko Zec wrote: > On Sunday 11 August 2013 22:01:12 Mikolaj Golub wrote: > > Hi, > > > > I would like to commit this patch that fixes some issues related to > > ipfw nat module load/unload on VIMAGE featured system. > > > > Any comments, objections? > > Far from being an expert in ipfw, I'm worried that the proposed approach of > simultaneously acquiring locks on _all_ ipfw instances might be calling for > trouble: > > + VNET_LIST_RLOCK(); > + VNET_FOREACH(vnet_iter) { > + CURVNET_SET(vnet_iter); > + IPFW_WLOCK(&V_layer3_chain); > + CURVNET_RESTORE(); > + } > ipfw_nat_ptr = ipfw_nat; > lookup_nat_ptr = lookup_nat; > ipfw_nat_cfg_ptr = ipfw_nat_cfg; > ipfw_nat_del_ptr = ipfw_nat_del; > ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg; > ipfw_nat_get_log_ptr = ipfw_nat_get_log; > - IPFW_WUNLOCK(&V_layer3_chain); > - V_ifaddr_event_tag = EVENTHANDLER_REGISTER( > + VNET_FOREACH(vnet_iter) { > + CURVNET_SET(vnet_iter); > + IPFW_WUNLOCK(&V_layer3_chain); > + CURVNET_RESTORE(); > + } > + VNET_LIST_RUNLOCK(); > > Why couldn't we introduce a per-vnet flag, say V_ipfw_nat_ready, and use it > as > > #define IPFW_NAT_LOADED (V_ipfw_nat_ready) > > instead of current version of that macro: > > #define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) > > I.e., perhaps in ipfw_nat_init() we could first set all the function > pointers, and then iterate over all vnets and set V_ipfw_nat ready there. > In ipfw_nat_destroy() we would first iterate over all vnets to clear the > flag, before clearing function pointers? I like you approach. Though insted of iterating vnets in ipfw_nat_init/destroy I think it is safe just to set/unset V_ipfw_nat_ready in vnet_ipfw_nat_init/uninit. -- Mikolaj Golub --1yeeQ81UyVL57Vl7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="ip_fw_nat.c.VIMAGE.2.patch" commit 76323cd328717de5b77d0d1e2e23150c482c630a Author: Mikolaj Golub Date: Sun Aug 4 13:49:50 2013 +0300 Make ipfw nat init/unint work correctly for VIMAGE: * Do per vnet instance cleanup (previously it was only for vnet0 on module unload, and led to libalias leaks and possible panics due to stale pointer dereferences). * Instead of protecting ipfw hooks registering/deregistering by only vnet0 lock (which does not prevent pointers access from another vnets), introduce per vnet ipfw_nat_loaded variable. The variable is set after hooks are registered and unset before they are deregistered. * Devirtualize ifaddr_event_tag as we run only one event handler for all vnets. * It is supposed that ifaddr_change event handler is called in the interface vnet context, so add the assertion. diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 6317013..b9dc18e 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -142,6 +142,8 @@ VNET_DEFINE(int, verbose_limit); /* layer3_chain contains the list of rules for layer 3 */ VNET_DEFINE(struct ip_fw_chain, layer3_chain); +VNET_DEFINE(int, ipfw_nat_loaded) = 0; + ipfw_nat_t *ipfw_nat_ptr = NULL; struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index 84852db..155eddd 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ -static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); -#define V_ifaddr_event_tag VNET(ifaddr_event_tag) +static eventhandler_tag ifaddr_event_tag; static void ifaddr_change(void *arg __unused, struct ifnet *ifp) @@ -63,6 +62,8 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp) struct ifaddr *ifa; struct ip_fw_chain *chain; + KASSERT(curvnet == ifp->if_vnet, + ("curvnet(%p) differs from iface vnet(%p)", curvnet, ifp->if_vnet)); chain = &V_layer3_chain; IPFW_WLOCK(chain); /* Check every nat entry... */ @@ -589,11 +590,38 @@ ipfw_nat_get_log(struct sockopt *sopt) return(0); } +static int +vnet_ipfw_nat_init(const void *arg __unused) +{ + + V_ipfw_nat_ready = 1; + return (0); +} + +static int +vnet_ipfw_nat_uninit(const void *arg __unused) +{ + struct cfg_nat *ptr, *ptr_temp; + struct ip_fw_chain *chain; + + chain = &V_layer3_chain; + IPFW_WLOCK(chain); + LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) { + LIST_REMOVE(ptr, _next); + del_redir_spool_cfg(ptr, &ptr->redir_chain); + LibAliasUninit(ptr->lib); + free(ptr, M_IPFW); + } + flush_nat_ptrs(chain, -1 /* flush all */); + V_ipfw_nat_ready = 0; + IPFW_WUNLOCK(chain); + return (0); +} + static void ipfw_nat_init(void) { - IPFW_WLOCK(&V_layer3_chain); /* init ipfw hooks */ ipfw_nat_ptr = ipfw_nat; lookup_nat_ptr = lookup_nat; @@ -601,28 +629,16 @@ ipfw_nat_init(void) ipfw_nat_del_ptr = ipfw_nat_del; ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg; ipfw_nat_get_log_ptr = ipfw_nat_get_log; - IPFW_WUNLOCK(&V_layer3_chain); - V_ifaddr_event_tag = EVENTHANDLER_REGISTER( - ifaddr_event, ifaddr_change, + + ifaddr_event_tag = EVENTHANDLER_REGISTER(ifaddr_event, ifaddr_change, NULL, EVENTHANDLER_PRI_ANY); } static void ipfw_nat_destroy(void) { - struct cfg_nat *ptr, *ptr_temp; - struct ip_fw_chain *chain; - chain = &V_layer3_chain; - IPFW_WLOCK(chain); - LIST_FOREACH_SAFE(ptr, &chain->nat, _next, ptr_temp) { - LIST_REMOVE(ptr, _next); - del_redir_spool_cfg(ptr, &ptr->redir_chain); - LibAliasUninit(ptr->lib); - free(ptr, M_IPFW); - } - EVENTHANDLER_DEREGISTER(ifaddr_event, V_ifaddr_event_tag); - flush_nat_ptrs(chain, -1 /* flush all */); + EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_event_tag); /* deregister ipfw_nat */ ipfw_nat_ptr = NULL; lookup_nat_ptr = NULL; @@ -630,7 +646,6 @@ ipfw_nat_destroy(void) ipfw_nat_del_ptr = NULL; ipfw_nat_get_cfg_ptr = NULL; ipfw_nat_get_log_ptr = NULL; - IPFW_WUNLOCK(chain); } static int @@ -640,11 +655,9 @@ ipfw_nat_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: - ipfw_nat_init(); break; case MOD_UNLOAD: - ipfw_nat_destroy(); break; default: @@ -660,8 +673,25 @@ static moduledata_t ipfw_nat_mod = { 0 }; -DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +/* Define startup order. */ +#define IPFW_NAT_SI_SUB_FIREWALL SI_SUB_PROTO_IFATTACHDOMAIN +#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 255) +#define IPFW_NAT_MODULE_ORDER (IPFW_NAT_MODEVENT_ORDER + 1) +#define IPFW_NAT_VNET_ORDER (IPFW_NAT_MODEVENT_ORDER + 2) + +DECLARE_MODULE(ipfw_nat, ipfw_nat_mod, IPFW_NAT_SI_SUB_FIREWALL, SI_ORDER_ANY); MODULE_DEPEND(ipfw_nat, libalias, 1, 1, 1); MODULE_DEPEND(ipfw_nat, ipfw, 2, 2, 2); MODULE_VERSION(ipfw_nat, 1); + +SYSINIT(ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER, + ipfw_nat_init, NULL); +VNET_SYSINIT(vnet_ipfw_nat_init, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_VNET_ORDER, + vnet_ipfw_nat_init, NULL); + +SYSUNINIT(ipfw_nat_destroy, IPFW_NAT_SI_SUB_FIREWALL, IPFW_NAT_MODULE_ORDER, + ipfw_nat_destroy, NULL); +VNET_SYSUNINIT(vnet_ipfw_nat_uninit, IPFW_NAT_SI_SUB_FIREWALL, + IPFW_NAT_VNET_ORDER, vnet_ipfw_nat_uninit, NULL); + /* end of file */ diff --git a/sys/netpfil/ipfw/ip_fw_private.h b/sys/netpfil/ipfw/ip_fw_private.h index a41cdf5..a8d7eea 100644 --- a/sys/netpfil/ipfw/ip_fw_private.h +++ b/sys/netpfil/ipfw/ip_fw_private.h @@ -327,9 +327,11 @@ extern struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *); typedef int ipfw_nat_cfg_t(struct sockopt *); -extern ipfw_nat_t *ipfw_nat_ptr; -#define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) +VNET_DECLARE(int, ipfw_nat_ready); +#define V_ipfw_nat_ready VNET(ipfw_nat_ready) +#define IPFW_NAT_LOADED (V_ipfw_nat_ready) +extern ipfw_nat_t *ipfw_nat_ptr; extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr; extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; --1yeeQ81UyVL57Vl7-- From owner-freebsd-virtualization@FreeBSD.ORG Wed Aug 14 22:25:25 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA53D313; Wed, 14 Aug 2013 22:25:25 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE0E2BA8; Wed, 14 Aug 2013 22:25:24 +0000 (UTC) Received: from x23.lan (89.164.9.9) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Thu, 15 Aug 2013 00:25:21 +0200 From: Marko Zec To: Mikolaj Golub Subject: Re: RFC: ipfw nat VIMAGE improvements Date: Thu, 15 Aug 2013 00:25:34 +0200 User-Agent: KMail/1.9.10 References: <20130811200111.GA49895@gmail.com> <201308141728.31361.zec@fer.hr> <20130814204303.GA13541@gmail.com> In-Reply-To: <20130814204303.GA13541@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201308150025.34517.zec@fer.hr> X-Originating-IP: [89.164.9.9] Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2013 22:25:25 -0000 On Wednesday 14 August 2013 22:43:05 Mikolaj Golub wrote: > On Wed, Aug 14, 2013 at 05:28:31PM +0200, Marko Zec wrote: > > On Sunday 11 August 2013 22:01:12 Mikolaj Golub wrote: > > > Hi, > > > > > > I would like to commit this patch that fixes some issues related to > > > ipfw nat module load/unload on VIMAGE featured system. > > > > > > Any comments, objections? > > > > Far from being an expert in ipfw, I'm worried that the proposed > > approach of simultaneously acquiring locks on _all_ ipfw instances > > might be calling for trouble: > > > > + VNET_LIST_RLOCK(); > > + VNET_FOREACH(vnet_iter) { > > + CURVNET_SET(vnet_iter); > > + IPFW_WLOCK(&V_layer3_chain); > > + CURVNET_RESTORE(); > > + } > > ipfw_nat_ptr = ipfw_nat; > > lookup_nat_ptr = lookup_nat; > > ipfw_nat_cfg_ptr = ipfw_nat_cfg; > > ipfw_nat_del_ptr = ipfw_nat_del; > > ipfw_nat_get_cfg_ptr = ipfw_nat_get_cfg; > > ipfw_nat_get_log_ptr = ipfw_nat_get_log; > > - IPFW_WUNLOCK(&V_layer3_chain); > > - V_ifaddr_event_tag = EVENTHANDLER_REGISTER( > > + VNET_FOREACH(vnet_iter) { > > + CURVNET_SET(vnet_iter); > > + IPFW_WUNLOCK(&V_layer3_chain); > > + CURVNET_RESTORE(); > > + } > > + VNET_LIST_RUNLOCK(); > > > > Why couldn't we introduce a per-vnet flag, say V_ipfw_nat_ready, and > > use it as > > > > #define IPFW_NAT_LOADED (V_ipfw_nat_ready) > > > > instead of current version of that macro: > > > > #define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL) > > > > I.e., perhaps in ipfw_nat_init() we could first set all the function > > pointers, and then iterate over all vnets and set V_ipfw_nat ready > > there. In ipfw_nat_destroy() we would first iterate over all vnets to > > clear the flag, before clearing function pointers? > > I like you approach. Though insted of iterating vnets in > ipfw_nat_init/destroy I think it is safe just to set/unset > V_ipfw_nat_ready in vnet_ipfw_nat_init/uninit. Yup that should be safe, provided you're 100% sure that vnet_ipfw_nat_uninit() fires before ipfw_nat_destroy() - admittedly my sysinit ordering insight got a bit rusty so I can't tell at the first glance... Anyhow, this looks fine to me... Marko From owner-freebsd-virtualization@FreeBSD.ORG Thu Aug 15 19:34:13 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F291D107 for ; Thu, 15 Aug 2013 19:34:13 +0000 (UTC) (envelope-from jlott@averesystems.com) Received: from mail.averesystems.com (mail.averesystems.com [208.70.68.85]) by mx1.freebsd.org (Postfix) with ESMTP id CACDB2517 for ; Thu, 15 Aug 2013 19:34:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.averesystems.com (Postfix) with ESMTP id 05B0C482122 for ; Thu, 15 Aug 2013 15:27:56 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.averesystems.com Received: from mail.averesystems.com ([127.0.0.1]) by localhost (mail.averesystems.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XxEi-OT73A0y for ; Thu, 15 Aug 2013 15:27:55 -0400 (EDT) Received: from jlott-mac.arriad.com (206.193.225.214.nauticom.net [206.193.225.214]) by mail.averesystems.com (Postfix) with ESMTPSA id 76A17481E2C for ; Thu, 15 Aug 2013 15:27:55 -0400 (EDT) From: Jeremiah Lott Content-Type: multipart/mixed; boundary="Apple-Mail=_2B96711E-47DD-45CA-B64C-85A2C897A624" Subject: legacy irq patch and e1000 emulation Message-Id: Date: Thu, 15 Aug 2013 15:27:54 -0400 To: freebsd-virtualization@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) X-Mailer: Apple Mail (2.1508) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2013 19:34:14 -0000 --Apple-Mail=_2B96711E-47DD-45CA-B64C-85A2C897A624 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here is a small patch for automatic legacy irq assignment. I found that = when I called: pci_lintr_request(pi, -1); It was always asserting and not able to find an irq. It is because the = pci devices were being initialized before the lirq structure in = pci_emul.c. The attached patch fixes the problem. Related, I noticed Peter mentioned Intel NIC emulation work in a recent = email. Is there work going on in this area? I've been kind of hacking = on an implementation for a 82545EM card. Freebsd drive lem driver can = probe it at this point, but it's still got a long way to go before it is = functional. I'd hate to be duplicating work that is already done, = though. Thanks, Jeremiah --Apple-Mail=_2B96711E-47DD-45CA-B64C-85A2C897A624 Content-Disposition: attachment; filename=legacy-irq.patch Content-Type: application/octet-stream; name="legacy-irq.patch" Content-Transfer-Encoding: 7bit commit 464abfd82c54bf605a3f8ffd372b588eda3d86b5 Author: Jeremiah Lott Date: Wed Aug 14 20:04:37 2013 -0400 Fix automatic legacy interrupt assignment. diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 00adf62..005e8b1 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -1008,6 +1008,16 @@ init_pci(struct vmctx *ctx) pci_emul_membase32 = vm_get_lowmem_limit(ctx); pci_emul_membase64 = PCI_EMUL_MEMBASE64; + /* + * Allow ISA IRQs 5,10,11,12, and 15 to be available for + * generic use + */ + lirq[5].li_generic = 1; + lirq[10].li_generic = 1; + lirq[11].li_generic = 1; + lirq[12].li_generic = 1; + lirq[15].li_generic = 1; + for (slot = 0; slot < MAXSLOTS; slot++) { for (func = 0; func < MAXFUNCS; func++) { si = &pci_slotinfo[slot][func]; @@ -1023,16 +1033,6 @@ init_pci(struct vmctx *ctx) } /* - * Allow ISA IRQs 5,10,11,12, and 15 to be available for - * generic use - */ - lirq[5].li_generic = 1; - lirq[10].li_generic = 1; - lirq[11].li_generic = 1; - lirq[12].li_generic = 1; - lirq[15].li_generic = 1; - - /* * The guest physical memory map looks like the following: * [0, lowmem) guest system memory * [lowmem, lowmem_limit) memory hole (may be absent) --Apple-Mail=_2B96711E-47DD-45CA-B64C-85A2C897A624-- From owner-freebsd-virtualization@FreeBSD.ORG Fri Aug 16 00:40:52 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9C3BB1F for ; Fri, 16 Aug 2013 00:40:52 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 7D36A2337 for ; Fri, 16 Aug 2013 00:40:52 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id A757C1271F; Fri, 16 Aug 2013 10:40:44 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local ([64.245.0.210]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BOA20164 (AUTH peterg@ptree32.com.au); Fri, 16 Aug 2013 10:40:43 +1000 Message-ID: <520D7509.3030207@freebsd.org> Date: Thu, 15 Aug 2013 17:40:41 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Jeremiah Lott Subject: Re: legacy irq patch and e1000 emulation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2013 00:40:52 -0000 Hi Jeremiah, > Here is a small patch for automatic legacy irq assignment. Thanks - submitted in r254395. > Related, I noticed Peter mentioned Intel NIC emulation work > in a recent email. Is there work going on in this area? > I've been kind of hacking on an implementation for a 82545EM card. > Freebsd drive lem driver can probe it at this point, but it's > still got a long way to go before it is functional. I'd hate to > be duplicating work that is already done, though. I have the start of an 82580 (igb) emulation. The intent was to do a modern adaptor - multiple queues, jumbo frames, stateless offload etc, and hopefully be able to dumb it down to the standard 82540 "e1000" with a run-time switch for compatibility. I'm not so sure the latter is feasible now, so our efforts may be complementary. In any event, there's some work needed to abstract the network backend so new device emulations don't have to replicate the virtio tap code. This would also allow additional backends to be dropped in (e.g. netmap). I'll send you what I've done and we can work out if a merge could be done, or if there should be separate emulations. BTW - thanks for looking into this ! later, Peter. From owner-freebsd-virtualization@FreeBSD.ORG Fri Aug 16 13:00:58 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA3C1979 for ; Fri, 16 Aug 2013 13:00:58 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from mail-vb0-x22c.google.com (mail-vb0-x22c.google.com [IPv6:2607:f8b0:400c:c02::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D8172574 for ; Fri, 16 Aug 2013 13:00:58 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id e13so1601163vbg.31 for ; Fri, 16 Aug 2013 06:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=4sZxGnFrY2ixhaOEKBNqK6tf+IlmQOIKTT1I02J1gAI=; b=0kfROyDpxQSqzG89O9VG6gHsHWQMEBEoG9qIWnEZBv5ouARvz1oCgzD7SqeQiWSKmx pnaqwAqFPkYWUaJ39jm8W/ZrGUU3JhyMnGut8AmHPT/FWyFMiFZnU2YErwh2W4UFiaps DqTAy1qlF0rcWiS80w8aFp/7meW1oaCzkIe+xVCIKscb9XCYogacBoplgcMzAa3IcAHi 4dwE0rhn48QdRP9m9m79LxCmPWIp7PWoAVD/f0Kz8TyzB9gqyAExdqxpKsURI4gYH3hl ORpT31ZIgn0h0yvmNOZc7oHp4iO7mimpsKtkRKRMopnhD8H2YgzYUTxsG4zodUT6DFqR cnJg== MIME-Version: 1.0 X-Received: by 10.58.164.101 with SMTP id yp5mr1148193veb.0.1376658057720; Fri, 16 Aug 2013 06:00:57 -0700 (PDT) Received: by 10.52.38.134 with HTTP; Fri, 16 Aug 2013 06:00:57 -0700 (PDT) Date: Fri, 16 Aug 2013 17:00:57 +0400 Message-ID: Subject: Hyper-V driver development status From: Pavel Timofeev To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2013 13:00:58 -0000 Hi all! I'd like to know what's happening with hyper-v driver development in FreeBSD. I know about svn branch but there is no active progress in there. What's the roadmap? Or we are waiting for something? What is the current status of that project? I could do some tests. Or it's too early? I'm looking forward to use it =) From owner-freebsd-virtualization@FreeBSD.ORG Sat Aug 17 16:29:06 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9EF44F05; Sat, 17 Aug 2013 16:29:06 +0000 (UTC) (envelope-from abgupta@microsoft.com) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0211.outbound.protection.outlook.com [207.46.163.211]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A7172F65; Sat, 17 Aug 2013 16:29:05 +0000 (UTC) Received: from BL2PR03MB210.namprd03.prod.outlook.com (10.255.230.144) by BL2PR03MB211.namprd03.prod.outlook.com (10.255.230.146) with Microsoft SMTP Server (TLS) id 15.0.745.25; Sat, 17 Aug 2013 16:28:52 +0000 Received: from BL2PR03MB210.namprd03.prod.outlook.com ([169.254.1.81]) by BL2PR03MB210.namprd03.prod.outlook.com ([169.254.1.105]) with mapi id 15.00.0745.000; Sat, 17 Aug 2013 16:28:52 +0000 From: "Abhishek Gupta (LIS)" To: Pavel Timofeev , Peter Grehan , "freebsd-virtualization@freebsd.org" Subject: RE: Hyper-V driver development status Thread-Topic: Hyper-V driver development status Thread-Index: AQHOmq7Ipy0oaFkGS0+Ecmk4X0c6g5mZllfR Date: Sat, 17 Aug 2013 16:28:51 +0000 Message-ID: References: , <520E6FB0.2080305@freebsd.org> In-Reply-To: <520E6FB0.2080305@freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [71.227.189.27] x-forefront-prvs: 0941B96580 x-forefront-antispam-report: SFV:NSPM; SFS:(13464003)(45074003)(199002)(189002)(52604005)(377454003)(53754006)(43784003)(51856001)(59766001)(74366001)(77982001)(76796001)(19580385001)(19580405001)(83322001)(33646001)(19580395003)(76786001)(76576001)(81686001)(46102001)(63696002)(83072001)(47976001)(50986001)(47736001)(81542001)(74316001)(4396001)(54316002)(74706001)(15202345003)(79102001)(74876001)(69226001)(54356001)(53806001)(56816003)(65816001)(66066001)(49866001)(77096001)(80022001)(56776001)(74502001)(47446002)(80976001)(31966008)(81342001)(74662001)(81816001)(76482001)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BL2PR03MB211; H:BL2PR03MB210.namprd03.prod.outlook.com; CLIP:71.227.189.27; RD:InfoNoRecords; A:1; MX:1; LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: DuplicateDomain-a84fc36a-4ed7-4e57-ab1c-3e967bcbad48.microsoft.com X-MS-Exchange-CrossPremises-AuthAs: Internal X-MS-Exchange-CrossPremises-AuthMechanism: 04 X-MS-Exchange-CrossPremises-AuthSource: BL2PR03MB210.namprd03.prod.outlook.com X-MS-Exchange-CrossPremises-SCL: 1 X-MS-Exchange-CrossPremises-messagesource: StoreDriver X-MS-Exchange-CrossPremises-BCC: X-MS-Exchange-CrossPremises-originalclientipaddress: 71.227.189.27 X-MS-Exchange-CrossPremises-avstamp-service: 1.0 X-MS-Exchange-CrossPremises-antispam-scancontext: DIR:Originating; SFV:NSPM; SKIP:0; X-MS-Exchange-CrossPremises-processed-by-journaling: Journal Agent X-MS-Exchange-CrossPremises-ContentConversionOptions: False; 00160000; True; ; iso-8859-1 X-OrganizationHeadersPreserved: BL2PR03MB211.namprd03.prod.outlook.com X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Aug 2013 16:29:06 -0000 Hi Pavel,=0A= =0A= Thanks for inquiring about the BSD drivers for Hyper-V. We (Microsoft) are = actively working on these drivers and the intent is to get them integrated = in to the kernel within the next month or so. There are some issues we are = trying to address:=0A= =0A= a) Witness panic during boot time due to a specific memory allocation.=0A= b) Bypass usage of disk labels to ensure that devices do not get reordered = under FreeBSD.=0A= c) Locks up on 32 bit builds.=0A= d) Lack of KVP support for BSD drivers=0A= =0A= We are working hard every day to finish these items.=0A= =0A= Even though an official announcement has not gone out, I would highly encou= rage you to start testing the drivers. As they are in project branch now th= ey should be easy to compile. The only requirement is to set up disk labels= before rebooting a kernel that includes the Hyper-V drivers otherwise the = system will not boot up.=0A= =0A= Please let me know if you have more questions or have feedback.=0A= =0A= Thanks again for your interest.=0A= Abhishek=0A= ________________________________________=0A= From: Peter Grehan =0A= Sent: Friday, August 16, 2013 11:30 AM=0A= To: Abhishek Gupta (LIS)=0A= Subject: Fwd: Hyper-V driver development status=0A= =0A= Want to reply to this ?=0A= =0A= =0A= -------- Original Message --------=0A= Subject: Hyper-V driver development status=0A= Date: Fri, 16 Aug 2013 17:00:57 +0400=0A= From: Pavel Timofeev =0A= To: freebsd-virtualization@freebsd.org=0A= =0A= Hi all!=0A= I'd like to know what's happening with hyper-v driver development in=0A= FreeBSD.=0A= I know about svn branch but there is no active progress in there.=0A= What's the roadmap? Or we are waiting for something?=0A= =0A= What is the current status of that project?=0A= I could do some tests. Or it's too early?=0A= I'm looking forward to use it =3D)=0A= _______________________________________________=0A= freebsd-virtualization@freebsd.org mailing list=0A= http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization=0A= To unsubscribe, send any mail to=0A= "freebsd-virtualization-unsubscribe@freebsd.org"=0A= =0A= =0A= =0A=