net_device: limit rate ot tx packets

christian+kn at wwad.de christian+kn at wwad.de
Wed Apr 17 10:30:06 EDT 2013


> 
> How to figure this out for yourself:
> 
> Look at net/sched/sch_plug.c, which is a pretty simple qdisc
> (transmit packets until a plug request is recieved, then queue until
> unplugged). In particular, look at plug_enqueue() to see what happens
> when q->limit is exceeded, and plug_init() to see where q->limit is
> set.
> 
> Then look at the definition of qdisc_reshape_fail() in
> include/net/sch_generic.h to figure out what the qdisc returns if
> q->limit is exceeded.
> 
> Then go look at net/core/dev.c, in function __dev_xmit_skb(), and
> watch the variable 'rc'.
> 
> Now go find the caller of __dev_xmit_skb() and see what it does with
> that return value.
> 
> Hope that helps...
> 

Thank You very much, Michi and Vladis!
With Your help, I could figure it out.

I tried it out, and as Michi stated:
  If the tx_queue_len is small, send() will not sleep
  If the tx_queue_len is large, send() will sleep at some point



More information about the Kernelnewbies mailing list