diff options
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f10818fc8804..e7f4e21cc3e1 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -679,22 +679,26 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, | |||
679 | #endif | 679 | #endif |
680 | 680 | ||
681 | struct psched_ratecfg { | 681 | struct psched_ratecfg { |
682 | u64 rate_bps; | 682 | u64 rate_bps; |
683 | u32 mult; | 683 | u32 mult; |
684 | u32 shift; | 684 | u16 overhead; |
685 | u8 shift; | ||
685 | }; | 686 | }; |
686 | 687 | ||
687 | static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, | 688 | static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, |
688 | unsigned int len) | 689 | unsigned int len) |
689 | { | 690 | { |
690 | return ((u64)len * r->mult) >> r->shift; | 691 | return ((u64)(len + r->overhead) * r->mult) >> r->shift; |
691 | } | 692 | } |
692 | 693 | ||
693 | extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate); | 694 | extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); |
694 | 695 | ||
695 | static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r) | 696 | static inline void psched_ratecfg_getrate(struct tc_ratespec *res, |
697 | const struct psched_ratecfg *r) | ||
696 | { | 698 | { |
697 | return r->rate_bps >> 3; | 699 | memset(res, 0, sizeof(*res)); |
700 | res->rate = r->rate_bps >> 3; | ||
701 | res->overhead = r->overhead; | ||
698 | } | 702 | } |
699 | 703 | ||
700 | #endif | 704 | #endif |