Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Ed Wildgoose <lists@wildgooses.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Help:how to generate different packets?souce code explanation?
Date: Fri, 18 Jun 2004 09:41:49 +0000	[thread overview]
Message-ID: <40D2B8DD.2080606@wildgooses.com> (raw)
In-Reply-To: <20040618023313.98B464498@outpost.ds9a.nl>


>	Another question:I am studying sch_htb.c,but it's so tough for to understand,especially htb_dequeue().Would anyone please supply some adivse?
>  
>

Hmm, well I will set you a problem. I have been looking at sch_htb.c as
well, but I don't understand the marked line below (won't it mean that
we double count the stats for this packet?):


static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
struct htb_sched *q = (struct htb_sched *)sch->data;
struct htb_class *cl = htb_classify(skb,sch);

if (cl = HTB_DIRECT || !cl) {
/* enqueue to helper queue */
if (q->direct_queue.qlen < q->direct_qlen && cl) {
__skb_queue_tail(&q->direct_queue, skb);
q->direct_pkts++;
} else {
kfree_skb (skb);
sch->stats.drops++;
return NET_XMIT_DROP;
}
} else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
sch->stats.drops++;
cl->stats.drops++;
return NET_XMIT_DROP;
} else {
->> cl->stats.packets++; cl->stats.bytes += skb->len;
htb_activate (q,cl);
}

sch->q.qlen++;
sch->stats.packets++; sch->stats.bytes += skb->len;
HTB_DBG(1,1,"htb_enq_ok cl=%X skb=%p\n",(cl && cl !HTB_DIRECT)?cl->classid:0,skb);
return NET_XMIT_SUCCESS;
}


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      reply	other threads:[~2004-06-18  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18  2:20 [LARTC] Help:how to generate different packets?souce code explanation? swcims
2004-06-18  9:41 ` Ed Wildgoose [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=40D2B8DD.2080606@wildgooses.com \
    --to=lists@wildgooses.com \
    --cc=lartc@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox