From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu) Date: Sun, 14 Apr 2013 10:35:16 -0400 Subject: net_device: limit rate ot tx packets In-Reply-To: Your message of "Sun, 14 Apr 2013 10:09:54 +0200." <20130414080954.GB2288@grml> References: <20130413141121.1aedb750@anton.lan> <20130414061520.GA2288@grml> <65160.1365925550@turing-police.cc.vt.edu> <20130414080954.GB2288@grml> Message-ID: <79092.1365950116@turing-police.cc.vt.edu> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sun, 14 Apr 2013 10:09:54 +0200, michi1 at michaelblizek.twilightparadox.com said: > This is not what I meant. When the qdisc has a size of say 256KB and the > socket memory is, say 128kb, the socket memory limit will be reached before > the qdisc limit and the socket will sleep. But when the socket memory limit > is greater than the qdisc limit, it will be interesting whether the socket > still sleeps or starts dropping packets. 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... -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 865 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130414/ed588d4b/attachment.bin