Re: Linux QoS question

From: agoldney (agoldney@optushome.com.au)
Date: Wed Jul 19 2000 - 00:48:51 EST


agoldney wrote:

> 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;

Ouch, I missed the "&" on cl_filter_list. Amazing how your mind refuses to
see something when you have decided it works a certain way :-) So, I ended
up kicking myself and beating my head against a brick wall :-P. Still,
nobody humiliated me by pointing it out before I saw it myself (Phew).

>
> }
>
> 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/

-
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:12 EST