aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 1540f9c2fcf4..f10818fc8804 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -195,7 +195,7 @@ struct tcf_proto_ops {
195 195
196 unsigned long (*get)(struct tcf_proto*, u32 handle); 196 unsigned long (*get)(struct tcf_proto*, u32 handle);
197 void (*put)(struct tcf_proto*, unsigned long); 197 void (*put)(struct tcf_proto*, unsigned long);
198 int (*change)(struct sk_buff *, 198 int (*change)(struct net *net, struct sk_buff *,
199 struct tcf_proto*, unsigned long, 199 struct tcf_proto*, unsigned long,
200 u32 handle, struct nlattr **, 200 u32 handle, struct nlattr **,
201 unsigned long *); 201 unsigned long *);
@@ -339,11 +339,10 @@ static inline struct Qdisc_class_common *
339qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id) 339qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
340{ 340{
341 struct Qdisc_class_common *cl; 341 struct Qdisc_class_common *cl;
342 struct hlist_node *n;
343 unsigned int h; 342 unsigned int h;
344 343
345 h = qdisc_class_hash(id, hash->hashmask); 344 h = qdisc_class_hash(id, hash->hashmask);
346 hlist_for_each_entry(cl, n, &hash->hash[h], hnode) { 345 hlist_for_each_entry(cl, &hash->hash[h], hnode) {
347 if (cl->classid == id) 346 if (cl->classid == id)
348 return cl; 347 return cl;
349 } 348 }
@@ -679,4 +678,23 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask,
679} 678}
680#endif 679#endif
681 680
681struct psched_ratecfg {
682 u64 rate_bps;
683 u32 mult;
684 u32 shift;
685};
686
687static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
688 unsigned int len)
689{
690 return ((u64)len * r->mult) >> r->shift;
691}
692
693extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate);
694
695static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r)
696{
697 return r->rate_bps >> 3;
698}
699
682#endif 700#endif