netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next]vhost: fix condition check for # of outstanding dma buffers
@ 2011-07-19 18:37 Shirley Ma
  2011-07-19 19:09 ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Shirley Ma @ 2011-07-19 18:37 UTC (permalink / raw)
  To: David Miller, mst; +Cc: netdev, jasowang

Signed-off-by: Shirley Ma <xma@us.ibm.com>
---

 drivers/vhost/net.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 70ac604..83cb738 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -189,8 +189,10 @@ static void handle_tx(struct vhost_net *net)
 				break;
 			}
 			/* If more outstanding DMAs, queue the work */
-			if (unlikely(vq->upend_idx - vq->done_idx >
-				     VHOST_MAX_PEND)) {
+			if (unlikely((vq->upend_idx - vq->done_idx >
+					VHOST_MAX_PEND) ||
+				     (vq->upend_idx - vq->done_idx >
+					 VHOST_MAX_PEND - UIO_MAXIOV))) {
 				tx_poll_start(net, sock);
 				set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
 				break;



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-07-20 16:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-19 18:37 [PATCH net-next]vhost: fix condition check for # of outstanding dma buffers Shirley Ma
2011-07-19 19:09 ` Michael S. Tsirkin
2011-07-19 20:56   ` Shirley Ma
2011-07-20 10:28     ` Michael S. Tsirkin
2011-07-20 15:43       ` Shirley Ma
2011-07-20 16:17         ` Michael S. Tsirkin
2011-07-20 16:49           ` Shirley Ma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).