From: Hagen Paul Pfeifer Date: Sun, 24 Jan 2010 12:31:05 +0000 (+0000) Subject: tc: add new queue discipline: head drop fifo X-Git-Tag: v2.6.34~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f703129d3441be2e014c58ae3e95314ba769315a;p=thirdparty%2Fiproute2.git tc: add new queue discipline: head drop fifo This adds the required changes to gain access to the head drop classfull queuing discipline named pfifo_head_drop. In difference to pfifo or pfifo_fast this queuing discipline will drop the first packet in the case of queue congestion. As a result the queue contain always the freshest packets. To replace the current a root queueing discipline for eth0: $ tc qdisc replace dev eth0 root pfifo_head_drop And show statistics: $ tc -s qdisc show dev eth0 Signed-off-by: Hagen Paul Pfeifer --- diff --git a/tc/q_fifo.c b/tc/q_fifo.c index f561752d4..6242a98b7 100644 --- a/tc/q_fifo.c +++ b/tc/q_fifo.c @@ -25,7 +25,7 @@ static void explain(void) { - fprintf(stderr, "Usage: ... [p|b]fifo [ limit NUMBER ]\n"); + fprintf(stderr, "Usage: ... <[p|b]fifo | pfifo_head_drop> [ limit NUMBER ]\n"); } static int fifo_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n) @@ -89,6 +89,12 @@ struct qdisc_util pfifo_qdisc_util = { .print_qopt = fifo_print_opt, }; +struct qdisc_util pfifo_head_drop_qdisc_util = { + .id = "pfifo_head_drop", + .parse_qopt = fifo_parse_opt, + .print_qopt = fifo_print_opt, +}; + extern int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt); struct qdisc_util pfifo_fast_qdisc_util = { .id = "pfifo_fast",