Re: [PATCH net-next-2.6] vhost: Restart tx poll when socket send queue is full

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Sridhar Samudrala
Date: Thursday, February 18, 2010 - 7:00 pm

On Fri, 2010-02-19 at 00:30 +0200, Michael S. Tsirkin wrote:

This check is done only when the ring is empty(head == vq->num).
But we are breaking out of the loop here.
                if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
                        vhost_poll_queue(&vq->poll);
                        break;
                }

I guess tx_poll_start() is missing here. The following patch fixes
the hang and may be a better fix.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 4c89283..fe9d296 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -172,6 +172,7 @@ static void handle_tx(struct vhost_net *net)
 		vhost_add_used_and_signal(&net->dev, vq, head, 0);
 		total_len += len;
 		if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
+			tx_poll_start(net, sock);
 			vhost_poll_queue(&vq->poll);
 			break;
 		}

Thanks
Sridhar

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH net-next-2.6] vhost: Restart tx poll when socket se ..., Sridhar Samudrala, (Thu Feb 18, 1:59 pm)
Re: [PATCH net-next-2.6] vhost: Restart tx poll when socke ..., Michael S. Tsirkin, (Thu Feb 18, 3:30 pm)
Re: [PATCH net-next-2.6] vhost: Restart tx poll when socke ..., Sridhar Samudrala, (Thu Feb 18, 7:00 pm)
Re: [PATCH net-next-2.6] vhost: Restart tx poll when socke ..., Michael S. Tsirkin, (Fri Feb 19, 7:42 am)
Re: [PATCH net-next-2.6] vhost: Restart tx poll when socke ..., Sridhar Samudrala, (Fri Feb 19, 2:19 pm)
Re: [PATCH net-next-2.6] vhost: Restart tx poll when socke ..., Michael S. Tsirkin, (Tue Feb 23, 3:24 am)
Re: [PATCH net-next-2.6] vhost: Restart tx poll when socke ..., Sridhar Samudrala, (Tue Feb 23, 10:31 am)