On 2019/2/20 下午12:01, Wei Xu wrote:

AFAICT, virtqueue_fill() is a generic API for all relevant userspace virtio
devices that do not support batching , without touching virtqueue_fill(),
supporting batching changes the meaning of the parameter 'idx' which should
be kept overall.

To fix it, I got two proposals so far:
1). batching support(two APIs needed to keep compatibility)
2). save a head elem for a vq instead of caching an array of elems like vhost,
     and introduce a new API(virtqueue_chain_fill()) functioning with an
     additional parameter 'more' to the current virtqueue_fill() to indicate if
     there are more descriptor(s) coming in a chain.

Either way it changes the API somehow and it does not seem to be clean and clear
as wanted.
It's as simple as accepting an array of elems in e.g
virtqueue_fill_batched()?
It is trivial for both, my concern is an array elements need to be allocated 
dynamically
due to vq size which no any other devices are using, a head would be enough for 
2.


Do you see any issue for this?

Thanks


Reply via email to