All of lore.kernel.org
 help / color / mirror / Atom feed
From: christian+kn@wwad.de (christian+kn at wwad.de)
To: kernelnewbies@lists.kernelnewbies.org
Subject: net_device: limit rate ot tx packets
Date: Wed, 17 Apr 2013 16:30:06 +0200	[thread overview]
Message-ID: <20130417163006.372a4781@anton.lan> (raw)
In-Reply-To: <79092.1365950116@turing-police.cc.vt.edu>

> 
> 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

      reply	other threads:[~2013-04-17 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-13 12:11 net_device: limit rate ot tx packets christian+kn at wwad.de
2013-04-14  6:15 ` michi1 at michaelblizek.twilightparadox.com
2013-04-14  7:45   ` Valdis.Kletnieks at vt.edu
2013-04-14  8:09     ` michi1 at michaelblizek.twilightparadox.com
2013-04-14 14:35       ` Valdis.Kletnieks at vt.edu
2013-04-17 14:30         ` christian+kn at wwad.de [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=20130417163006.372a4781@anton.lan \
    --to=christian+kn@wwad.de \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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 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.