The simplest example to demonstrate the requeue function is the pfifo_requeue (in net/sched/sch_fifo.c). The portion of the code that does the requeuing is shown below:
static int
pfifo_requeue(struct sk_buff *skb, struct Qdisc* sch)
{
__skb_queue_head(&sch->q, skb);
return 1;
}
For a simple FIFO queue, the requeue function should put the packet back at the head of the queue. This is what is done in the portion of the code shown above. The requeue function is different from an enqueue function in that the requeue function should put the packet back in the same place from where it was dequeued, and it should not be reflected in the statistics that are maintained for the queue, since it was already processed by an enqueue function.
Let us now discuss the drop function of a queuing discipline.