Linux QoS question

From: agoldney (agoldney@optushome.com.au)
Date: Mon Jul 17 2000 - 08:15:49 EST


I have been trying to grasp the Linux QoS Kernel code and have hit on
the
following snag with filters.

The only way I can see to add a new filter is via the tc_ctl_tfilter()
function
in net/sched/cls_api.c. However, this chunk of code

       /* And the last stroke */
       chain = cops->tcf_chain(q, cl);
       err = -EINVAL;
       if (chain == NULL)
               goto errout;

has me stumped.

The reason for this is as follows

1. tcf_chain is a pointer to a function that (at least in the ATM and
CBQ
schedulers) returns the list of filters anchored by the filter_list
pointer. The filter_list pointer is an element of struct cbq_class in
CBQ or
struct atm_flow_data in ATM.

e.g. for CBQ

static struct tcf_proto **cbq_find_tcf(struct Qdisc *sch, unsigned long
arg)
{
        struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
        struct cbq_class *cl = (struct cbq_class *)arg;

        if (cl == NULL)
                cl = &q->link;

        return &cl->filter_list;
}

2. filter_list appears never to be initialised anywhere to any value
other than NULL.

So, if filter list is never set to a value other than NULL, then the
code chunk
above will stop any filter ever being created.

I am obviously missing something, and no doubt I'll kick myself when it
is
pointed out to me. However, I'd rather kick myself than keep beating my
head
against a brick wall :-) Any help gratefully accepted.

Thanks,
       Alex.

Oh yeah, I'm looking at the code for 2.2.16.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:09 EST