+Arnd
On 18-08-21, 10:38, Jie Deng wrote:
>
> 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.
I tried to look at implementations of virt_addr_valid() and it doesn't
check for NULL specifically (for the ones I looked at). I haven't
tested it though.
Though I am not sure what's better here, remove the need of sending
buffer altogether, the way this patch proposed initially or what
Michael has suggested. And all that to prevent just a single bit to be
used in flags field, which will likely be used for more things later
on.
--
viresh