[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100722160731.GA30723@gondor.apana.org.au>
Date: Fri, 23 Jul 2010 00:07:31 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Shirley Ma <mashirle@...ibm.com>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>, Mark Wagner <mwagner@...hat.com>
Subject: Re: macvtap: Limit packet queue length
On Thu, Jul 22, 2010 at 08:59:58AM -0700, Shirley Ma wrote:
> On Thu, 2010-07-22 at 14:41 +0800, Herbert Xu wrote:
> > {
> > struct macvtap_queue *q = macvtap_get_queue(dev, skb);
> > if (!q)
> > - return -ENOLINK;
> > + goto drop;
> > +
> > + if (skb_queue_len(&q->sk.sk_receive_queue) >=
> > dev->tx_queue_len)
> > + goto drop;
> >
>
> Do we need to orphan skb here, just like tun?
We could, but that is orthogonal to the problem at hand so feel
free to do that in another patch.
> > skb_queue_tail(&q->sk.sk_receive_queue, skb);
> > wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN |
> > POLLRDNORM | POLLRDBAND);
> > - return 0;
> > + return NET_RX_SUCCESS;
> > +
> > +drop:
>
> Do we need to increase dropped++ counter here to let user know there are
> packets dropped?
The caller is supposed to handle this.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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