Patchwork [3/5] net/queue: queue packets even if sender doesn't supply a callback

login
register
mail settings
Submitter Mark McLoughlin
Date Oct. 27, 2009, 6:16 p.m.
Message ID <1256667399-3149-4-git-send-email-markmc@redhat.com>
Download mbox | patch
Permalink /patch/37018/
State New
Headers show

Comments

Mark McLoughlin - Oct. 27, 2009, 6:16 p.m.
Now that we disable any receiver whose queue is full, we do not require
senders to handle a zero return by supplying a sent callback.

This is a second step towards allowing can_receive() handlers to return
true even if no buffer space is available.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 net/queue.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/net/queue.c b/net/queue.c
index e91a9a5..2ea6cd0 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -186,7 +186,7 @@  ssize_t qemu_net_queue_send(NetQueue *queue,
     }
 
     ret = qemu_net_queue_deliver(queue, sender, flags, data, size);
-    if (ret == 0 && sent_cb != NULL) {
+    if (ret == 0) {
         qemu_net_queue_append(queue, sender, flags, data, size, sent_cb);
         return 0;
     }
@@ -210,7 +210,7 @@  ssize_t qemu_net_queue_send_iov(NetQueue *queue,
     }
 
     ret = qemu_net_queue_deliver_iov(queue, sender, flags, iov, iovcnt);
-    if (ret == 0 && sent_cb != NULL) {
+    if (ret == 0) {
         qemu_net_queue_append_iov(queue, sender, flags, iov, iovcnt, sent_cb);
         return 0;
     }
@@ -246,7 +246,7 @@  void qemu_net_queue_flush(NetQueue *queue)
                                      packet->flags,
                                      packet->data,
                                      packet->size);
-        if (ret == 0 && packet->sent_cb != NULL) {
+        if (ret == 0) {
             QTAILQ_INSERT_HEAD(&queue->packets, packet, entry);
             break;
         }