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

virtq: async support #1399

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

virtq: async support #1399

wants to merge 2 commits into from

Conversation

cagatay-y
Copy link
Contributor

Adds a proof-of-concept async implementation to virtq and uses it in the file system device driver.

Stuff I need to investigate before the PR is ready:

  • Can async packet transmission / reception be used for the smoltcp based networking stack?
  • What is the correct mutex type for the use case in the PR? I chose pretty much at random (except for avoiding the interrupt disabling variant. I am not sure if it would affect the kind of interrupts we rely on for virtq notifications).
  • Why does the code not work without the dbg statement in VirtioFsDriver::send_command?
  • Is the current block_on implementation suitable for this use case? There is some stuff in there that is related to the network drivers. At the very least, the return error type needs to be made more general to allow VirtqErrors.

Ideas for future additions:

  • Support for async dispatch functions that await on used notifications to remove them when they are done and use the newly open space to transmit new packets. This would be useful in queues where the used buffer is not useful to the driver (i.e. TX queues).

Rather than pushing used buffers from the queues to channels, return them directly to the drivers. This removes the dependency on `async-channel`.
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

Successfully merging this pull request may close these issues.

1 participant