-
Notifications
You must be signed in to change notification settings - Fork 86
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: various simplifications #1284
Conversation
d5073df
to
bf6a373
Compare
46176b1
to
8deffb1
Compare
8deffb1
to
eec251b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Except for the first commit, this looks good to me.
Regarding the last commit: Does descriptor ID exhaustion happen? What motivates this change?
The specification only prescribes memory barriers before the setting of the flags, which is taken care of by `make_available_with_state`.
`ctrl_desc` do not belong to the individual buffers but to the whole transfer. Moving it to the TransferToken structure allows us to avoid aliasing.
Now that every variant has the same fields, Buffer can be a simple struct instead of an enum. The directness is specified in the TransferToken and whether the Buffer is for a single element or chained elements is deduced from the number of elements in the desc_lst.
There does not seem to be anything in the spec that requires the Buffer IDs for the packed queue to be larger than 0. For split queues, indices are already reduced by one for operations that deal with `MemDescrId`s.
Not every MemDescr necessarily has its own id in the queue. For example, descriptors that make up a chain in a packed queue share their Buffer ID. Descriptors in an indirect table have ids but they don't take them from their queue's pool. Not making the id a field of the MemDescr also removes the coupling between the MemDescr and a queue.
1a36457
to
e81458e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
No description provided.