Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-13 Thread Michael S. Tsirkin
On Wed, Feb 13, 2013 at 09:06:27AM +0100, Paolo Bonzini wrote: > Il 12/02/2013 21:49, Michael S. Tsirkin ha scritto: > > On Tue, Feb 12, 2013 at 09:08:27PM +0100, Paolo Bonzini wrote: > >> Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: > >>> On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-13 Thread Paolo Bonzini
Il 12/02/2013 21:49, Michael S. Tsirkin ha scritto: > On Tue, Feb 12, 2013 at 09:08:27PM +0100, Paolo Bonzini wrote: >> Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: >>> On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: >> Perhaps, but 3 or 4 arguments (in/out/nsg or

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-13 Thread Paolo Bonzini
Il 12/02/2013 21:49, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 09:08:27PM +0100, Paolo Bonzini wrote: Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: Perhaps, but 3 or 4 arguments (in/out/nsg or

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-13 Thread Michael S. Tsirkin
On Wed, Feb 13, 2013 at 09:06:27AM +0100, Paolo Bonzini wrote: Il 12/02/2013 21:49, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 09:08:27PM +0100, Paolo Bonzini wrote: Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 09:08:27PM +0100, Paolo Bonzini wrote: > Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: > > On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: > Perhaps, but 3 or 4 arguments (in/out/nsg or in/out/nsg_in/nsg_out) just > for this are definitely too

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: > On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: Perhaps, but 3 or 4 arguments (in/out/nsg or in/out/nsg_in/nsg_out) just for this are definitely too many and make the API harder to use. You have to find a

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: > >> Perhaps, but 3 or 4 arguments (in/out/nsg or in/out/nsg_in/nsg_out) just > >> for this are definitely too many and make the API harder to use. > >> > >> You have to find a balance. Having actually used the API, the > >>

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 18:34, Michael S. Tsirkin ha scritto: > On Tue, Feb 12, 2013 at 05:57:55PM +0100, Paolo Bonzini wrote: >> Il 12/02/2013 17:35, Michael S. Tsirkin ha scritto: >>> On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto:

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 05:57:55PM +0100, Paolo Bonzini wrote: > Il 12/02/2013 17:35, Michael S. Tsirkin ha scritto: > > On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: > >> Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: > > + * @nsg: the number of sg lists that will be

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 17:35, Michael S. Tsirkin ha scritto: > On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: >> Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: > + * @nsg: the number of sg lists that will be added >>> This means number of calls to add_sg ? Not sure why this

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: > Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: > >>> + * @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 -

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: >>> + * @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

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 04:48:39PM +0100, Paolo Bonzini wrote: > Il 12/02/2013 16:43, Michael S. Tsirkin ha scritto: > > On Tue, Feb 12, 2013 at 04:32:27PM +0100, Paolo Bonzini wrote: > >> Il 12/02/2013 15:56, Michael S. Tsirkin ha scritto: > > +/** > > + * virtqueue_start_buf - start

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 16:43, Michael S. Tsirkin ha scritto: > On Tue, Feb 12, 2013 at 04:32:27PM +0100, Paolo Bonzini wrote: >> 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

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 04:32:27PM +0100, Paolo Bonzini wrote: > 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

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
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 >

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 01:23:27PM +0100, Paolo Bonzini wrote: > virtio device drivers translate requests from higher layer in two steps: > a device-specific step in the device driver, and generic preparation > of virtio direct or indirect buffers in virtqueue_add_buf. Because > virtqueue_add_buf

[PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
virtio device drivers translate requests from higher layer in two steps: a device-specific step in the device driver, and generic preparation of virtio direct or indirect buffers in virtqueue_add_buf. Because virtqueue_add_buf also accepts the outcome of the first step as a single struct

[PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
virtio device drivers translate requests from higher layer in two steps: a device-specific step in the device driver, and generic preparation of virtio direct or indirect buffers in virtqueue_add_buf. Because virtqueue_add_buf also accepts the outcome of the first step as a single struct

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 01:23:27PM +0100, Paolo Bonzini wrote: virtio device drivers translate requests from higher layer in two steps: a device-specific step in the device driver, and generic preparation of virtio direct or indirect buffers in virtqueue_add_buf. Because virtqueue_add_buf

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
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

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 04:32:27PM +0100, Paolo Bonzini wrote: 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.

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 16:43, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 04:32:27PM +0100, Paolo Bonzini wrote: 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. + *

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 04:48:39PM +0100, Paolo Bonzini wrote: Il 12/02/2013 16:43, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 04:32:27PM +0100, Paolo Bonzini wrote: Il 12/02/2013 15:56, Michael S. Tsirkin ha scritto: +/** + * virtqueue_start_buf - start building buffer for

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: + * @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

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: + * @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

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 17:35, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: + * @nsg: the number of sg lists that will be added This means number of calls to add_sg ? Not sure why this matters. How

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 05:57:55PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:35, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: + * @nsg: the number of sg lists that will be added This

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 18:34, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 05:57:55PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:35, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 05:17:47PM +0100, Paolo Bonzini wrote: Il 12/02/2013 17:13, Michael S. Tsirkin ha scritto: In this

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: Perhaps, but 3 or 4 arguments (in/out/nsg or in/out/nsg_in/nsg_out) just for this are definitely too many and make the API harder to use. You have to find a balance. Having actually used the API, the possibility of mixing

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Paolo Bonzini
Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: Perhaps, but 3 or 4 arguments (in/out/nsg or in/out/nsg_in/nsg_out) just for this are definitely too many and make the API harder to use. You have to find a balance. Having

Re: [PATCH 1/9] virtio: add functions for piecewise addition of buffers

2013-02-12 Thread Michael S. Tsirkin
On Tue, Feb 12, 2013 at 09:08:27PM +0100, Paolo Bonzini wrote: Il 12/02/2013 19:23, Michael S. Tsirkin ha scritto: On Tue, Feb 12, 2013 at 07:04:27PM +0100, Paolo Bonzini wrote: Perhaps, but 3 or 4 arguments (in/out/nsg or in/out/nsg_in/nsg_out) just for this are definitely too many and