Re: ESFQ?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Andy Furniss <41E3F088.6060708@xxxxxxxxxxxxx> 2005-01-11 15:28
> diff -urN linux-2.6.10.orig/include/linux/pkt_sched.h linux-2.6.10/include/linux/pkt_sched.h
> @@ -136,6 +143,7 @@
>  	__u32		limit;		/* Maximal packets in queue */
>  	unsigned	divisor;	/* Hash divisor  */
>  	unsigned	flows;		/* Maximal number of flows  */
> +	unsigned	hash_kind;	/* Hash function to use for flow identification */
>  };

This breaks compatibility to older iproute2 versions
compiled with older header versions (not including
the additional 4 octets). sch_sfq.c:

        if (opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
	                return -EINVAL;
> +static int esfq_change(struct Qdisc *sch, struct rtattr *opt)
> +{
> +	struct esfq_sched_data *q = qdisc_priv(sch);
> +	struct tc_sfq_qopt *ctl = RTA_DATA(opt);
> +	int old_perturb = q->perturb_period;
> +
> +	if (opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
> +		return -EINVAL;
> +
> +	sch_tree_lock(sch);
> +	q->quantum = ctl->quantum ? : psched_mtu(sch->dev);
> +	q->perturb_period = ctl->perturb_period*HZ;
> +//	q->hash_divisor = ctl->divisor;
> +//	q->tail = q->limit = q->depth = ctl->flows;
> +
> +	if (ctl->limit)
> +		q->limit = min_t(u32, ctl->limit, q->depth);
> +	
> +	if (ctl->hash_kind) {
> +		q->hash_kind = ctl->hash_kind;
> +		if (q->hash_kind !=  TCA_SFQ_HASH_CLASSIC)
> +			q->perturb_period = 0;
> +	}
> +	
> +	// is sch_tree_lock enough to do this ?
> +	while (sch->q.qlen >= q->limit-1)
> +		esfq_drop(sch);
> +	
> +	if (old_perturb)
> +		del_timer(&q->perturb_timer);
> +	if (q->perturb_period) {
> +		q->perturb_timer.expires = jiffies + q->perturb_period;
> +		add_timer(&q->perturb_timer);
> +	} else {
> +		q->perturbation = 0;
> +	}
> +	sch_tree_unlock(sch);
> +	return 0;
> +}

Must be changed to use tcf_exts and ematch api once those patches
are merged. I will take care of this.

I'll have a closer look later on this week.
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux