[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1266614385.17881.7.camel@w-sridhar.beaverton.ibm.com>
Date: Fri, 19 Feb 2010 13:19:45 -0800
From: Sridhar Samudrala <sri@...ibm.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next-2.6] vhost: Restart tx poll when socket send
queue is full
On Fri, 2010-02-19 at 16:42 +0200, Michael S. Tsirkin wrote:
> > > Hmm. We already do
> > > if (wmem >= sock->sk->sk_sndbuf * 3 / 4) {
> > > tx_poll_start(net, sock);
> > > set_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
> > > break;
> > > }
> > > why does not this code trigger here?
> >
> > 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@...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
>
>
> Hmm, this happens when
> we have polled a lot of packets, and want to
> give another vq a chance to poll.
> Looks like a strange place to add it.
I am also seeing sendmsg() calls failing with EAGAIN. Could be a bug in
handling this error. The check for sendq full is done outside the for
loop. It is possible that we can run out of sendq space within the for
loop. Should we check for wmem within the for loop?
Thanks
Sridhar
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists