DragonFly kernel List (threaded) for 2011-01
Virtio drivers (virtio-net)
There's been some activity in the FreeBSD mailing lists about the virtio
drivers. A couple of people presented their drivers:
We took a look at these drivers and found that the first link seemed to
be a really clean implementation of the virtio infrastructure and
virtio-net driver. We decided to stop the porting effort of the
NetBSD-based virtio drivers and instead use the FreeBSD ones. We
successfully ported the FreeBSD virtio infrastructure and virtio-net
driver, which now works and is ready for more testers.
In order to port this driver, we had to make some changes to the kernel:
essentially add kern/subr_sglist.c from FreeBSD and make a probe
interface public. The patch file is in the top-level directory of the
git tree and was diff'd from master this morning. The file name is:
Regarding the original virtio-blk driver we ported from NetBSD. I will
probably port this to the new virtio-infrastructure, unless the FreeBSD
virtio-blk driver is posted on the FreeBSD mailing list in the near future.
Here's a link to the code:
and some notes:
Regarding performance, I don't have a good explanation yet, but
emulation with the re driver is actually faster than virtio on a simle
$ time scp 192.168.122.140:200m .
200m 100% 200MB 15.4MB/s 00:13
$ time scp 192.168.123.8:200m .
200m 100% 200MB 11.8MB/s 00:17
ifconfig from dbsd vm for above test
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::5054:ff:fe03:9900%re0 prefixlen 64 scopeid 0x1
inet 192.168.122.140 netmask 0xffffff00 broadcast 192.168.122.255
media: Ethernet autoselect (100baseTX <full-duplex>)
faith0: flags=8002<BROADCAST,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552
vtnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::5054:ff:fe33:3bd3%vtnet0 prefixlen 64 scopeid 0x6
inet 192.168.123.8 netmask 0xffffff00 broadcast 192.168.123.255
Comments and suggestions are always welcome.