<!-- Mail as an attachment to: monthly@freebsd.org -->
<project cat='kern'>
  <title>FreeBSD Integration Services (BIS) </title>

  <contact>
    <person>
      <name>
        <given>Dexuan</given>
        <common>Cui</common>
      </name>
      <email>decui@microsoft.com</email>
    </person>
    <person>
      <name>
        <given>Hongjiang</given>
        <common>Zhang</common>
      </name>
      <email>honzhan@microsoft.com</email>
    </person>
  </contact>

  <links>
    <url href="https://wiki.freebsd.org/HyperV">FreeBSD Virtual Machines on Microsoft Hyper-V</url>
    <url href="https://technet.microsoft.com/en-us/library/dn531030.aspx">Linux and FreeBSD Virtual Machines on Hyper-V</url>
  </links>

  <body>
    <p>
      <p>
      When FreeBSD virtual machines (VMs) runs on Hyper-V,  in order to get the best network and storage performance and make full use of all benefits that Hyper-V provides, it is recommended to use Hyper-V synthetic devices. The collection of drivers that are required to run Hyper-V synthetic devices in FreeBSD are known as FreeBSD Integration Services (BIS). Some of the BIS drivers (like network and storage drivers) has existed in FreeBSD 9.x and 10.x for years, but there are still some performance and stability issues and bugs. And, compared with Windows and Linux VMs, the current BIS lacks some important features, like the virtual Receive Side Scaling (vRSS) support in the Hyper-V network driver and the support of UEFI VM (boot from UEFI), etc.
      </p>

      <p>
      We are now working more on the issues and performance tuning to make FreeBSD VM run better on Hyper-V and the Hyper-V based cloud platform Azure.
      </p>

      <p>
      Our work during 2015Q4 is documented below:
      </p>


      <p>
      Optimizing the VMBus driver and Hyper-V network driver for performance:<br>

      Sent out patches to enable INTR_MPSAFE for the interrupt handling thread, speed up relid-to-channel lookup in the thread by map table, and optimize the VMBus ringbuffer writable notification to the host.<br>

      Developing a patch to enable the virtual Receive Side Scaling (vRSS) for Hyper-V network device driver. This will greatly improve the network performance for SMP virtual machine (VM).<br>

      Sent out a patch to enable Hyper-V timer, which will improve the accuracy of timer when FreeBSD VM runs on Hyper-V.<br>
      </p>


      <p>
      Fixing bugs and cleaning up the code: <br>

      Fixed a checksum offloading bug (PR 203630 - [Hyper-V] [nat] [tcp] 10.2 NAT bug in TCP stack or hyperv netsvc driver) in Hyper-V network driver and this makes FreeBSD VM based NAT gateway work more reliably. <br>

      Fixed a serialization issue in the initialization of VMBus devices and this fixed PR 205156 ([Hyper-V] NICs' (hn0, hn1) MAC addresses can appear in an uncertain way across reboot). <br>

      Fixed a KVP (Key-Value Pair) issue (retrieving a key??s value can hang for an uncertain period of time).<br>

      Added the ioctl support of SIOCGIFMEDIA for Hyper-V network and this fixed PR 187006 ([Hyper-V] dynamic address (DHCP) obtaining doesn't work on HYPER-V OS 2012 R2).<br>

      Sent out patches to add interrupt counter for Hyper-V VMBus interrupt (so the user can easily get the statistics information about VMBus interrupt), and fix KVP daemon??s poll timeout (so the daemon will avoid unnecessary polling every 100 milliseconds.<br>

      Identified a TSC calibration issue: the i8254 PIT timer emulation of Hyper-V isn??t so reliable, so Hyper-V time counter should be used to calibration TSC. A patch was drafted. With the patch, it looks the warning kernel message (e.g., ??calcru: runtime went backwards from 46204978 usec to 23362331 usec for pid 0 (kernel)??) will go away and the time based tracing by Dtrace will be more accurate.<br>

      Plan to add the support of UEFI VM (a.k.a., Hyper-V Generation-2 VM). Currently some issues and To-Do items were identified: e.g., we can??t use i8254 PIT to calibration TSC because i8254 PIT doesn??t exist for a UEFI VM, and we need to add the support of Hyper-V synthetic keyboard/mouse/framebuffer device.<br>

      Working on a disk detection issue: when FreeBSD VM runs on Windows Server 2016 Technical Preview host, the VM will detect 16 disks while only 1 disk is configured for the VM. Due to the issue, the VM running on the hosts can fail to boot. A workaround patch was made and we are trying to make a formal fix.<br>
      </p>

      <p>
      Tidying up some internal BIS test cases and going to publish them on github.
      </p>
    </p>
  </body>

  <sponsor>
    Microsoft
  </sponsor>

  <help></help>
</project>
