All of lore.kernel.org
 help / color / mirror / Atom feed
* tun always return NETDEV_TX_OK, why?
@ 2013-08-13 14:39 Yannick Koehler
  2013-08-13 17:33 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Yannick Koehler @ 2013-08-13 14:39 UTC (permalink / raw)
  To: netdev

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?

-- 
Yannick Koehler

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tun always return NETDEV_TX_OK, why?
  2013-08-13 14:39 tun always return NETDEV_TX_OK, why? Yannick Koehler
@ 2013-08-13 17:33 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-08-13 17:33 UTC (permalink / raw)
  To: Yannick Koehler; +Cc: netdev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-13 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 14:39 tun always return NETDEV_TX_OK, why? Yannick Koehler
2013-08-13 17:33 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.