From mboxrd@z Thu Jan 1 00:00:00 1970 From: christian+kn@wwad.de (christian+kn at wwad.de) Date: Wed, 17 Apr 2013 16:30:06 +0200 Subject: net_device: limit rate ot tx packets In-Reply-To: <79092.1365950116@turing-police.cc.vt.edu> References: <20130413141121.1aedb750@anton.lan> <20130414061520.GA2288@grml> <65160.1365925550@turing-police.cc.vt.edu> <20130414080954.GB2288@grml> <79092.1365950116@turing-police.cc.vt.edu> Message-ID: <20130417163006.372a4781@anton.lan> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > > 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