On 2021/8/17 18:43, Viresh Kumar wrote:
On 17-08-21, 02:47, Michael S. Tsirkin wrote:
On Tue, Aug 17, 2021 at 09:23:24AM +0530, Viresh Kumar wrote:
On 16-08-21, 10:45, Michael S. Tsirkin wrote:
So I wonder. What if we allow zero-length buffers in virtio? Would that address the need?
OK, so yea. Let's split this up please.
Just to make sure I understand what you asked for, we are looking for something on these lines ? And the kernel side will still send an 'sg' element and call sg_init_one(sg, NULL, 0) ?
From the perspective of specification,I think we can allow zero-length buffers in virtio.
we can use the len of descriptor to see if it is a zero-length buffer.
But for a specific implementation, I don't think "NULL" can be passed to this API.
There is a check "BUG_ON(!virt_addr_valid(buf))" in it.