From: Mark McLoughlin <markmc@redhat.com>
To: qemu-devel@nongnu.org
Cc: Sven Rudolph <Sven_Rudolph@drewag.de>,
Scott Tsai <scottt.tw@gmail.com>,
Mark McLoughlin <markmc@redhat.com>
Subject: [Qemu-devel] [PATCH 3/5] net/queue: queue packets even if sender doesn't supply a callback
Date: Tue, 27 Oct 2009 18:16:37 +0000 [thread overview]
Message-ID: <1256667399-3149-4-git-send-email-markmc@redhat.com> (raw)
In-Reply-To: <1256667399-3149-1-git-send-email-markmc@redhat.com>
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(-)
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;
}
--
1.6.2.5
next prev parent reply other threads:[~2009-10-27 18:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-27 18:16 [Qemu-devel] [PATCH 0/5] Fix packet queueing to allow full tap queue drain Mark McLoughlin
2009-10-27 18:16 ` [Qemu-devel] [PATCH 1/5] tap: disable draining queue in one go Mark McLoughlin
2009-10-27 18:16 ` [Qemu-devel] [PATCH 2/5] net: disable receiving if client returns zero Mark McLoughlin
2009-10-27 18:16 ` Mark McLoughlin [this message]
2009-10-27 18:16 ` [Qemu-devel] [PATCH 4/5] virtio-net: split the has_buffers() logic from can_receive() Mark McLoughlin
2009-10-27 18:16 ` [Qemu-devel] [PATCH 5/5] tap: drain queue in tap_send() Mark McLoughlin
2009-10-30 16:21 ` Anthony Liguori
2009-10-30 16:34 ` Mark McLoughlin
2009-10-30 17:46 ` Anthony Liguori
2009-10-28 3:36 ` [Qemu-devel] Re: [PATCH 0/5] Fix packet queueing to allow full tap queue drain Scott Tsai
2009-10-28 8:49 ` Mark McLoughlin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1256667399-3149-4-git-send-email-markmc@redhat.com \
--to=markmc@redhat.com \
--cc=Sven_Rudolph@drewag.de \
--cc=qemu-devel@nongnu.org \
--cc=scottt.tw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.