[Bug 242023] bhyve pci_vtnet_rx broken after r354552
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Nov 18 09:06:14 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242023
--- Comment #9 from Aleksandr Fedorov <aleksandr.fedorov at itglobal.com> ---
Negotiated futures looks fine for me. VIRTIO_NET_F_MRG_RXBUF flag is zero.
But I'm worried about how we use sc->rx_merge flag.
During initialization, we set it to 1:
https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_net.c?revision=354552&view=markup#l515
Than on features negotiation, we set it to 0:
https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_net.c?revision=354552&view=markup#l575
But during the reset, we set it to 1:
https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_net.c?revision=354552&view=markup#l161
And it seems that there is a race between pci_vtnet_rx() and pci_vtnet_reset().
If pci_vtnet_rx() is called after pci_vtnet_reset() immediately, than the wrong
code path is called (RX MRG BUF enabled).
I have not yet installed windows to test this hypothesis, but using FreyBSD as
a guest system I discovered another problem.
Start vm: sh vmrun.sh -c 2 -m 4096M -t tap1001 -d freebsd-12-0.img freebsd-0
Configure tap1001: ifconfig tap1001 192.168.1.5/24 up
Ping VM: ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0.544 ms
Inside VM put vtnet0 interface down.
root at vm0:~ # ifconfig vtnet0 down
pci_vtnet_rx
pci_vtnet_reset
pci_vtnet_rx <<-- pci_vtnet_neg_features() is not called before RX.
vtnet: ndesc (1040) out of range, driver confused?
Assertion failed: (n >= 1 && cur_iov_len + n <= VTNET_MAXSEGS), function
pci_vtnet_rx, file
/afedorov/freebsd-head-clean/usr.sbin/bhyve/pci_virtio_net.c, line 239.
Abort trap
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the freebsd-virtualization
mailing list