Page MenuHomeFreeBSD

Hyper-V socket implementation for FreeBSD guest
ClosedPublic

Authored by whu on Mar 13 2020, 11:52 AM.

Details

Summary

Starting in Windows 10 Anniversary Update, anyone can make applications that communicate between the Hyper-V host and its virtual machines using Hyper-V sockets -- a Windows Socket with a new address family and specialized endpoint for targeting virtual machines. Details about Hyper-V socket can be found here:

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service

This change adds Hyper-V socket feature in FreeBSD. New socket address family AF_HYPERV and its kernel support are added.

Tested on HP Z4 G4 Workstation with Xeon W-2123 cores and 32GB memory.

FreeBSD VM size 4vcpu and 6000MB memory.

Performance test with hvstress user program single thread, user set ehe send and recv buff

  • Guest - > Host

snd/recv buffer size on both sides | 128byte | 1KB | 4KB | 64KB
Throughput with 20KB ringbuffer size(MB/s) | 72 | 289 | 320 | 305

  • Host - > Guest

snd/recv buffer size on both sides | 128byte | 1KB | 4KB | 64KB
Throughput with 20KB ringbuffer size(MB/s) | 74 | 369 | 700 | 1103

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 29927

Event Timeline

whu created this revision.Mar 13 2020, 11:52 AM
whu updated this revision to Diff 70595.Apr 15 2020, 11:56 AM
whu edited the summary of this revision. (Show Details)

Out for broader review

whu edited the summary of this revision. (Show Details)Apr 15 2020, 11:56 AM
whu edited the summary of this revision. (Show Details)
whu edited the summary of this revision. (Show Details)
ae added a subscriber: ae.Apr 23 2020, 12:15 PM

Do you have performance test results for already existing linux implementation?
From a quick look it seems to me there will be bottleneck regarding locking that seems can be reduced using CK and epoch. But this task can be done in future, if you plan support this code.

gbe added a subscriber: gbe.May 1 2020, 1:22 PM
whu added a comment.May 11 2020, 8:34 AM
In D24061#540008, @ae wrote:

Do you have performance test results for already existing linux implementation?
From a quick look it seems to me there will be bottleneck regarding locking that seems can be reduced using CK and epoch. But this task can be done in future, if you plan support this code.

Thanks Andrey and I am sorry for my late reply. I have been tied up with something at work.
The Lunix number is in this place:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.6-rc5&id=ac383f58f3c98de37fa67452acc5bd677396e9f3

The test was run on different hardware so it is not an apple to apple comparison. It seems a bottleneck from guest to host connection on FreeBSD. I do plan to support and maintain this code. Once I have more time I will spend more on this to improve.

This revision was not accepted when it landed; it landed in state Needs Review.May 20 2020, 11:04 AM
This revision was automatically updated to reflect the committed changes.