Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solo5-hvt reads on network devices returns SOLO5_R_AGAIN on EOF #559

Open
reynir opened this issue May 2, 2023 · 0 comments
Open

Solo5-hvt reads on network devices returns SOLO5_R_AGAIN on EOF #559

reynir opened this issue May 2, 2023 · 0 comments

Comments

@reynir
Copy link
Contributor

reynir commented May 2, 2023

When a hypercall-initiated read on a network device returns 0 (EOF) the tender returns SOLO5_R_AGAIN. In mirage-net-solo5 this results in listen retrying the read. If the file descriptor is really closed this will end in an infinite loop.

ret = read(e->b.hostfd, HVT_CHECKED_GPA_P(hvt, rd->data, rd->len), rd->len);
if ((ret == 0) ||
(ret == -1 && errno == EAGAIN)) {
rd->ret = SOLO5_R_AGAIN;
return;
}

The spt target does not do anything special in the case of read(2) returns 0 as far as I can tell.

It is unclear to me if a file descriptor for a tap device could ever return EOF. I observe this by abusing the file descriptor mechanism for passing network devices in https://github.com/reynir/mirage-cat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant