Date: Mon, 18 Nov 2019 09:06:13 +0000 From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 242023] bhyve pci_vtnet_rx broken after r354552 Message-ID: <bug-242023-27103-yUtbOvSX6l@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-242023-27103@https.bugs.freebsd.org/bugzilla/> References: <bug-242023-27103@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242023 --- Comment #9 from Aleksandr Fedorov <aleksandr.fedorov@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?revisi= on=3D354552&view=3Dmarkup#l515 Than on features negotiation, we set it to 0: https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_net.c?revisi= on=3D354552&view=3Dmarkup#l575 But during the reset, we set it to 1: https://svnweb.freebsd.org/base/head/usr.sbin/bhyve/pci_virtio_net.c?revisi= on=3D354552&view=3Dmarkup#l161 And it seems that there is a race between pci_vtnet_rx() and pci_vtnet_rese= t(). If pci_vtnet_rx() is called after pci_vtnet_reset() immediately, than the w= rong 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=3D0 ttl=3D64 time=3D0.544 ms Inside VM put vtnet0 interface down. root@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 >=3D 1 && cur_iov_len + n <=3D VTNET_MAXSEGS), function pci_vtnet_rx, file /afedorov/freebsd-head-clean/usr.sbin/bhyve/pci_virtio_net.c, line 239. Abort trap --=20 You are receiving this mail because: You are on the CC list for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-242023-27103-yUtbOvSX6l>