Ignore:
Timestamp:
2011-04-12T22:33:11+02:00 (6 years ago)
Author:
jow
Message:

This patch updates qos-scripts to support fair traffic sharing using the
SFQ with external classifiers method. It also corrects a bug in the
unsupported ESFQ method already used by qos-scripts. (ESFQ:
http://fatooh.org/esfq-2.6/ only updated to 2.6.24, it was switched to
an SFQ patch after that and not updated since 2008)

A class can be forced to use SFQ, and an external classifier added like
this:

config class "Normal"

option avgrate 10
option priority 30
option packetdelay 100
option limitrate 94

# option qdisc "sfq perturb 2"
config class "Normal_up"
# option filter "protocol all flow hash keys src divisor 1024"
config class "Normal_down"
# option filter "protocol all flow hash keys dst divisor 1024"

Using these options, the user needs to load cls_flow before qos-scripts
starts.

I've got more information here:
http://oneitguy.com/blogs/netprince/fair-traffic-sharing-esfq-broken-switching-sfqexternal-classifiers

This has been tested on r23914.

Signed-off-by: Ben Pfountz <netprince<>vt_edu>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/qos-scripts/files/usr/lib/qos/tcrules.awk

    r19874 r26622  
    1414        delay[n] = $5 
    1515        maxrate[n] = ($6 * linespeed / 100) 
    16         qdisc_esfq[n] = $7 
     16        qdisc[n] = $7 
     17        filter[n] = $8 
    1718} 
    1819 
     
    6970        for (i = 1; i <= n; i++) { 
    7071                printf "tc class add dev "device" parent 1:1 classid 1:"class[i]"0 hfsc" 
    71                 if (qdisc_esfq[i] != "") { 
    72                         # user requested esfq 
    73                         print "esfq " qdisc_esfq[i] " limit " ql 
    74                 } else if (rtm1[i] > 0) { 
    75                         # rt class - use sfq 
     72                if (rtm1[i] > 0) { 
    7673                        printf " rt m1 " int(rtm1[i]) "kbit d " int(d[i] * 1000) "us m2 " int(rtm2[i])"kbit" 
    7774                } 
     
    9794                limit = (min + max) * 3 
    9895 
    99                 if (rtm1[i] > 0) { 
     96                if (qdisc[i] != "") { 
     97                        # user specified qdisc 
     98                        print qdisc[i] " limit " limit 
     99                } else if (rtm1[i] > 0) { 
    100100                        # rt class - use sfq 
    101101                        print "sfq perturb 2 limit "  limit 
     
    124124        for (i = 1; i <= n; i++) { 
    125125                print "tc filter add dev "device" parent 1: prio "class[i]" protocol ip handle "class[i]" fw flowid 1:"class[i] "0"  
     126                filterc=1 
     127                if (filter[i] != "") { 
     128                        print " tc filter add dev "device" parent "class[i]"00: handle "filterc"0 "filter[i] 
     129                        filterc=filterc+1 
     130                } 
    126131        } 
    127132} 
Note: See TracChangeset for help on using the changeset viewer.