next up previous contents
Next: Tags Up: Under the hood Previous: Queuing disciplines without classes   Contents

Class selection path internals

As mentioned in section 2.10, class selection paths are equivalent to a mixture of dsmark and tcindex. We examine the structure generated for the two class selection path examples.

In the first example, a tcindex filter is automatically added to the prio queuing discipline, one filter element is created for each prio class, and the dsmark class numbers are set accordingly. It is equivalent to the following configuration:

dsmark {
    class (1)
        if ...;
    class (2)
        if ...;
    ...
    prio {
        tcindex (mask 3) {
            $c1 = class
                on (1);
            $c2 = class
                on (2);
        }
    }
}

And this is the the equivalent configuration for the second example, without using class selection paths:

dsmark {
    class (5)
        if ...;
    class (6)
        if ...;
    class (8)
        if ...;
    ...
    prio {
        tcindex (mask 0xc0,shift 2) {
            class
                on (1)
            {
                prio {
                    tcindex (mask 3) {
                        class
                            on (1);
                        class
                            on (2);
                    }
                }
            }
            class
                on (2);
        }
    }
}

Implementation note: If multiple levels of queuing disciplines need to be traversed, tcc tries to use a certain set of bits in the tcindex value at each queuing discipline. If the number of available bits is exceeded, tcc falls back to assigning a distinct value for each path. This may affect space and time efficiency of the resulting configuration.

Also note that class selection paths cannot be nested, e.g.

dsmark {
    class (<$x>) if ...;
    ...
        dsmark { 
            $y = class (<$x>);
            ...
                $y = class ...;
            ...
        }
    ...
}

is not supported.


next up previous contents
Next: Tags Up: Under the hood Previous: Queuing disciplines without classes   Contents
Martin A. Brown 2003-11-06