lkml.org 
[lkml]   [2013]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/9] virtio: add functions for piecewise addition of buffers
Il 12/02/2013 15:56, Michael S. Tsirkin ha scritto:
>> > +/**
>> > + * virtqueue_start_buf - start building buffer for the other end
>> > + * @vq: the struct virtqueue we're talking about.
>> > + * @data: the token identifying the buffer.
>> > + * @nents: the number of buffers that will be added
> This function starts building one buffer, number of buffers
> is a bit weird here.

Ok.

>> > + * @nsg: the number of sg lists that will be added
> This means number of calls to add_sg ? Not sure why this matters.
> How about we pass in in_num/out_num - that is total # of sg,
> same as add_buf?

It is used to choose between direct and indirect.

>> > +/**
>> > + * virtqueue_add_sg - add sglist to buffer being built
>> > + * @_vq: the virtqueue for which the buffer is being built
>> > + * @sgl: the description of the buffer(s).
>> > + * @nents: the number of items to process in sgl
>> > + * @dir: whether the sgl is read or written (DMA_TO_DEVICE/DMA_FROM_DEVICE only)
>> > + *
>> > + * Note that, unlike virtqueue_add_buf, this function follows chained
>> > + * scatterlists, and stops before the @nents-th item if a scatterlist item
>> > + * has a marker.
>> > + *
>> > + * Caller must ensure we don't call this with other virtqueue operations
>> > + * at the same time (except where noted).
> Hmm so if you want to add in and out, need separate calls?
> in_num/out_num would be nicer?

If you want to add in and out just use virtqueue_add_buf...

Paolo



\
 
 \ /
  Last update: 2013-02-12 17:21    [W:0.077 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site