search for: add_outbuf

Displaying 20 results from an estimated 26 matches for "add_outbuf".

2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
...ead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get called. Core changes: 1) struct virtio_device has a "lock" and "priv" fields (the latter for the driver to use, esp from callbacks). 2) add_outbuf and add_inbuf take a cb function ptr and void *, rather than a used pointer. 3) lengths of buffers must now fit in an unsigned int, not long. 4) the virtio_sync wrapper is gone. Block driver changes (+30 lines) 1) Convert to callbacks not interrupt. 2) Ensure both outbuf & inbuf have been used...
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
...ead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get called. Core changes: 1) struct virtio_device has a "lock" and "priv" fields (the latter for the driver to use, esp from callbacks). 2) add_outbuf and add_inbuf take a cb function ptr and void *, rather than a used pointer. 3) lengths of buffers must now fit in an unsigned int, not long. 4) the virtio_sync wrapper is gone. Block driver changes (+30 lines) 1) Convert to callbacks not interrupt. 2) Ensure both outbuf & inbuf have been used...
2007 Jun 07
4
[PATCH RFC 0/3] Virtio draft II
...ead ends I implemented the simplest solution: the struct virtio_device contains the spinlock to use, and it's held when your callbacks get called. Core changes: 1) struct virtio_device has a "lock" and "priv" fields (the latter for the driver to use, esp from callbacks). 2) add_outbuf and add_inbuf take a cb function ptr and void *, rather than a used pointer. 3) lengths of buffers must now fit in an unsigned int, not long. 4) the virtio_sync wrapper is gone. Block driver changes (+30 lines) 1) Convert to callbacks not interrupt. 2) Ensure both outbuf & inbuf have been used...
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
...** + * virtio_device - description and routines to drive a virtual device. + * @dev: the underlying struct device. + * @ops: the operations for this virtual device. + */ +struct virtio_device { + struct device *dev; + struct virtio_ops *ops; +}; + +/** + * virtio_ops - virtio abstraction layer + * @add_outbuf: prepare to send data to the other end: + * vdev: the virtio_device + * sg: the description of the buffer(s). + * num: the size of the sg array. + * used: the length sent (set once sending is done). + * Returns an identifier or an error. + * @add_inbuf: prepare to receive data from the other e...
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
...** + * virtio_device - description and routines to drive a virtual device. + * @dev: the underlying struct device. + * @ops: the operations for this virtual device. + */ +struct virtio_device { + struct device *dev; + struct virtio_ops *ops; +}; + +/** + * virtio_ops - virtio abstraction layer + * @add_outbuf: prepare to send data to the other end: + * vdev: the virtio_device + * sg: the description of the buffer(s). + * num: the size of the sg array. + * used: the length sent (set once sending is done). + * Returns an identifier or an error. + * @add_inbuf: prepare to receive data from the other e...
2007 May 31
5
[PATCH RFC 1/3] virtio infrastructure
...** + * virtio_device - description and routines to drive a virtual device. + * @dev: the underlying struct device. + * @ops: the operations for this virtual device. + */ +struct virtio_device { + struct device *dev; + struct virtio_ops *ops; +}; + +/** + * virtio_ops - virtio abstraction layer + * @add_outbuf: prepare to send data to the other end: + * vdev: the virtio_device + * sg: the description of the buffer(s). + * num: the size of the sg array. + * used: the length sent (set once sending is done). + * Returns an identifier or an error. + * @add_inbuf: prepare to receive data from the other e...
2017 Oct 02
2
[RFC] [PATCH] mm,oom: Offload OOM notify callback to a kernel thread.
...alloon_oom_notify(). > > Ohh, I missed your point and thought the dependency is indirect I do think this is the case. See below. > and some > other call path is allocating while holding the lock. But you seem to be > right and > leak_balloon > tell_host > virtqueue_add_outbuf > virtqueue_add > > can do GFP_KERNEL allocation and this is clearly wrong. Nobody should > try to allocate while we are in the OOM path. Michael, is there any way > to drop this? Yes - in practice it won't ever allocate - that path is never taken with add_outbuf - it is...
2017 Oct 02
2
[RFC] [PATCH] mm,oom: Offload OOM notify callback to a kernel thread.
...alloon_oom_notify(). > > Ohh, I missed your point and thought the dependency is indirect I do think this is the case. See below. > and some > other call path is allocating while holding the lock. But you seem to be > right and > leak_balloon > tell_host > virtqueue_add_outbuf > virtqueue_add > > can do GFP_KERNEL allocation and this is clearly wrong. Nobody should > try to allocate while we are in the OOM path. Michael, is there any way > to drop this? Yes - in practice it won't ever allocate - that path is never taken with add_outbuf - it is...
2017 Oct 02
1
[RFC] [PATCH] mm,oom: Offload OOM notify callback to a kernel thread.
...> On Mon, Oct 02, 2017 at 01:50:35PM +0200, Michal Hocko wrote: > [...] > > > and some > > > other call path is allocating while holding the lock. But you seem to be > > > right and > > > leak_balloon > > > tell_host > > > virtqueue_add_outbuf > > > virtqueue_add > > > > > > can do GFP_KERNEL allocation and this is clearly wrong. Nobody should > > > try to allocate while we are in the OOM path. Michael, is there any way > > > to drop this? > > > > Yes - in practice it won...
2017 Oct 02
1
[RFC] [PATCH] mm,oom: Offload OOM notify callback to a kernel thread.
...> On Mon, Oct 02, 2017 at 01:50:35PM +0200, Michal Hocko wrote: > [...] > > > and some > > > other call path is allocating while holding the lock. But you seem to be > > > right and > > > leak_balloon > > > tell_host > > > virtqueue_add_outbuf > > > virtqueue_add > > > > > > can do GFP_KERNEL allocation and this is clearly wrong. Nobody should > > > try to allocate while we are in the OOM path. Michael, is there any way > > > to drop this? > > > > Yes - in practice it won...
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
This is a subject that came up in the virtio BOF session at OLS. I decided to go forward and implement something that I like, based on the latest virtio proposal at the time, which was draft III. It's not a drop-in replacement, because it's missing a host implementation. I first started my own, which is not done yet, but wanted to do one for lguest and one for emulated PCI next. It's
2007 Jul 06
6
[RFC 0/4] Using a generic bus_type for virtio
This is a subject that came up in the virtio BOF session at OLS. I decided to go forward and implement something that I like, based on the latest virtio proposal at the time, which was draft III. It's not a drop-in replacement, because it's missing a host implementation. I first started my own, which is not done yet, but wanted to do one for lguest and one for emulated PCI next. It's
2017 Apr 13
2
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...add_one_chunk(vb, vq, > + PAGE_CHUNK_TYPE_UNUSED, > + pfn, > + (u64)(1 << order)); > + } > + } while (!ret); > + } > + } > + } > + miscq_out_hdr->flags |= VIRTIO_BALLOON_MISCQ_F_COMPLETE; And where is miscq_out_hdr used? I see no add_outbuf anywhere. Things like this should be passed through function parameters and not stuffed into device structure, fields should be initialized before use and not where we happen to have the data handy. Also, _F_ is normally a bit number, you use it as a value here. > + send_page_chunks(vb, vq...
2017 Apr 13
2
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...add_one_chunk(vb, vq, > + PAGE_CHUNK_TYPE_UNUSED, > + pfn, > + (u64)(1 << order)); > + } > + } while (!ret); > + } > + } > + } > + miscq_out_hdr->flags |= VIRTIO_BALLOON_MISCQ_F_COMPLETE; And where is miscq_out_hdr used? I see no add_outbuf anywhere. Things like this should be passed through function parameters and not stuffed into device structure, fields should be initialized before use and not where we happen to have the data handy. Also, _F_ is normally a bit number, you use it as a value here. > + send_page_chunks(vb, vq...
2017 Apr 27
0
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...PAGE_CHUNK_TYPE_UNUSED, >> + pfn, >> + (u64)(1 << order)); >> + } >> + } while (!ret); >> + } >> + } >> + } >> + miscq_out_hdr->flags |= VIRTIO_BALLOON_MISCQ_F_COMPLETE; > And where is miscq_out_hdr used? I see no add_outbuf anywhere. > > Things like this should be passed through function parameters > and not stuffed into device structure, fields should be > initialized before use and not where we happen to > have the data handy. > miscq_out_hdr is linear with the payload (i.e. kmalloc(hdr+payload) )...
2017 Oct 02
0
[RFC] [PATCH] mm,oom: Offload OOM notify callback to a kernel thread.
...17:11:55, Michael S. Tsirkin wrote: > On Mon, Oct 02, 2017 at 01:50:35PM +0200, Michal Hocko wrote: [...] > > and some > > other call path is allocating while holding the lock. But you seem to be > > right and > > leak_balloon > > tell_host > > virtqueue_add_outbuf > > virtqueue_add > > > > can do GFP_KERNEL allocation and this is clearly wrong. Nobody should > > try to allocate while we are in the OOM path. Michael, is there any way > > to drop this? > > Yes - in practice it won't ever allocate - that path is n...
2019 Sep 06
1
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
.... > > > > > > > > + > > > + /* Enqueue the request */ > > > + dev_dbg(&vq->vdev->dev, "%s\n", __func__); > > > + ret = virtqueue_add_sgs(vq, sgs, 1, 0, forget, GFP_ATOMIC); > > > > > > This is easier as add_outbuf. > > Will look into it. > > > > > Also - why GFP_ATOMIC? > > Hmm..., may be it can be GFP_KERNEL. I don't see atomic context here. Will > look into it. > > > > > > + if (ret < 0) { > > > + if (ret == -ENOMEM || ret == -ENOSPC)...
2017 May 05
1
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...n, > > > + (u64)(1 << order)); > > > + } > > > + } while (!ret); > > > + } > > > + } > > > + } > > > + miscq_out_hdr->flags |= VIRTIO_BALLOON_MISCQ_F_COMPLETE; > > And where is miscq_out_hdr used? I see no add_outbuf anywhere. > > > > Things like this should be passed through function parameters > > and not stuffed into device structure, fields should be > > initialized before use and not where we happen to > > have the data handy. > > > > miscq_out_hdr is linear wit...
2017 May 05
1
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
...n, > > > + (u64)(1 << order)); > > > + } > > > + } while (!ret); > > > + } > > > + } > > > + } > > > + miscq_out_hdr->flags |= VIRTIO_BALLOON_MISCQ_F_COMPLETE; > > And where is miscq_out_hdr used? I see no add_outbuf anywhere. > > > > Things like this should be passed through function parameters > > and not stuffed into device structure, fields should be > > initialized before use and not where we happen to > > have the data handy. > > > > miscq_out_hdr is linear wit...
2019 Sep 05
0
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...eded for guest. Will look into getting rid of this. > > > > + > > + /* Enqueue the request */ > > + dev_dbg(&vq->vdev->dev, "%s\n", __func__); > > + ret = virtqueue_add_sgs(vq, sgs, 1, 0, forget, GFP_ATOMIC); > > > This is easier as add_outbuf. Will look into it. > > Also - why GFP_ATOMIC? Hmm..., may be it can be GFP_KERNEL. I don't see atomic context here. Will look into it. > > > + if (ret < 0) { > > + if (ret == -ENOMEM || ret == -ENOSPC) { > > + pr_debug("virtio-fs: Could not queue...