Page MenuHomeFreeBSD

bhyve: Use a non-blocking read in slirp_recv()
ClosedPublic

Authored by markj on Fri, Dec 20, 5:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 7, 2:40 PM
Unknown Object (File)
Thu, Dec 26, 10:20 AM
Unknown Object (File)
Thu, Dec 26, 9:32 AM
Unknown Object (File)
Thu, Dec 26, 8:27 AM
Unknown Object (File)
Wed, Dec 25, 4:02 AM
Unknown Object (File)
Mon, Dec 23, 4:20 PM
Subscribers

Details

Summary

When using the slirp backend with the e1000 frontend, I otherwise get
hangs in readv(), caused by the e1000 emulation not checking whether
bytes are available before trying to read them. In particular, that
device model expects the recv callback to return 0 if no bytes are
available, and with slirp it would end up blocking forever. The virtio
device model uses the peek_recvlen to check first, so I didn't notice
the problem when implementing the slirp backend.

Make the slirp backend more flexible to accommodate e1000.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Fri, Dec 20, 5:19 PM
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Jan 7, 2:35 PM
This revision was automatically updated to reflect the committed changes.