: Cleanups
Subsystems (4)
cover : Cleanups
These patches contain some cleanup in net/sched related to estimators (removal of the NET_ESTIMATOR config option, unnecessary stats_lock pointers in multiple structures and the HTB estimator reimplementation) and additionally remove lots of unnecessary includes.
Please apply, thanks.
include/net/act_api.h | 2 - net/sched/Kconfig | 12 ----- net/sched/act_api.c | 23 +--------- net/sched/act_gact.c | 11 ----- net/sched/act_ipt.c | 12 ----- net/sched/act_mirred.c | 12 ----- net/sched/act_pedit.c | 11 ----- net/sched/act_police.c | 36 +-------------- net/sched/act_simple.c | 1 - net/sched/cls_api.c | 10 ---- net/sched/cls_basic.c | 1 - net/sched/cls_fw.c | 19 +-------- net/sched/cls_route.c | 20 +------- net/sched/cls_rsvp.c | 17 +------- net/sched/cls_rsvp6.c | 16 ------- net/sched/cls_tcindex.c | 3 - net/sched/cls_u32.c | 18 +------- net/sched/ematch.c | 2 - net/sched/sch_api.c | 18 -------- net/sched/sch_atm.c | 4 -- net/sched/sch_blackhole.c | 1 - net/sched/sch_cbq.c | 34 ++------------- net/sched/sch_dsmark.c | 1 - net/sched/sch_fifo.c | 1 - net/sched/sch_generic.c | 10 ---- net/sched/sch_gred.c | 1 - net/sched/sch_hfsc.c | 21 +-------- net/sched/sch_htb.c | 102 +++++++++++---------------------------------- net/sched/sch_ingress.c | 9 +---- net/sched/sch_netem.c | 2 - net/sched/sch_prio.c | 16 ------- net/sched/sch_red.c | 1 - net/sched/sch_sfq.c | 18 +------- net/sched/sch_tbf.c | 19 +-------- net/sched/sch_teql.c | 18 +------- 35 files changed, 49 insertions(+), 453 deletions(-)
Patrick McHardy (4):
[NET_SCHED]: Remove CONFIG_NET_ESTIMATOR option [NET_SCHED]: Remove unnecessary stats_lock pointers [NET_SCHED]: sch_htb: use generic estimator [NET_SCHED]: Remove unnecessary includes
PATCH 1/4 : Remove CONFIG_NET_ESTIMATOR option
[NET_SCHED]: Remove CONFIG_NET_ESTIMATOR option
The generic estimator is always built in anways and all the config options does is prevent including a minimal amount of code for setting it up. Additionally the option is already automatically selected for most cases.
---
commit 0f93837e26f826f49382b567ef15efe0e4995615
tree 43796c93685c9c18fe0d82b1f848f6e6fc7ed63f
parent bd438b7a813667f60e47f45aee35be2d5a2bcc32
author Patrick McHardy <[email protected]> Thu, 14 Jun 2007 16:29:07 +0200 committer Patrick McHardy <[email protected]> Thu, 14 Jun 2007 16:29:07 +0200
net/sched/Kconfig | 12 ------------ net/sched/act_api.c | 6 ------ net/sched/act_police.c | 18 ------------------ net/sched/sch_api.c | 6 ------ net/sched/sch_cbq.c | 8 -------- net/sched/sch_generic.c | 2 -- net/sched/sch_hfsc.c | 8 -------- 7 files changed, 0 insertions(+), 60 deletions(-)
net/sched/Kconfig +0 -12
@@ -275,7 +275,6 @@ config CLS_U32_MARK config NET_CLS_RSVP tristate "IPv4 Resource Reservation Protocol (RSVP)" select NET_CLS - select NET_ESTIMATOR ---help--- The Resource Reservation Protocol (RSVP) permits end systems to request a minimum and maximum data flow rate for a connection; this
@@ -290,7 +289,6 @@ config NET_CLS_RSVP config NET_CLS_RSVP6 tristate "IPv6 Resource Reservation Protocol (RSVP6)" select NET_CLS - select NET_ESTIMATOR ---help--- The Resource Reservation Protocol (RSVP) permits end systems to request a minimum and maximum data flow rate for a connection; this
@@ -382,7 +380,6 @@ config NET_EMATCH_TEXT config NET_CLS_ACT bool "Actions" - select NET_ESTIMATOR ---help--- Say Y here if you want to use traffic control actions. Actions get attached to classifiers and are invoked after a successful
@@ -465,7 +462,6 @@ config NET_ACT_SIMP config NET_CLS_POLICE bool "Traffic Policing (obsolete)" depends on NET_CLS_ACT!=y - select NET_ESTIMATOR ---help--- Say Y here if you want to do traffic policing, i.e. strict bandwidth limiting. This option is obsoleted by the traffic
@@ -480,14 +476,6 @@ config NET_CLS_IND classification based on the incoming device. This option is likely to disappear in favour of the metadata ematch. -config NET_ESTIMATOR - bool "Rate estimator" - ---help--- - Say Y here to allow using rate estimators to estimate the current - rate-of-flow for network devices, queues, etc. This module is - automatically selected if needed but can be selected manually for - statistical purposes. - endif # NET_SCHED endmenu
net/sched/act_api.c +0 -6
@@ -42,10 +42,8 @@ void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo)write_lock_bh (hinfo->lock); *p1p = p->tcfc_next;write_unlock_bh (hinfo->lock); -#ifdef CONFIG_NET_ESTIMATOR gen_kill_estimator (&p->tcfc_bstats, &p->tcfc_rate_est); -#endif kfree (p);return ; }
@@ -236,11 +234,9 @@ struct tcf_common *tcf_hash_create(u32 index, struct rtattr *est, struct tc_acti p->tcfc_index = index ? index :tcf_hash_new_index (idx_gen, hinfo); p->tcfc_tm.install = jiffies; p->tcfc_tm.lastuse = jiffies; -#ifdef CONFIG_NET_ESTIMATOR if (est)gen_new_estimator (&p->tcfc_bstats, &p->tcfc_rate_est, p->tcfc_stats_lock, est); -#endif a->priv = (void *) p;return p; }
@@ -614,9 +610,7 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a, goto errout;if (gnet_stats_copy_basic (&d, &h->tcf_bstats) <0 || -#ifdef CONFIG_NET_ESTIMATOR gnet_stats_copy_rate_est (&d, &h->tcf_rate_est) <0 || -#endifgnet_stats_copy_queue (&d, &h->tcf_qstats) <0 ) goto errout;
net/sched/act_police.c +0 -18
@@ -118,10 +118,8 @@ void tcf_police_destroy(struct tcf_police *p)write_lock_bh (&police_lock); *p1p = p->tcf_next;write_unlock_bh (&police_lock); -#ifdef CONFIG_NET_ESTIMATOR gen_kill_estimator (&p->tcf_bstats, &p->tcf_rate_est); -#endif if (p->tcfp_R_tab)qdisc_put_rtab (p->tcfp_R_tab);if (p->tcfp_P_tab)
@@ -227,7 +225,6 @@ override: police->tcfp_ptoks =L2T_P (police, police->tcfp_mtu); police->tcf_action = parm->action; -#ifdef CONFIG_NET_ESTIMATOR if (tb[TCA_POLICE_AVRATE -1 ]) police->tcfp_ewma_rate = *(u32 *)RTA_DATA (tb[TCA_POLICE_AVRATE -1 ]);
@@ -235,7 +232,6 @@ override:gen_replace_estimator (&police->tcf_bstats, &police->tcf_rate_est, police->tcf_stats_lock, est); -#endif spin_unlock_bh (&police->tcf_lock);if (ret !=ACT_P_CREATED )
@@ -281,14 +277,12 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a, police->tcf_bstats.bytes += skb->len; police->tcf_bstats.packets++; -#ifdef CONFIG_NET_ESTIMATOR if (police->tcfp_ewma_rate && police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { police->tcf_qstats.overlimits++;spin_unlock (&police->tcf_lock);return police->tcf_action; } -#endif if (skb->len <= police->tcfp_mtu) {if (police->tcfp_R_tab ==NULL ) {
@@ -348,10 +342,8 @@ tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)if (police->tcfp_result)RTA_PUT (skb,TCA_POLICE_RESULT ,sizeof (int ), &police->tcfp_result); -#ifdef CONFIG_NET_ESTIMATOR if (police->tcfp_ewma_rate)RTA_PUT (skb,TCA_POLICE_AVRATE ,4 , &police->tcfp_ewma_rate); -#endif return skb->len; rtattr_failure:
@@ -477,14 +469,12 @@ struct tcf_police *tcf_police_locate(struct rtattr *rta, struct rtattr *est) goto failure; police->tcfp_result = *(u32 *)RTA_DATA (tb[TCA_POLICE_RESULT -1 ]); } -#ifdef CONFIG_NET_ESTIMATOR if (tb[TCA_POLICE_AVRATE -1 ]) {if (RTA_PAYLOAD (tb[TCA_POLICE_AVRATE -1 ]) !=sizeof (u32)) goto failure; police->tcfp_ewma_rate = *(u32 *)RTA_DATA (tb[TCA_POLICE_AVRATE -1 ]); } -#endif police->tcfp_toks = police->tcfp_burst = parm->burst; police->tcfp_mtu = parm->mtu;if (police->tcfp_mtu ==0 ) {
@@ -498,11 +488,9 @@ struct tcf_police *tcf_police_locate(struct rtattr *rta, struct rtattr *est) police->tcf_index = parm->index ? parm->index :tcf_police_new_index (); police->tcf_action = parm->action; -#ifdef CONFIG_NET_ESTIMATOR if (est)gen_new_estimator (&police->tcf_bstats, &police->tcf_rate_est, police->tcf_stats_lock, est); -#endif h =tcf_hash (police->tcf_index,POL_TAB_MASK );write_lock_bh (&police_lock); police->tcf_next = tcf_police_ht[h];
@@ -528,14 +516,12 @@ int tcf_police(struct sk_buff *skb, struct tcf_police *police) police->tcf_bstats.bytes += skb->len; police->tcf_bstats.packets++; -#ifdef CONFIG_NET_ESTIMATOR if (police->tcfp_ewma_rate && police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { police->tcf_qstats.overlimits++;spin_unlock (&police->tcf_lock);return police->tcf_action; } -#endif if (skb->len <= police->tcfp_mtu) {if (police->tcfp_R_tab ==NULL ) {spin_unlock (&police->tcf_lock);
@@ -591,10 +577,8 @@ int tcf_police_dump(struct sk_buff *skb, struct tcf_police *police)if (police->tcfp_result)RTA_PUT (skb,TCA_POLICE_RESULT ,sizeof (int ), &police->tcfp_result); -#ifdef CONFIG_NET_ESTIMATOR if (police->tcfp_ewma_rate)RTA_PUT (skb,TCA_POLICE_AVRATE ,4 , &police->tcfp_ewma_rate); -#endif return skb->len; rtattr_failure:
@@ -612,9 +596,7 @@ int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *police) goto errout;if (gnet_stats_copy_basic (&d, &police->tcf_bstats) <0 || -#ifdef CONFIG_NET_ESTIMATOR gnet_stats_copy_rate_est (&d, &police->tcf_rate_est) <0 || -#endifgnet_stats_copy_queue (&d, &police->tcf_qstats) <0 ) goto errout;
net/sched/sch_api.c +0 -6
@@ -515,7 +515,6 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp) sch->handle = handle;if (!ops->init || (err = ops->init (sch, tca[TCA_OPTIONS -1 ])) ==0 ) { -#ifdef CONFIG_NET_ESTIMATORif (tca[TCA_RATE -1 ]) { err = gen_new_estimator(&sch->bstats, &sch->rate_est, sch->stats_lock,
@@ -531,7 +530,6 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp) goto err_out3; } } -#endif qdisc_lock_tree (dev);list_add_tail (&sch->list, &dev->qdisc_list);qdisc_unlock_tree (dev);
@@ -559,11 +557,9 @@ static int qdisc_change(struct Qdisc *sch, struct rtattr **tca)if (err)return err; } -#ifdef CONFIG_NET_ESTIMATOR if (tca[TCA_RATE -1 ])gen_replace_estimator (&sch->bstats, &sch->rate_est, sch->stats_lock, tca[TCA_RATE -1 ]); -#endif return 0 ; }
@@ -839,9 +835,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, goto rtattr_failure;if (gnet_stats_copy_basic (&d, &q->bstats) <0 || -#ifdef CONFIG_NET_ESTIMATOR gnet_stats_copy_rate_est (&d, &q->rate_est) <0 || -#endifgnet_stats_copy_queue (&d, &q->qstats) <0 ) goto rtattr_failure;
net/sched/sch_cbq.c +0 -8
@@ -1653,9 +1653,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg, cl->xstats.undertime = cl->undertime - q->now;if (gnet_stats_copy_basic (d, &cl->bstats) <0 || -#ifdef CONFIG_NET_ESTIMATOR gnet_stats_copy_rate_est (d, &cl->rate_est) <0 || -#endifgnet_stats_copy_queue (d, &cl->qstats) <0 )return -1 ;
@@ -1726,9 +1724,7 @@ static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl)tcf_destroy_chain (cl->filter_list);qdisc_destroy (cl->q);qdisc_put_rtab (cl->R_tab); -#ifdef CONFIG_NET_ESTIMATOR gen_kill_estimator (&cl->bstats, &cl->rate_est); -#endif if (cl != &q->link)kfree (cl); }
@@ -1873,11 +1869,9 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **tsch_tree_unlock (sch); -#ifdef CONFIG_NET_ESTIMATOR if (tca[TCA_RATE -1 ])gen_replace_estimator (&cl->bstats, &cl->rate_est, cl->stats_lock, tca[TCA_RATE -1 ]); -#endif return 0 ; }
@@ -1963,11 +1957,9 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **tcbq_set_fopt (cl,RTA_DATA (tb[TCA_CBQ_FOPT -1 ]));sch_tree_unlock (sch); -#ifdef CONFIG_NET_ESTIMATOR if (tca[TCA_RATE -1 ])gen_new_estimator (&cl->bstats, &cl->rate_est, cl->stats_lock, tca[TCA_RATE -1 ]); -#endif *arg = (unsigned long )cl;return 0 ;
net/sched/sch_generic.c +0 -2
@@ -512,9 +512,7 @@ void qdisc_destroy(struct Qdisc *qdisc)return ;list_del (&qdisc->list); -#ifdef CONFIG_NET_ESTIMATOR gen_kill_estimator (&qdisc->bstats, &qdisc->rate_est); -#endif if (ops->reset) ops->reset (qdisc);if (ops->destroy)
net/sched/sch_hfsc.c +0 -8
@@ -1054,11 +1054,9 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, }sch_tree_unlock (sch); -#ifdef CONFIG_NET_ESTIMATOR if (tca[TCA_RATE -1 ])gen_replace_estimator (&cl->bstats, &cl->rate_est, cl->stats_lock, tca[TCA_RATE -1 ]); -#endif return 0 ; }
@@ -1112,11 +1110,9 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, cl->cl_pcvtoff = parent->cl_cvtoff;sch_tree_unlock (sch); -#ifdef CONFIG_NET_ESTIMATOR if (tca[TCA_RATE -1 ])gen_new_estimator (&cl->bstats, &cl->rate_est, cl->stats_lock, tca[TCA_RATE -1 ]); -#endif *arg = (unsigned long )cl;return 0 ; }
@@ -1128,9 +1124,7 @@ hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl)tcf_destroy_chain (cl->filter_list);qdisc_destroy (cl->qdisc); -#ifdef CONFIG_NET_ESTIMATOR gen_kill_estimator (&cl->bstats, &cl->rate_est); -#endif if (cl != &q->root)kfree (cl); }
@@ -1384,9 +1378,7 @@ hfsc_dump_class_stats(struct Qdisc *sch, unsigned long arg, xstats.rtwork = cl->cl_cumul;if (gnet_stats_copy_basic (d, &cl->bstats) <0 || -#ifdef CONFIG_NET_ESTIMATOR gnet_stats_copy_rate_est (d, &cl->rate_est) <0 || -#endifgnet_stats_copy_queue (d, &cl->qstats) <0 )return -1 ;
Re: [NET_SCHED 01/04]: Remove CONFIG_NET_ESTIMATOR option
From: Patrick McHardy <[email protected]>
Date: Tue, 19 Jun 2007 17:02:19 +0200 (MEST)
Quoted 7 lines
[
NET_SCHED]: RemoveCONFIG_NET_ESTIMATORoptionThe generic estimator is always built in anways and all the config options does is prevent including a minimal amount of code for setting it up. Additionally the option is already automatically selected for most cases.
Signed-off-by Patrick McHardy <[email protected]>
Applied, thanks Patrick.
PATCH 2/4 : Remove unnecessary stats_lock pointers
In reply to Patrick McHardy[NET_SCHED]: Remove unnecessary stats_lock pointers
Remove stats_lock pointers from qdisc-internal structures, in all cases it points to dev->queue_lock. The only case where it is necessary is for top-level qdiscs, where it might also point to dev->ingress_lock in case of the ingress qdisc. Also remove it from actions completely, it always points to the actions internal lock.
---
commit 00b3839a51961a8fda98d3941d0809f16be0ea59
tree 05186e615bc7af5dbe27d634972bcb71e6f10d25
parent 0f93837e26f826f49382b567ef15efe0e4995615
author Patrick McHardy <[email protected]> Thu, 14 Jun 2007 16:30:09 +0200 committer Patrick McHardy <[email protected]> Thu, 14 Jun 2007 16:30:09 +0200
include/net/act_api.h | 2 -- net/sched/act_api.c | 7 +++---- net/sched/act_police.c | 8 +++----- net/sched/sch_atm.c | 1 - net/sched/sch_cbq.c | 8 +++----- net/sched/sch_hfsc.c | 10 +++------- 6 files changed, 12 insertions(+), 24 deletions(-)
include/net/act_api.h +0 -2
@@ -19,7 +19,6 @@ struct tcf_common {struct gnet_stats_basic tcfc_bstats;struct gnet_stats_queue tcfc_qstats;struct gnet_stats_rate_est tcfc_rate_est; -spinlock_t *tcfc_stats_lock;spinlock_t tcfc_lock; };#define tcf_next common.tcfc_next
@@ -32,7 +31,6 @@ struct tcf_common {#define tcf_bstats common.tcfc_bstats#define tcf_qstats common.tcfc_qstats#define tcf_rate_est common.tcfc_rate_est -#define tcf_stats_lock common.tcfc_stats_lock#define tcf_lock common.tcfc_lockstruct tcf_police {
net/sched/act_api.c +3 -4
@@ -230,13 +230,12 @@ struct tcf_common *tcf_hash_create(u32 index, struct rtattr *est, struct tc_acti p->tcfc_bindcnt =1 ;spin_lock_init (&p->tcfc_lock); - p->tcfc_stats_lock = &p->tcfc_lock; p->tcfc_index = index ? index :tcf_hash_new_index (idx_gen, hinfo); p->tcfc_tm.install = jiffies; p->tcfc_tm.lastuse = jiffies;if (est)gen_new_estimator (&p->tcfc_bstats, &p->tcfc_rate_est, - p->tcfc_stats_lock, est); + &p->tcfc_lock, est); a->priv = (void *) p;return p; }
@@ -595,12 +594,12 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,if (compat_mode) {if (a->type ==TCA_OLD_COMPAT ) err =gnet_stats_start_copy_compat (skb,0 , -TCA_STATS ,TCA_XSTATS , h->tcf_stats_lock, &d); +TCA_STATS ,TCA_XSTATS , &h->tcf_lock, &d);else return 0 ; }else err =gnet_stats_start_copy (skb,TCA_ACT_STATS , - h->tcf_stats_lock, &d); + &h->tcf_lock, &d);if (err <0 ) goto errout;
net/sched/act_police.c +3 -5
@@ -183,7 +183,6 @@ static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est, ret =ACT_P_CREATED ; police->tcf_refcnt =1 ;spin_lock_init (&police->tcf_lock); - police->tcf_stats_lock = &police->tcf_lock;if (bind) police->tcf_bindcnt =1 ; override:
@@ -231,7 +230,7 @@ override:if (est)gen_replace_estimator (&police->tcf_bstats, &police->tcf_rate_est, - police->tcf_stats_lock, est); + &police->tcf_lock, est);spin_unlock_bh (&police->tcf_lock);if (ret !=ACT_P_CREATED )
@@ -450,7 +449,6 @@ struct tcf_police *tcf_police_locate(struct rtattr *rta, struct rtattr *est) police->tcf_refcnt =1 ;spin_lock_init (&police->tcf_lock); - police->tcf_stats_lock = &police->tcf_lock;if (parm->rate.rate) { police->tcfp_R_tab =qdisc_get_rtab (&parm->rate, tb[TCA_POLICE_RATE -1 ]);
@@ -490,7 +488,7 @@ struct tcf_police *tcf_police_locate(struct rtattr *rta, struct rtattr *est) police->tcf_action = parm->action;if (est)gen_new_estimator (&police->tcf_bstats, &police->tcf_rate_est, - police->tcf_stats_lock, est); + &police->tcf_lock, est); h =tcf_hash (police->tcf_index,POL_TAB_MASK );write_lock_bh (&police_lock); police->tcf_next = tcf_police_ht[h];
@@ -591,7 +589,7 @@ int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *police)struct gnet_dump d;if (gnet_stats_start_copy_compat (skb,TCA_STATS2 ,TCA_STATS , -TCA_XSTATS , police->tcf_stats_lock, +TCA_XSTATS , &police->tcf_lock, &d) <0 ) goto errout;
net/sched/sch_atm.c +0 -1
@@ -71,7 +71,6 @@ struct atm_flow_data {int ref;/* reference count */ struct gnet_stats_basic bstats;struct gnet_stats_queue qstats; -spinlock_t *stats_lock;struct atm_flow_data *next;struct atm_flow_data *excess;/* flow for excess traffic; NULL to set CLP instead */
net/sched/sch_cbq.c +3 -5
@@ -148,7 +148,6 @@ struct cbq_classstruct gnet_stats_basic bstats;struct gnet_stats_queue qstats;struct gnet_stats_rate_est rate_est; -spinlock_t *stats_lock;struct tc_cbq_xstats xstats;struct tcf_proto *filter_list;
@@ -1442,7 +1441,6 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt) q->link.ewma_log =TC_CBQ_DEF_EWMA ; q->link.avpkt = q->link.allot/2 ; q->link.minidle =-0x7FFFFFFF ; - q->link.stats_lock = &sch->dev->queue_lock;qdisc_watchdog_init (&q->watchdog, sch);hrtimer_init (&q->delay_timer,CLOCK_MONOTONIC ,HRTIMER_MODE_ABS );
@@ -1871,7 +1869,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **tif (tca[TCA_RATE -1 ])gen_replace_estimator (&cl->bstats, &cl->rate_est, - cl->stats_lock, tca[TCA_RATE -1 ]); + &sch->dev->queue_lock, + tca[TCA_RATE -1 ]);return 0 ; }
@@ -1929,7 +1928,6 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t cl->allot = parent->allot; cl->quantum = cl->allot; cl->weight = cl->R_tab->rate.rate; - cl->stats_lock = &sch->dev->queue_lock;sch_tree_lock (sch);cbq_link_class (cl);
@@ -1959,7 +1957,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **tif (tca[TCA_RATE -1 ])gen_new_estimator (&cl->bstats, &cl->rate_est, - cl->stats_lock, tca[TCA_RATE -1 ]); + &sch->dev->queue_lock, tca[TCA_RATE -1 ]); *arg = (unsigned long )cl;return 0 ;
net/sched/sch_hfsc.c +3 -7
@@ -122,7 +122,6 @@ struct hfsc_classstruct gnet_stats_basic bstats;struct gnet_stats_queue qstats;struct gnet_stats_rate_est rate_est; -spinlock_t *stats_lock;unsigned int level;/* class level in hierarchy */ struct tcf_proto *filter_list;/* filter list */ unsigned int filter_cnt;/* filter count */
@@ -1056,7 +1055,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,if (tca[TCA_RATE -1 ])gen_replace_estimator (&cl->bstats, &cl->rate_est, - cl->stats_lock, tca[TCA_RATE -1 ]); + &sch->dev->queue_lock, + tca[TCA_RATE -1 ]);return 0 ; }
@@ -1096,7 +1096,6 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid, cl->qdisc =qdisc_create_dflt (sch->dev, &pfifo_qdisc_ops, classid);if (cl->qdisc ==NULL ) cl->qdisc = &noop_qdisc; - cl->stats_lock = &sch->dev->queue_lock;INIT_LIST_HEAD (&cl->children); cl->vt_tree =RB_ROOT ; cl->cf_tree =RB_ROOT ;
@@ -1112,7 +1111,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,if (tca[TCA_RATE -1 ])gen_new_estimator (&cl->bstats, &cl->rate_est, - cl->stats_lock, tca[TCA_RATE -1 ]); + &sch->dev->queue_lock, tca[TCA_RATE -1 ]); *arg = (unsigned long )cl;return 0 ; }
@@ -1440,8 +1439,6 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)return -EINVAL ; qopt =RTA_DATA (opt); - sch->stats_lock = &sch->dev->queue_lock; - q->defcls = qopt->defcls;for (i =0 ; i <HFSC_HSIZE ; i++)INIT_LIST_HEAD (&q->clhash[i]);
@@ -1456,7 +1453,6 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt) sch->handle);if (q->root.qdisc ==NULL ) q->root.qdisc = &noop_qdisc; - q->root.stats_lock = &sch->dev->queue_lock;INIT_LIST_HEAD (&q->root.children); q->root.vt_tree =RB_ROOT ; q->root.cf_tree =RB_ROOT ;
Re: [NET_SCHED 02/04]: Remove unnecessary stats_lock pointers
From: Patrick McHardy <[email protected]>
Date: Tue, 19 Jun 2007 17:02:21 +0200 (MEST)
Quoted 9 lines
[
NET_SCHED]: Remove unnecessarystats_lockpointersRemove
stats_lockpointers from qdisc-internal structures, in all cases it points todev->queue_lock. The only case where it is necessary is for top-level qdiscs, where it might also point todev->ingress_lockin case of the ingress qdisc. Also remove it from actions completely, it always points to the actions internal lock.Signed-off-by Patrick McHardy <[email protected]>
Applied.
PATCH 3/4 : sch_htb: use generic estimator
In reply to Patrick McHardy[NET_SCHED]: sch_htb: use generic estimator
Use the generic estimator instead of reimplementing (parts of) it. For compatibility always create a default estimator for new classes.
---
commit f18cfcd1e11aabd3c0b606c7f3265634b5261e88
tree f611855506264ccde17bfb22b03e24728b684346
parent 00b3839a51961a8fda98d3941d0809f16be0ea59
author Patrick McHardy <[email protected]> Tue, 19 Jun 2007 16:54:15 +0200 committer Patrick McHardy <[email protected]> Tue, 19 Jun 2007 16:54:15 +0200
net/sched/sch_htb.c | 84 ++++++++++++++------------------------------------- 1 files changed, 23 insertions(+), 61 deletions(-)
net/sched/sch_htb.c +23 -61
@@ -69,8 +69,6 @@*/ #define HTB_HSIZE 16/* classid hash size */ -#define HTB_EWMAC 2/* rate average over HTB_EWMAC*HTB_HSIZE sec */ -#define HTB_RATECM 1/* whether to use rate computer */ #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ #define HTB_VER 0x30011/* major must be matched with number suplied by TC as version */
@@ -95,12 +93,6 @@ struct htb_class {struct tc_htb_xstats xstats;/* our special stats */ int refcnt;/* usage count of this class */ -#ifdef HTB_RATECM -/* rate measurement counters */ -unsigned long rate_bytes, sum_bytes; -unsigned long rate_packets, sum_packets; -#endif -/* topology */ int level;/* our level (see above) */ struct htb_class *parent;/* parent class */
@@ -194,10 +186,6 @@ struct htb_sched {int rate2quantum;/* quant = rate / rate2quantum */ psched_time_t now;/* cached dequeue time */ struct qdisc_watchdog watchdog; -#ifdef HTB_RATECM -struct timer_list rttim;/* rate computer timer */ -int recmp_bucket;/* which hash bucket to recompute next */ -#endif /* non shaped skbs; let them go directly thru */ struct sk_buff_head direct_queue;
@@ -677,34 +665,6 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)return NET_XMIT_SUCCESS ; } -#ifdef HTB_RATECM -#define RT_GEN (D ,R ) R+=D-(R/HTB_EWMAC);D=0 -static void htb_rate_timer (unsigned long arg) -{ -struct Qdisc *sch = (struct Qdisc *)arg; -struct htb_sched *q =qdisc_priv (sch); -struct hlist_node *p; -struct htb_class *cl; - - -/* lock queue so that we can muck with it */ -spin_lock_bh (&sch->dev->queue_lock); - - q->rttim.expires = jiffies +HZ ; -add_timer (&q->rttim); - -/* scan and recompute one bucket at time */ -if (++q->recmp_bucket >=HTB_HSIZE ) - q->recmp_bucket =0 ; - -hlist_for_each_entry (cl,p, q->hash + q->recmp_bucket, hlist) { -RT_GEN (cl->sum_bytes, cl->rate_bytes); -RT_GEN (cl->sum_packets, cl->rate_packets); - } -spin_unlock_bh (&sch->dev->queue_lock); -} -#endif -/** * htb_charge_class - charges amount "bytes" to leaf and ancestors *
@@ -750,11 +710,6 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,if (cl->cmode !=HTB_CAN_SEND )htb_add_to_wait_tree (q, cl, diff); } -#ifdef HTB_RATECM -/* update rate counters */ - cl->sum_bytes += bytes; - cl->sum_packets++; -#endif /* update byte stats except for leaves which are already updated */ if (cl->level) {
@@ -1095,13 +1050,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)if (q->direct_qlen <2 )/* some devices have zero tx_queue_len */ q->direct_qlen =2 ; -#ifdef HTB_RATECM -init_timer (&q->rttim); - q->rttim.function = htb_rate_timer; - q->rttim.data = (unsigned long )sch; - q->rttim.expires = jiffies +HZ ; -add_timer (&q->rttim); -#endif if ((q->rate2quantum = gopt->rate2quantum) <1 ) q->rate2quantum =1 ; q->defcls = gopt->defcls;
@@ -1175,11 +1123,6 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) {struct htb_class *cl = (struct htb_class *)arg; -#ifdef HTB_RATECM - cl->rate_est.bps = cl->rate_bytes / (HTB_EWMAC *HTB_HSIZE ); - cl->rate_est.pps = cl->rate_packets / (HTB_EWMAC *HTB_HSIZE ); -#endif -if (!cl->level && cl->un.leaf.q) cl->qstats.qlen = cl->un.leaf.q->q.qlen; cl->xstats.tokens = cl->tokens;
@@ -1277,6 +1220,7 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)BUG_TRAP (cl->un.leaf.q);qdisc_destroy (cl->un.leaf.q); } +gen_kill_estimator (&cl->bstats, &cl->rate_est);qdisc_put_rtab (cl->rate);qdisc_put_rtab (cl->ceil);
@@ -1305,9 +1249,6 @@ static void htb_destroy(struct Qdisc *sch)struct htb_sched *q =qdisc_priv (sch);qdisc_watchdog_cancel (&q->watchdog); -#ifdef HTB_RATECM -del_timer_sync (&q->rttim); -#endif /* This line used to be after htb_destroy_class call below and surprisingly it worked in 2.4. But it must precede it because filter need its target class alive to be able to call
@@ -1403,6 +1344,20 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,if (!cl) {/* new class */ struct Qdisc *new_q;int prio; +struct { +struct rtattr rta; +struct gnet_estimator opt; + } est = { + .rta = { + .rta_len =RTA_LENGTH (sizeof (est.opt)), + .rta_type =TCA_RATE , + }, + .opt = { +/* 4s interval, 16s averaging constant */ + .interval =2 , + .ewma_log =2 , + }, + };/* check for valid classid */ if (!classid || TC_H_MAJ(classid ^ sch->handle)
@@ -1418,6 +1373,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,if ((cl =kzalloc (sizeof (*cl),GFP_KERNEL )) ==NULL ) goto failure; +gen_new_estimator (&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, &est.rta); cl->refcnt =1 ;INIT_LIST_HEAD (&cl->sibling);INIT_HLIST_NODE (&cl->hlist);
@@ -1469,8 +1426,13 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,hlist_add_head (&cl->hlist, q->hash +htb_hash (classid));list_add_tail (&cl->sibling, parent ? &parent->children : &q->root); - }else + }else { +if (tca[TCA_RATE -1 ]) +gen_replace_estimator (&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, + tca[TCA_RATE -1 ]);sch_tree_lock (sch); + }/* it used to be a nasty bug here, we have to check that node is really leaf before changing cl->un.leaf ! */
Re: [NET_SCHED 03/04]: sch_htb: use generic estimator
Quoted 167 lines · Patrick McHardy
[
NET_SCHED]:sch_htb: use generic estimatorUse the generic estimator instead of reimplementing (parts of) it. For compatibility always create a default estimator for new classes.
Signed-off-by Patrick McHardy <[email protected]>---
commitf18cfcd1e11aabd3c0b606c7f3265634b5261e88
treef611855506264ccde17bfb22b03e24728b684346
parent00b3839a51961a8fda98d3941d0809f16be0ea59
author Patrick McHardy <[email protected]> Tue, 19 Jun 2007 16:54:15 +0200 committer Patrick McHardy <[email protected]> Tue, 19 Jun 2007 16:54:15 +0200net/sched/sch_htb.c | 84 ++++++++++++++------------------------------------- 1 files changed, 23 insertions(+), 61 deletions(-)net/sched/sch_htb.c +15
-60@@ -69,8 +69,6 @@*/ #define HTB_HSIZE 16/* classid hash size */ -#define HTB_EWMAC 2/* rate average over HTB_EWMAC*HTB_HSIZE sec */ -#define HTB_RATECM 1/* whether to use rate computer */ #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ #define HTB_VER 0x30011/* major must be matched with number suplied by TC as version */ @@ -95,12 +93,6 @@ struct htb_class {struct tc_htb_xstats xstats;/* our special stats */ int refcnt;/* usage count of this class */ -#ifdef HTB_RATECM -/* rate measurement counters */ -unsigned long rate_bytes, sum_bytes; -unsigned long rate_packets, sum_packets; -#endif -/* topology */ int level;/* our level (see above) */ struct htb_class *parent;/* parent class */ @@ -194,10 +186,6 @@ struct htb_sched {int rate2quantum;/* quant = rate / rate2quantum */ psched_time_t now;/* cached dequeue time */ struct qdisc_watchdog watchdog; -#ifdef HTB_RATECM -struct timer_list rttim;/* rate computer timer */ -int recmp_bucket;/* which hash bucket to recompute next */ -#endif /* non shaped skbs; let them go directly thru */ struct sk_buff_head direct_queue;@@ -677,34 +665,6 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)return NET_XMIT_SUCCESS ; } -#ifdef HTB_RATECM -#define RT_GEN (D ,R ) R+=D-(R/HTB_EWMAC);D=0 -static void htb_rate_timer (unsigned long arg) -{ -struct Qdisc *sch = (struct Qdisc *)arg; -struct htb_sched *q =qdisc_priv (sch); -struct hlist_node *p; -struct htb_class *cl; - - -/* lock queue so that we can muck with it */ -spin_lock_bh (&sch->dev->queue_lock); - - q->rttim.expires = jiffies +HZ ; -add_timer (&q->rttim); - -/* scan and recompute one bucket at time */ -if (++q->recmp_bucket >=HTB_HSIZE ) - q->recmp_bucket =0 ; - -hlist_for_each_entry (cl,p, q->hash + q->recmp_bucket, hlist) { -RT_GEN (cl->sum_bytes, cl->rate_bytes); -RT_GEN (cl->sum_packets, cl->rate_packets); - } -spin_unlock_bh (&sch->dev->queue_lock); -} -#endif -/** * htb_charge_class - charges amount "bytes" to leaf and ancestors * @@ -750,11 +710,6 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,if (cl->cmode !=HTB_CAN_SEND )htb_add_to_wait_tree (q, cl, diff); } -#ifdef HTB_RATECM -/* update rate counters */ - cl->sum_bytes += bytes; - cl->sum_packets++; -#endif /* update byte stats except for leaves which are already updated */ if (cl->level) {@@ -1095,13 +1050,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)if (q->direct_qlen <2 )/* some devices have zero tx_queue_len */ q->direct_qlen =2 ; -#ifdef HTB_RATECM -init_timer (&q->rttim); - q->rttim.function = htb_rate_timer; - q->rttim.data = (unsigned long )sch; - q->rttim.expires = jiffies +HZ ; -add_timer (&q->rttim); -#endif if ((q->rate2quantum = gopt->rate2quantum) <1 ) q->rate2quantum =1 ; q->defcls = gopt->defcls;@@ -1175,11 +1123,6 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) {struct htb_class *cl = (struct htb_class *)arg; -#ifdef HTB_RATECM - cl->rate_est.bps = cl->rate_bytes / (HTB_EWMAC *HTB_HSIZE ); - cl->rate_est.pps = cl->rate_packets / (HTB_EWMAC *HTB_HSIZE ); -#endif -if (!cl->level && cl->un.leaf.q) cl->qstats.qlen = cl->un.leaf.q->q.qlen; cl->xstats.tokens = cl->tokens;@@ -1277,6 +1220,7 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)BUG_TRAP (cl->un.leaf.q);qdisc_destroy (cl->un.leaf.q); } +gen_kill_estimator (&cl->bstats, &cl->rate_est);qdisc_put_rtab (cl->rate);qdisc_put_rtab (cl->ceil);@@ -1305,9 +1249,6 @@ static void htb_destroy(struct Qdisc *sch)struct htb_sched *q =qdisc_priv (sch);qdisc_watchdog_cancel (&q->watchdog); -#ifdef HTB_RATECM -del_timer_sync (&q->rttim); -#endif /* This line used to be after htb_destroy_class call below and surprisingly it worked in 2.4. But it must precede it because filter need its target class alive to be able to call @@ -1403,6 +1344,20 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,if (!cl) {/* new class */ struct Qdisc *new_q;int prio; +struct { +struct rtattr rta; +struct gnet_estimator opt; + } est = { + .rta = { + .rta_len =RTA_LENGTH (sizeof (est.opt)), + .rta_type =TCA_RATE , + }, + .opt = { +/* 4s interval, 16s averaging constant */ + .interval =2 , + .ewma_log =2 , + }, + };/* check for valid classid */ if (!classid || TC_H_MAJ(classid ^ sch->handle)
net/sched/sch_htb.c static int htb_change_class(struct Qdisc *sch, u32 classid, · line 1377
Quoted 5 lines
net/sched/sch_htb.c +2
-0@@ -1418,6 +1373,8 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,if ((cl =kzalloc (sizeof (*cl),GFP_KERNEL )) ==NULL ) goto failure; +gen_new_estimator (&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, &est.rta);
Probably need to change the last parameter to tca[TCA_RATE-1]?:&est.rta to check if estimator params are specified at creation time?
-Thanks,
Ranjit
Quoted 23 lines
net/sched/sch_htb.c +6
-2cl->refcnt =1 ;INIT_LIST_HEAD (&cl->sibling);INIT_HLIST_NODE (&cl->hlist);@@ -1469,8 +1426,13 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,hlist_add_head (&cl->hlist, q->hash +htb_hash (classid));list_add_tail (&cl->sibling, parent ? &parent->children : &q->root); - }else + }else { +if (tca[TCA_RATE -1 ]) +gen_replace_estimator (&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, + tca[TCA_RATE -1 ]);sch_tree_lock (sch); + }/* it used to be a nasty bug here, we have to check that node is really leaf before changing cl->un.leaf ! */ -To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [NET_SCHED 03/04]: sch_htb: use generic estimator
Quoted 8 lines · Ranjit Manomohan
Quoted 6 lines · Patrick McHardy
[
NET_SCHED]:sch_htb: use generic estimatorUse the generic estimator instead of reimplementing (parts of) it. For compatibility always create a default estimator for new classes.
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ gen_new_estimator(&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, &est.rta);Probably need to change the last parameter to tca[TCA_RATE-1]?:&est.rta to check if estimator params are specified at creation time?
Good point, thanks for catching this.
[NET_SCHED]: sch_htb: use generic estimator
Use the generic estimator instead of reimplementing (parts of) it. For compatibility always create a default estimator for new classes.
---
commit 156d3d463446258c3e72b9dc10238e807bfeec71
tree a136f5576a0ca3066c200c577e559097e6a5d4b8
parent 831e7e7451b662679e0e3cf56e7c070a027de306
author Patrick McHardy <[email protected]> Tue, 19 Jun 2007 23:21:00 +0200 committer Patrick McHardy <[email protected]> Tue, 19 Jun 2007 23:21:00 +0200
net/sched/sch_htb.c | 85 ++++++++++++++------------------------------------- 1 files changed, 24 insertions(+), 61 deletions(-)
net/sched/sch_htb.c +24 -61
@@ -69,8 +69,6 @@*/ #define HTB_HSIZE 16/* classid hash size */ -#define HTB_EWMAC 2/* rate average over HTB_EWMAC*HTB_HSIZE sec */ -#define HTB_RATECM 1/* whether to use rate computer */ #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ #define HTB_VER 0x30011/* major must be matched with number suplied by TC as version */
@@ -95,12 +93,6 @@ struct htb_class {struct tc_htb_xstats xstats;/* our special stats */ int refcnt;/* usage count of this class */ -#ifdef HTB_RATECM -/* rate measurement counters */ -unsigned long rate_bytes, sum_bytes; -unsigned long rate_packets, sum_packets; -#endif -/* topology */ int level;/* our level (see above) */ struct htb_class *parent;/* parent class */
@@ -194,10 +186,6 @@ struct htb_sched {int rate2quantum;/* quant = rate / rate2quantum */ psched_time_t now;/* cached dequeue time */ struct qdisc_watchdog watchdog; -#ifdef HTB_RATECM -struct timer_list rttim;/* rate computer timer */ -int recmp_bucket;/* which hash bucket to recompute next */ -#endif /* non shaped skbs; let them go directly thru */ struct sk_buff_head direct_queue;
@@ -677,34 +665,6 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)return NET_XMIT_SUCCESS ; } -#ifdef HTB_RATECM -#define RT_GEN (D ,R ) R+=D-(R/HTB_EWMAC);D=0 -static void htb_rate_timer (unsigned long arg) -{ -struct Qdisc *sch = (struct Qdisc *)arg; -struct htb_sched *q =qdisc_priv (sch); -struct hlist_node *p; -struct htb_class *cl; - - -/* lock queue so that we can muck with it */ -spin_lock_bh (&sch->dev->queue_lock); - - q->rttim.expires = jiffies +HZ ; -add_timer (&q->rttim); - -/* scan and recompute one bucket at time */ -if (++q->recmp_bucket >=HTB_HSIZE ) - q->recmp_bucket =0 ; - -hlist_for_each_entry (cl,p, q->hash + q->recmp_bucket, hlist) { -RT_GEN (cl->sum_bytes, cl->rate_bytes); -RT_GEN (cl->sum_packets, cl->rate_packets); - } -spin_unlock_bh (&sch->dev->queue_lock); -} -#endif -/** * htb_charge_class - charges amount "bytes" to leaf and ancestors *
@@ -750,11 +710,6 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,if (cl->cmode !=HTB_CAN_SEND )htb_add_to_wait_tree (q, cl, diff); } -#ifdef HTB_RATECM -/* update rate counters */ - cl->sum_bytes += bytes; - cl->sum_packets++; -#endif /* update byte stats except for leaves which are already updated */ if (cl->level) {
@@ -1095,13 +1050,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)if (q->direct_qlen <2 )/* some devices have zero tx_queue_len */ q->direct_qlen =2 ; -#ifdef HTB_RATECM -init_timer (&q->rttim); - q->rttim.function = htb_rate_timer; - q->rttim.data = (unsigned long )sch; - q->rttim.expires = jiffies +HZ ; -add_timer (&q->rttim); -#endif if ((q->rate2quantum = gopt->rate2quantum) <1 ) q->rate2quantum =1 ; q->defcls = gopt->defcls;
@@ -1175,11 +1123,6 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d) {struct htb_class *cl = (struct htb_class *)arg; -#ifdef HTB_RATECM - cl->rate_est.bps = cl->rate_bytes / (HTB_EWMAC *HTB_HSIZE ); - cl->rate_est.pps = cl->rate_packets / (HTB_EWMAC *HTB_HSIZE ); -#endif -if (!cl->level && cl->un.leaf.q) cl->qstats.qlen = cl->un.leaf.q->q.qlen; cl->xstats.tokens = cl->tokens;
@@ -1277,6 +1220,7 @@ static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl)BUG_TRAP (cl->un.leaf.q);qdisc_destroy (cl->un.leaf.q); } +gen_kill_estimator (&cl->bstats, &cl->rate_est);qdisc_put_rtab (cl->rate);qdisc_put_rtab (cl->ceil);
@@ -1305,9 +1249,6 @@ static void htb_destroy(struct Qdisc *sch)struct htb_sched *q =qdisc_priv (sch);qdisc_watchdog_cancel (&q->watchdog); -#ifdef HTB_RATECM -del_timer_sync (&q->rttim); -#endif /* This line used to be after htb_destroy_class call below and surprisingly it worked in 2.4. But it must precede it because filter need its target class alive to be able to call
@@ -1403,6 +1344,20 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,if (!cl) {/* new class */ struct Qdisc *new_q;int prio; +struct { +struct rtattr rta; +struct gnet_estimator opt; + } est = { + .rta = { + .rta_len =RTA_LENGTH (sizeof (est.opt)), + .rta_type =TCA_RATE , + }, + .opt = { +/* 4s interval, 16s averaging constant */ + .interval =2 , + .ewma_log =2 , + }, + };/* check for valid classid */ if (!classid || TC_H_MAJ(classid ^ sch->handle)
@@ -1418,6 +1373,9 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,if ((cl =kzalloc (sizeof (*cl),GFP_KERNEL )) ==NULL ) goto failure; +gen_new_estimator (&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, + tca[TCA_RATE -1 ] ? : &est.rta); cl->refcnt =1 ;INIT_LIST_HEAD (&cl->sibling);INIT_HLIST_NODE (&cl->hlist);
@@ -1469,8 +1427,13 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,hlist_add_head (&cl->hlist, q->hash +htb_hash (classid));list_add_tail (&cl->sibling, parent ? &parent->children : &q->root); - }else + }else { +if (tca[TCA_RATE -1 ]) +gen_replace_estimator (&cl->bstats, &cl->rate_est, + &sch->dev->queue_lock, + tca[TCA_RATE -1 ]);sch_tree_lock (sch); + }/* it used to be a nasty bug here, we have to check that node is really leaf before changing cl->un.leaf ! */
Re: [NET_SCHED 03/04]: sch_htb: use generic estimator
From: Patrick McHardy <[email protected]>
Date: Tue, 19 Jun 2007 23:22:06 +0200
Quoted 6 lines
[
NET_SCHED]:sch_htb: use generic estimatorUse the generic estimator instead of reimplementing (parts of) it. For compatibility always create a default estimator for new classes.
Signed-off-by Patrick McHardy <[email protected]>
Applied, thanks.
PATCH 4/4 : Remove unnecessary includes
In reply to Patrick McHardy[NET_SCHED]: Remove unnecessary includes
---
commit ca29df065c5d0caa69cde99f9cf1775d63b3468d
tree 102917a89c4c3e63f9ba1d586bd112614f8c6614
parent f18cfcd1e11aabd3c0b606c7f3265634b5261e88
author Patrick McHardy <[email protected]> Tue, 19 Jun 2007 16:54:18 +0200 committer Patrick McHardy <[email protected]> Tue, 19 Jun 2007 16:54:18 +0200
net/sched/act_api.c | 10 ---------- net/sched/act_gact.c | 11 ----------- net/sched/act_ipt.c | 12 ------------ net/sched/act_mirred.c | 12 ------------ net/sched/act_pedit.c | 11 ----------- net/sched/act_police.c | 10 ---------- net/sched/act_simple.c | 1 - net/sched/cls_api.c | 10 ---------- net/sched/cls_basic.c | 1 - net/sched/cls_fw.c | 19 +------------------ net/sched/cls_route.c | 20 +++----------------- net/sched/cls_rsvp.c | 17 +---------------- net/sched/cls_rsvp6.c | 16 ---------------- net/sched/cls_tcindex.c | 3 --- net/sched/cls_u32.c | 18 +----------------- net/sched/ematch.c | 2 -- net/sched/sch_api.c | 12 ------------ net/sched/sch_atm.c | 3 --- net/sched/sch_blackhole.c | 1 - net/sched/sch_cbq.c | 18 +----------------- net/sched/sch_dsmark.c | 1 - net/sched/sch_fifo.c | 1 - net/sched/sch_generic.c | 8 -------- net/sched/sch_gred.c | 1 - net/sched/sch_hfsc.c | 3 --- net/sched/sch_htb.c | 18 +----------------- net/sched/sch_ingress.c | 9 +-------- net/sched/sch_netem.c | 2 -- net/sched/sch_prio.c | 16 ---------------- net/sched/sch_red.c | 1 - net/sched/sch_sfq.c | 18 ++---------------- net/sched/sch_tbf.c | 19 +------------------ net/sched/sch_teql.c | 18 ++---------------- 33 files changed, 14 insertions(+), 308 deletions(-)
net/sched/act_api.c +0 -10
@@ -11,23 +11,13 @@* */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/init.h> #include <linux/kmod.h> -#include <net/sock.h> #include <net/sch_generic.h> #include <net/act_api.h> #include <net/netlink.h>
net/sched/act_gact.c +0 -11
@@ -10,26 +10,15 @@* */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/proc_fs.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> #include <linux/tc_act/tc_gact.h> #include <net/tc_act/tc_gact.h>
net/sched/act_ipt.c +0 -12
@@ -11,27 +11,15 @@* Copyright: Jamal Hadi Salim (2002-4) */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <asm/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/proc_fs.h> -#include <linux/kmod.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> #include <linux/tc_act/tc_ipt.h> #include <net/tc_act/tc_ipt.h>
net/sched/act_mirred.c +0 -12
@@ -12,31 +12,19 @@* */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <asm/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/proc_fs.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> #include <linux/tc_act/tc_mirred.h> #include <net/tc_act/tc_mirred.h> -#include <linux/etherdevice.h> #include <linux/if_arp.h> #define MIRRED_TAB_MASK 7
net/sched/act_pedit.c +0 -11
@@ -9,26 +9,15 @@* Authors: Jamal Hadi Salim (2002-4) */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <asm/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/proc_fs.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> #include <linux/tc_act/tc_pedit.h> #include <net/tc_act/tc_pedit.h>
net/sched/act_police.c +0 -10
@@ -10,25 +10,15 @@* J Hadi Salim (action changes) */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/module.h> #include <linux/rtnetlink.h> #include <linux/init.h> -#include <net/sock.h> #include <net/act_api.h> #include <net/netlink.h>
net/sched/act_simple.c +0 -1
@@ -13,7 +13,6 @@#include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <net/netlink.h>
net/sched/cls_api.c +0 -10
@@ -14,26 +14,16 @@* */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/init.h> #include <linux/kmod.h> #include <linux/netlink.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> #include <net/pkt_cls.h>
net/sched/cls_basic.c +0 -1
@@ -13,7 +13,6 @@#include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> #include <linux/errno.h> #include <linux/rtnetlink.h> #include <linux/skbuff.h>
net/sched/cls_fw.c +1 -18
@@ -19,29 +19,12 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <linux/netfilter.h> -#include <net/ip.h> -#include <net/netlink.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/netlink.h> #include <net/act_api.h> #include <net/pkt_cls.h>
net/sched/cls_route.c +3 -17
@@ -10,28 +10,14 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> -#include <net/netlink.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/dst.h> +#include <net/route.h> +#include <net/netlink.h> #include <net/act_api.h> #include <net/pkt_cls.h>
net/sched/cls_rsvp.c +1 -16
@@ -10,27 +10,12 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/ip.h> #include <net/netlink.h> #include <net/act_api.h> #include <net/pkt_cls.h>
net/sched/cls_rsvp6.c +0 -16
@@ -10,28 +10,12 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> #include <linux/ipv6.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> #include <net/act_api.h> #include <net/pkt_cls.h> #include <net/netlink.h>
net/sched/cls_tcindex.c +0 -3
@@ -9,12 +9,9 @@#include <linux/kernel.h> #include <linux/skbuff.h> #include <linux/errno.h> -#include <linux/netdevice.h> -#include <net/ip.h> #include <net/act_api.h> #include <net/netlink.h> #include <net/pkt_cls.h> -#include <net/route.h> /*
net/sched/cls_u32.c +1 -17
@@ -30,30 +30,14 @@* nfmark match added by Catalin(ux aka Dino) BOIE <catab at umbrella.ro> */ -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> #include <linux/rtnetlink.h> -#include <net/ip.h> -#include <net/netlink.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/netlink.h> #include <net/act_api.h> #include <net/pkt_cls.h>
net/sched/ematch.c +0 -2
@@ -84,9 +84,7 @@#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> -#include <linux/mm.h> #include <linux/errno.h> -#include <linux/interrupt.h> #include <linux/rtnetlink.h> #include <linux/skbuff.h> #include <net/pkt_cls.h>
net/sched/sch_api.c +0 -12
@@ -19,30 +19,18 @@#include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/init.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/kmod.h> #include <linux/list.h> -#include <linux/bitops.h> #include <linux/hrtimer.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> -#include <asm/processor.h> -#include <asm/uaccess.h> -#include <asm/system.h> -static int qdisc_notify (struct sk_buff *oskb,struct nlmsghdr *n,u32 clid,struct Qdisc *old,struct Qdisc *new); static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n,
net/sched/sch_atm.c +0 -3
@@ -8,15 +8,12 @@#include <linux/string.h> #include <linux/errno.h> #include <linux/skbuff.h> -#include <linux/interrupt.h> #include <linux/atmdev.h> #include <linux/atmclip.h> -#include <linux/netdevice.h> #include <linux/rtnetlink.h> #include <linux/file.h> /* for fput */ #include <net/netlink.h> #include <net/pkt_sched.h> -#include <net/sock.h> extern struct socket *sockfd_lookup (int fd,int *err);/* @@@ fix this */
net/sched/sch_blackhole.c +0 -1
@@ -14,7 +14,6 @@#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <net/pkt_sched.h>
net/sched/sch_cbq.c +1 -17
@@ -11,28 +11,12 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> -#include <net/netlink.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/netlink.h> #include <net/pkt_sched.h>
net/sched/sch_dsmark.c +0 -1
@@ -9,7 +9,6 @@#include <linux/string.h> #include <linux/errno.h> #include <linux/skbuff.h> -#include <linux/netdevice.h> /* for pkt_sched */ #include <linux/rtnetlink.h> #include <net/pkt_sched.h> #include <net/dsfield.h>
net/sched/sch_fifo.c +0 -1
@@ -13,7 +13,6 @@#include <linux/types.h> #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <net/pkt_sched.h>
net/sched/sch_generic.c +0 -8
@@ -11,27 +11,19 @@* - Ingress support */ -#include <asm/uaccess.h> -#include <asm/system.h> #include <linux/bitops.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h> #include <linux/init.h> #include <linux/rcupdate.h> #include <linux/list.h> -#include <net/sock.h> #include <net/pkt_sched.h> #define SCHED_TX_DROP -2
net/sched/sch_gred.c +0 -1
@@ -21,7 +21,6 @@#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <net/pkt_sched.h> #include <net/red.h>
net/sched/sch_hfsc.c +0 -3
@@ -53,7 +53,6 @@#include <linux/module.h> #include <linux/types.h> #include <linux/errno.h> -#include <linux/jiffies.h> #include <linux/compiler.h> #include <linux/spinlock.h> #include <linux/skbuff.h>
@@ -62,13 +61,11 @@#include <linux/list.h> #include <linux/rbtree.h> #include <linux/init.h> -#include <linux/netdevice.h> #include <linux/rtnetlink.h> #include <linux/pkt_sched.h> #include <net/netlink.h> #include <net/pkt_sched.h> #include <net/pkt_cls.h> -#include <asm/system.h> #include <asm/div64.h> /*
net/sched/sch_htb.c +1 -17
@@ -28,32 +28,16 @@* $Id: sch_htb.c,v 1.25 2003/12/07 11:08:25 devik Exp devik $ */ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> -#include <net/route.h> #include <linux/skbuff.h> #include <linux/list.h> #include <linux/compiler.h> +#include <linux/rbtree.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h> -#include <linux/rbtree.h> /* HTB algorithm. Author: [email protected]
net/sched/sch_ingress.c +1 -8
@@ -9,21 +9,14 @@#include <linux/module.h> #include <linux/types.h> +#include <linux/list.h> #include <linux/skbuff.h> -#include <linux/netdevice.h> #include <linux/rtnetlink.h> #include <linux/netfilter_ipv4.h> #include <linux/netfilter_ipv6.h> #include <linux/netfilter.h> -#include <linux/smp.h> #include <net/netlink.h> #include <net/pkt_sched.h> -#include <asm/byteorder.h> -#include <asm/uaccess.h> -#include <linux/kmod.h> -#include <linux/stat.h> -#include <linux/interrupt.h> -#include <linux/list.h> #undef DEBUG_INGRESS
net/sched/sch_netem.c +0 -2
@@ -14,11 +14,9 @@*/ #include <linux/module.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/errno.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/rtnetlink.h>
net/sched/sch_prio.c +0 -16
@@ -12,28 +12,12 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> -#include <net/route.h> #include <linux/skbuff.h> #include <net/netlink.h> -#include <net/sock.h> #include <net/pkt_sched.h>
net/sched/sch_red.c +0 -1
@@ -17,7 +17,6 @@#include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> -#include <linux/netdevice.h> #include <linux/skbuff.h> #include <net/pkt_sched.h> #include <net/inet_ecn.h>
net/sched/sch_sfq.c +2 -16
@@ -10,31 +10,17 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/jiffies.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> #include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> #include <linux/init.h> -#include <net/ip.h> -#include <net/netlink.h> #include <linux/ipv6.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/ip.h> +#include <net/netlink.h> #include <net/pkt_sched.h>
net/sched/sch_tbf.c +1 -18
@@ -13,29 +13,12 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> -#include <linux/jiffies.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> -#include <linux/if_ether.h> -#include <linux/inet.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> -#include <net/ip.h> -#include <net/netlink.h> -#include <net/route.h> #include <linux/skbuff.h> -#include <net/sock.h> +#include <net/netlink.h> #include <net/pkt_sched.h>
net/sched/sch_teql.c +2 -16
@@ -9,30 +9,17 @@*/ #include <linux/module.h> -#include <asm/uaccess.h> -#include <asm/system.h> -#include <linux/bitops.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/string.h> -#include <linux/mm.h> -#include <linux/socket.h> -#include <linux/sockios.h> -#include <linux/in.h> #include <linux/errno.h> -#include <linux/interrupt.h> #include <linux/if_arp.h> -#include <linux/if_ether.h> -#include <linux/inet.h> #include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/notifier.h> #include <linux/init.h> -#include <net/ip.h> -#include <net/route.h> #include <linux/skbuff.h> #include <linux/moduleparam.h> -#include <net/sock.h> +#include <net/dst.h> +#include <net/neighbour.h> #include <net/pkt_sched.h> /*
@@ -225,7 +212,6 @@ static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)return 0 ; } -/* "teql*" netdevice routines */ static int __teql_resolve (struct sk_buff *skb,struct sk_buff *skb_res,struct net_device *dev)
Re: [NET_SCHED 04/04]: Remove unnecessary includes
From: Patrick McHardy <[email protected]>
Date: Tue, 19 Jun 2007 17:02:23 +0200 (MEST)
Quoted 3 lines
[
NET_SCHED]: Remove unnecessary includesSigned-off-by Patrick McHardy <[email protected]>
There was a minor conflict with the multi-queue patches but it was line number noise so I took care of it.
Applied, thanks!