TC: give one interface priority over another.

From: Karl Hiramoto
Date: Fri May 29 2009 - 05:18:35 EST


Hi i have the setup:

Internet

|

PPP
|
|
ATM
Eth0 --*-- Eth1




I'd like to have egress to internet that comes from eth1 to have priority over eth0.. I've been trying a few things with TC but have am not sure my filters are working. My tests so far from machines on eth1 and eth0 show no difference in upload speeds with iperf. Is there way to check the number of packets that match a TC filter?


This is the script i've been trying to debug:

#!/bin/sh

#Internet device
ODEV=ppp1
UPLOAD=512

RATE=256

#interface index from "ip addr"
#eth1
HIGHIF=3

#eth0
LOWIF=2

tc qdisc add dev $ODEV root handle 1:0 cbq avpkt 1000 bandwidth ${UPLOAD}kbit


tc class add dev $ODEV parent 1:0 classid 1:1 cbq bandwidth ${UPLOAD}kbit rate ${RATE}kbit \
allot 1600 weight 256Kbit maxburst 1 avpkt 1000 prio 1


tc class add dev $ODEV parent 1:0 classid 1:5 cbq bandwidth ${UPLOAD}kbit rate ${RATE}kbit \
allot 1600 weight 10Kbit maxburst 1 avpkt 1000 prio 5

tc filter add dev $ODEV parent 1: protocol all basic match "meta(rt_iif eq $LOWIF)" classid 1:5

tc filter add dev $ODEV parent 1: protocol all basic match "meta(rt_iif eq $HIGHIF)" classid 1:1




Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html