netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shirley Ma <mashirle@us.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Mark Wagner <mwagner@redhat.com>
Subject: Re: macvtap: Limit packet queue length
Date: Thu, 22 Jul 2010 08:59:58 -0700	[thread overview]
Message-ID: <1279814398.3211.1.camel@localhost.localdomain> (raw)
In-Reply-To: <20100722064157.GA25913@gondor.apana.org.au>

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?

>         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?

> +       kfree_skb(skb);
> +       return NET_RX_DROP;
>  }
> 
> 


  parent reply	other threads:[~2010-07-22 16:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22  6:41 macvtap: Limit packet queue length Herbert Xu
2010-07-22  7:44 ` Herbert Xu
2010-07-22  7:47   ` Chris Wright
2010-07-22  9:30   ` Arnd Bergmann
2010-07-22 16:05     ` Shirley Ma
2010-07-22 16:08       ` Herbert Xu
2010-07-22 18:42         ` Shirley Ma
2010-07-22 20:09     ` David Miller
2010-07-22 15:59 ` Shirley Ma [this message]
2010-07-22 16:07   ` Herbert Xu
2010-07-22 19:58     ` David Miller
2010-07-23  7:28       ` Arnd Bergmann
2010-07-23  7:58         ` Herbert Xu

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=1279814398.3211.1.camel@localhost.localdomain \
    --to=mashirle@us.ibm.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=mwagner@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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 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).