diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-10-31 00:45:27 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-31 00:45:27 -0700 |
commit | 99c0db26797edb39cf83c8c5f8972067f5426b4e (patch) | |
tree | 918b933d2ac5f0579b24636274c4394c17011d0d /net/sched/sch_api.c | |
parent | 48a8f519e0fe22a5c98523286b2a120841a11dd5 (diff) | |
download | linux-99c0db26797edb39cf83c8c5f8972067f5426b4e.tar.bz2 |
pkt_sched: sch_generic: Add generic qdisc->ops->peek() implementation.
With feedback from Patrick McHardy.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b16ad2972c6b..e5646614e88d 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -102,6 +102,10 @@ static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n, requeues once dequeued packet. It is used for non-standard or just buggy devices, which can defer output even if netif_queue_stopped()=0. + ---peek + + like dequeue but without removing a packet from the queue + ---reset returns qdisc to initial state: purge all buffers, clear all @@ -149,6 +153,14 @@ int register_qdisc(struct Qdisc_ops *qops) qops->enqueue = noop_qdisc_ops.enqueue; if (qops->requeue == NULL) qops->requeue = noop_qdisc_ops.requeue; + if (qops->peek == NULL) { + if (qops->dequeue == NULL) { + qops->peek = noop_qdisc_ops.peek; + } else { + rc = -EINVAL; + goto out; + } + } if (qops->dequeue == NULL) qops->dequeue = noop_qdisc_ops.dequeue; |