[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/12] char: introduce backend tx queue
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 04/12] char: introduce backend tx queue |
Date: |
Mon, 1 Aug 2011 16:33:34 +0100 |
On Mon, Aug 1, 2011 at 3:23 PM, Anthony Liguori <address@hidden> wrote:
> While the front tx queue has no flow control, the backend tx queue uses a
> polling function to determine when the front end can receive data.
>
> To convert this to the new queue model, we simply try to flush the backend tx
> queue whenever we poll. We then return the remaining space in the queue as
> the value of the polling function.
>
> Signed-off-by: Anthony Liguori <address@hidden>
> ---
> qemu-char.c | 49 ++++++++++++++++++++++++++++++++++++++++---------
> qemu-char.h | 3 ++-
> 2 files changed, 42 insertions(+), 10 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 3f9b32c..2746652 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -173,6 +173,11 @@ static size_t char_queue_read(CharQueue *q, void *data,
> size_t size)
> return i;
> }
>
> +static uint32_t char_queue_get_avail(CharQueue *q)
> +{
> + return sizeof(q->ring) - (q->prod - q->cons);
> +}
"avail" confuses me. How many bytes are available for the consumer?
How many bytes are available for the producer?
How about char_queue_get_space() or char_queue_get_nfree()?
Stefan
- Re: [Qemu-devel] [PATCH 06/12] char: add an edge event API for the front ends, (continued)
- [Qemu-devel] [PATCH 09/12] char: rename qemu_chr_guest_open() -> qemu_chr_fe_open(), Anthony Liguori, 2011/08/01
- [Qemu-devel] [PATCH 11/12] char: make all devices do qemu_chr_fe_open(), Anthony Liguori, 2011/08/01
- [Qemu-devel] [PATCH 08/12] char: make monitor use new style interface, Anthony Liguori, 2011/08/01
- [Qemu-devel] [PATCH 10/12] char: rename qemu_chr_guest_close() -> qemu_chr_fe_close(), Anthony Liguori, 2011/08/01
- [Qemu-devel] [PATCH 12/12] char: enforce the use of qemu_chr_guest_open(), Anthony Liguori, 2011/08/01
- [Qemu-devel] [PATCH 04/12] char: introduce backend tx queue, Anthony Liguori, 2011/08/01
- Re: [Qemu-devel] [PATCH 04/12] char: introduce backend tx queue,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH 00/12][RFC] char: add flow control and fix guest_[open|close], Alon Levy, 2011/08/01
- Re: [Qemu-devel] [PATCH 00/12][RFC] char: add flow control and fix guest_[open|close], Hans de Goede, 2011/08/01
- Re: [Qemu-devel] [PATCH 00/12][RFC] char: add flow control and fix guest_[open|close], Blue Swirl, 2011/08/01
- Re: [Qemu-devel] [PATCH 00/12][RFC] char: add flow control and fix guest_[open|close], Amit Shah, 2011/08/04