Project

General

Profile

Actions

Feature #13738

open

Wire up bhyve's network backends for illumos

Added by Andy Fiddaman 16 days ago. Updated 14 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
bhyve
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

As per the divergence note in usr/src/cmd/bhyve/README.sync:

A previous sync skipped commit 0ff7076bdbc6dae5ea44c0acdb567e1cede199d1 which
introduced a generic backend functionality to network devices.  Without that in
place, subsequent updates reflect the absence of that subsystem.  Integrating
net backends has not been a priority, given the common use of viona on illumos.

Wiring these up would restore options for a working e1000 interface as well as the non-viona virtio-net, and would remove a load of divergence between illumos and FreeBSD sources.

Actions #1

Updated by Jorge Schrauwen 15 days ago

Applied on SmartOS and booted a VM in the GZ to test.

Both virtio-net and e1000 are working:

hostb0@pci0:0:0:0:      class=0x060000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x1237 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = '440FX - 82441FX PMC [Natoma]'
    class      = bridge
    subclass   = HOST-PCI
nvme0@pci0:0:4:0:       class=0x010802 rev=0x00 hdr=0x00 vendor=0xfb5d device=0x0a0a subvendor=0x0000 subdevice=0x0000
    class      = mass storage
    subclass   = NVM
    bar   [10] = type Prefetchable Memory, range 64, base 0xc0000000, size 16384, enabled
    bar   [20] = type Memory, range 32, base 0xc0004000, size 8192, enabled
em0@pci0:0:6:0: class=0x020000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x100f subvendor=0x8086 subdevice=0x1008
    vendor     = 'Intel Corporation'
    device     = '82545EM Gigabit Ethernet Controller (Copper)'
    class      = network
    subclass   = ethernet
    bar   [10] = type Memory, range 32, base 0xc0020000, size 131072, enabled
    bar   [14] = type Memory, range 32, base 0xc0040000, size 65536, enabled
    bar   [18] = type I/O Port, range 32, base 0x2000, size 8, enabled
em1@pci0:0:6:1: class=0x020000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x100f subvendor=0x8086 subdevice=0x1008
    vendor     = 'Intel Corporation'
    device     = '82545EM Gigabit Ethernet Controller (Copper)'
    class      = network
    subclass   = ethernet
    bar   [10] = type Memory, range 32, base 0xc0060000, size 131072, enabled
    bar   [14] = type Memory, range 32, base 0xc0080000, size 65536, enabled
    bar   [18] = type I/O Port, range 32, base 0x2008, size 8, enabled
xhci0@pci0:0:8:0:       class=0x0c0330 rev=0x02 hdr=0x00 vendor=0x1912 device=0x0015 subvendor=0x1912 subdevice=0x0015
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720202 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Prefetchable Memory, range 64, base 0xc0090000, size 8192, enabled
isab0@pci0:0:31:0:      class=0x060100 rev=0x00 hdr=0x00 vendor=0x8086 device=0x7000 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = '82371SB PIIX3 ISA [Natoma/Triton II]'
    class      = bridge
    subclass   = PCI-ISA

No output for virtio-net as promisc is also working and the VM uses CARP so it puts the nic in promisc mode then spams the console with DAD messages because it sees dup traffic (1x vnic's vlan untagged + 1x vnic's vlan tagged) resulting in the guest seeing it's own DAD check and looping. Which is the same issue we hit on KVM with vnd and promisc. (Big sad)

So both see to work! Can't speak for the performance.

Actions #2

Updated by Jorge Schrauwen 15 days ago

Same out with with virtio-net... which I now realize looks the same as with virtio-net-viona... but I commented the ip/carp setup and managed to also test the gets traffic with tcpdump (both in promisc an non promisc open) and it looks to be OK.

hostb0@pci0:0:0:0:      class=0x060000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x1237 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = '440FX - 82441FX PMC [Natoma]'
    class      = bridge
    subclass   = HOST-PCI
nvme0@pci0:0:4:0:       class=0x010802 rev=0x00 hdr=0x00 vendor=0xfb5d device=0x0a0a subvendor=0x0000 subdevice=0x0000
    class      = mass storage
    subclass   = NVM
    bar   [10] = type Prefetchable Memory, range 64, base 0xc0000000, size 16384, enabled
    bar   [20] = type Memory, range 32, base 0xc0004000, size 8192, enabled
virtio_pci0@pci0:0:6:0: class=0x020000 rev=0x00 hdr=0x00 vendor=0x1af4 device=0x1000 subvendor=0x1af4 subdevice=0x0001
    vendor     = 'Red Hat, Inc.'
    device     = 'Virtio network device'
    class      = network
    subclass   = ethernet
    bar   [10] = type I/O Port, range 32, base 0x2000, size 64, enabled
    bar   [14] = type Memory, range 32, base 0xc0006000, size 8192, enabled
virtio_pci1@pci0:0:6:1: class=0x020000 rev=0x00 hdr=0x00 vendor=0x1af4 device=0x1000 subvendor=0x1af4 subdevice=0x0001
    vendor     = 'Red Hat, Inc.'
    device     = 'Virtio network device'
    class      = network
    subclass   = ethernet
    bar   [10] = type I/O Port, range 32, base 0x2040, size 64, enabled
    bar   [14] = type Memory, range 32, base 0xc0008000, size 8192, enabled
xhci0@pci0:0:8:0:       class=0x0c0330 rev=0x02 hdr=0x00 vendor=0x1912 device=0x0015 subvendor=0x1912 subdevice=0x0015
    vendor     = 'Renesas Technology Corp.'
    device     = 'uPD720202 USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
    bar   [10] = type Prefetchable Memory, range 64, base 0xc000a000, size 8192, enabled
isab0@pci0:0:31:0:      class=0x060100 rev=0x00 hdr=0x00 vendor=0x8086 device=0x7000 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Intel Corporation'
    device     = '82371SB PIIX3 ISA [Natoma/Triton II]'
    class      = bridge
    subclass   = PCI-ISA

Edit: promisc seems to work but there seems to be duplicate traffic, I believe this is to be expected.
However even when the nics are not in promisc mode, a simple static ip and ip6. There are still errors that are not present when using viona, DAD is tripping up. I looks like it is seeing it's own DAD checks and not adding the IPs. e.g.

This is viona and works fine

root@olivine:~ # ifconfig vtnet1
vtnet1: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4c05bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,LRO,VLAN_HWTSO,LINKSTATE,TXCSUM_IPV6>
        ether 02:08:20:fc:c6:09
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
root@olivine:~ # ifconfig vtnet1 inet6 2a02:578:470f:40::44/64 up
root@olivine:~ # ifconfig vtnet1
vtnet1: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4c05bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,LRO,VLAN_HWTSO,LINKSTATE,TXCSUM_IPV6>
        ether 02:08:20:fc:c6:09
        inet6 2a02:578:470f:40::44 prefixlen 64
        inet6 fe80::8:20ff:fefc:c609%vtnet1 prefixlen 64 scopeid 0x2
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

This is e1000 (same result with virtio-net)

root@olivine:~ # ifconfig em1
em1: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
        ether 02:08:20:fc:c6:09
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
root@olivine:~ # ifconfig em1 inet6 2a02:578:470f:40::44/64 up
root@olivine:~ # Apr 22 18:06:16 olivine kernel: em1: a looped back NS message is detected during DAD for fe80:2::8:20ff:fefc:c609.  Another DAD probes are being sent.
root@olivine:~ # ifconfig em1
em1: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
        ether 02:08:20:fc:c6:09
        inet6 2a02:578:470f:40::44 prefixlen 64
        inet6 fe80::8:20ff:fefc:c609%em1 prefixlen 64 tentative scopeid 0x2
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

Notice the DAD error and the IP marked as tentative

Actions #3

Updated by Electric Monk 14 days ago

  • Gerrit CR set to 1432
Actions

Also available in: Atom PDF