static int
gred_drop(struct Qdisc* sch)
{
.
.
.
skb = __skb_dequeue_tail(&sch->q);
if (skb) {
q= t->tab[(skb->tc_index&0xf)];
sch->stats.backlog -= skb->len;
sch->stats.drops++;
q->backlog
-=
skb->len;
q->other++;
kfree_skb(skb);
return
1;
}
.
.
}
As can be seen from above, the drop function simply involves dequeuing the packet from the queue and freeing the memory occupied by it.
Next, let us discuss the init function of a queuing disciplines.