next up previous
Next: Drop Up: Queuing Disciplines Previous: Dequeue

Requeue

The requeue function of a queuing discipline requeues a packet for transmission. After dequeueing the packet, if for some reason, the packet is not transmitted, the packet needs to be put back in the queue at the same position from where it was dequeued. The reasons for which a hard_start_xmit may fail include:

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.


next up previous
Next: Drop Up: Queuing Disciplines Previous: Dequeue
Saravanan Radhakrishnan
1999-09-30