This patch fixes a race condition where the receive callback is called while the device is being reset. Since the rx_merge variable may change during reset, the receive callback may operate inconsistently with what the guest expects.
Also, get rid of the unused rx_vhdrlen variable.
Details
- Reviewers
jhb markj - Group Reviewers
bhyve - Commits
- rS354864: bhyve: virtio-net: disable receive until features are negotiated
Tested with FreeBSD guests with both TAP and VALE net backends.
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
usr.sbin/bhyve/pci_virtio_net.c | ||
---|---|---|
515 | My only thought is perhaps we should assume rx_merge is not supported until we negotiate that it is. The race would not have been fatal (but is still good to fix) if the default been the more compatible behavior. That is, maybe 'rx_merge' should be 0 by default instead of 1. |
usr.sbin/bhyve/pci_virtio_net.c | ||
---|---|---|
515 | Agreed. |
The race would not have been fatal (but is still good to fix) if the default been the more compatible behavior.
I observed a situation that the virtio queue is in an inconsistent state (FreeBSD guest, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242023).
Il giorno mar 19 nov 2019 alle ore 19:21 aleksandr.fedorov_itglobal.com
(Aleksandr Fedorov) <phabric-noreply@freebsd.org> ha scritto:
aleksandr.fedorov_itglobal.com added a comment.
> The race would not have been fatal (but is still good to fix) if thedefault been the more compatible behavior.
I observed a situation that the virtio queue is in an inconsistent state(FreeBSD guest, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242023).
Do you mean that you observed additional issues after this patch?
CHANGES SINCE LAST ACTION
https://reviews.freebsd.org/D22440/new/REVISION DETAIL
https://reviews.freebsd.org/D22440EMAIL PREFERENCES
https://reviews.freebsd.org/settings/panel/emailpreferences/To: vmaffione, jhb, markj, bhyve
Cc: imp, aleksandr.fedorov_itglobal.com, rgrimes, woodsb02, bcran