Hello, If any of kernel hackers wants to make some money: For 300$: What I need is a netfilter match rule that would match on depth of a queue on a given device. Example: iptables -t mangle -I PREROUTING -m queue_backlog --device eth0.1 --depth-gt 10 -j <chain> If you can complete this in a reasonable time (2-3 days), let me know. This does not need to be very complicated: The only qdiscs that this needs to work with is HTB and pfifo. I envision this as adding a function query_backlog to relevant qdiscs, and a simple match on dev->qdisc->query_backlog For someone who has done this before, I'm sure should take about a day :) This *must* be optimized (i.e. pointer to device struct must be cached, number of packets in backlog must be cached or otherwise computed at O(1) time). To those wondering "why in the world would someone want to do that": Consider router connected to many uplinks (possibly of varying speeds). Due to "political reasons" reasons (example, one link being "paid for completely", others being "pay per use"), I only want to send packets over the other link when the first link is "full". Backlog length provides the best measure of the "fullness" of a given device. Now (use of 'recent' match necessary because TCP really dislikes multipath within a given session): -A PREROUTING -m recent --rdest -j MARK --seconds 60 --set-mark 1 -A PREROUTING -m queue_backlog --device eth0.1 --depth-gt 10 -j OVERFLOW -A OVERFLOW -j MARK --set-mark 1 -A OVERFLOW -m recent --rdest --set -j ACCEPT ...ip rule add fwmark 1 table 2 Yes, I know its somewhat fugly (essentially, I'm doing RPDB as netfilter rules), but seems simplest and more flexible to me. _______________________________________________ LARTC mailing list / LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/