qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define


From: Yang Hongyang
Subject: Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define
Date: Mon, 7 Sep 2015 17:21:37 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 09/07/2015 05:06 PM, Markus Armbruster wrote:
Yang Hongyang <address@hidden> writes:

Hi Stefan,

On 09/04/2015 06:32 PM, Stefan Hajnoczi wrote:
[...]

net/queue.c has logic to send/queue/flush packets but a
qemu_deliver_packet() call is hardcoded.

Maybe you can extend qemu_new_net_queue() like this:

/* Returns:
   *   >0 - success
   *    0 - queue packet for future redelivery
   *   <0 - failure (discard packet)
   */
typedef ssize_t NetQueueDeliverFunc(NetClientState *sender,
                                      unsigned flags,
                                    const struct iovec *iov,
                                    int iovcnt,
                                    void *opaque);

NetQueue *qemu_new_net_queue(NetQueueDeliverFunc deliver,
                               void *opaque);

Now net/net.c:qemu_net_client_setup() needs to call:

    nc->incoming_queue = qemu_new_net_queue(qemu_deliver_packet_iov, nc);

And the filter code can use qemu_net_queue_send_iov() and
qemu_net_queue_flush().  The filter just needs to provide its own
NetQueueDeliveryFunc.

I haven't checked the details (e.g. non-iov delivery, etc) but the idea
is to use the net/queue.c API instead of duplicating similar logic in
the filter code.

Thanks very much for the suggestion, I've already implemented it and tested,
the code looks cleaner now.

The last issue is the QOM thing, do Markus and Andreas have more input
about that?

This series is in my review queue.  I'm struggling with clearing my
queue, and apologize for the delay.

Thanks, I'm going to rebase this series on QOM in v10, the QAPI part will
be the same as in this series unless you're about to review this series,
so if you are still struggling on the long queue, you might want to review the
next version :)

.


--
Thanks,
Yang.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]