Re: [PATCH 1/3] virtio_ring: Remove sg_next indirection

2014-09-01 Thread Michael S. Tsirkin
On Sun, Aug 31, 2014 at 06:42:38PM -0700, Andy Lutomirski wrote: On Sun, Aug 31, 2014 at 5:58 PM, Rusty Russell ru...@rustcorp.com.au wrote: Andy Lutomirski l...@amacapital.net writes: The only unusual thing about virtio's use of scatterlists is that two of the APIs accept scatterlists that

Re: [PATCH 1/3] virtio_ring: Remove sg_next indirection

2014-09-01 Thread Andy Lutomirski
On Sep 1, 2014 12:00 AM, Michael S. Tsirkin m...@redhat.com wrote: On Sun, Aug 31, 2014 at 06:42:38PM -0700, Andy Lutomirski wrote: On Sun, Aug 31, 2014 at 5:58 PM, Rusty Russell ru...@rustcorp.com.au wrote: Andy Lutomirski l...@amacapital.net writes: The only unusual thing about

Re: [PATCH 1/3] virtio_ring: Remove sg_next indirection

2014-08-31 Thread Rusty Russell
Andy Lutomirski l...@amacapital.net writes: The only unusual thing about virtio's use of scatterlists is that two of the APIs accept scatterlists that might not be terminated. Using function pointers to handle this case is overkill; for_each_sg can do it. There's a small subtlely here:

Re: [PATCH 1/3] virtio_ring: Remove sg_next indirection

2014-08-31 Thread Andy Lutomirski
On Sun, Aug 31, 2014 at 5:58 PM, Rusty Russell ru...@rustcorp.com.au wrote: Andy Lutomirski l...@amacapital.net writes: The only unusual thing about virtio's use of scatterlists is that two of the APIs accept scatterlists that might not be terminated. Using function pointers to handle this

[PATCH 1/3] virtio_ring: Remove sg_next indirection

2014-08-26 Thread Andy Lutomirski
The only unusual thing about virtio's use of scatterlists is that two of the APIs accept scatterlists that might not be terminated. Using function pointers to handle this case is overkill; for_each_sg can do it. There's a small subtlely here: for_each_sg assumes that the provided count is