Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Yannick Koehler <yannick@koehler.name>
Cc: netdev@vger.kernel.org
Subject: Re: tun always return NETDEV_TX_OK, why?
Date: Tue, 13 Aug 2013 10:33:31 -0700	[thread overview]
Message-ID: <20130813103331.20946af6@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <CAJ4BwwEbBQQ=S5pd=8rHAxnOm-P7yQPv9q2D7c1D9cVh5ArAPQ@mail.gmail.com>

On Tue, 13 Aug 2013 10:39:02 -0400
Yannick Koehler <yannick@koehler.name> wrote:

> Hello,
> 
>   I hit a problem recently with the tun interface, it looks like when
> this interface reach its txqueuelen it will then drop the packet and
> return NETDEV_TX_OK unconditionally.
> 
>  That, from my little understanding of the netdev framework, appears
> to be wrong and will simply eat up any pending buffer and discard them
> until the queue frees itself.  That seems to be against the flow
> control design in the tx queue system of the kernel.
> 
>   So, is this a bug or a misunderstanding?  Would it be ok for tun to
> return NETDEV_TX_BUSY when the txqueuelen is reach and call
> netif_stop_queue() so that the layer above stop sending frame to this
> interface until it can cope it's current queue content?
> 

NETDEV_TX_BUSY won't work well for this because it basically
causes kernel to spin waiting for the transmit queue.
A better way is to figure out how to do proper flow control
with start/stop queue.

      reply	other threads:[~2013-08-13 17:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 14:39 tun always return NETDEV_TX_OK, why? Yannick Koehler
2013-08-13 17:33 ` Stephen Hemminger [this message]

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=20130813103331.20946af6@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=yannick@koehler.name \
    /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