diff options
author | Eric Dumazet <edumazet@google.com> | 2013-06-02 09:55:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-03 01:22:35 -0400 |
commit | 01cb71d2d47b78354358e4bb938bb06323e17498 (patch) | |
tree | 76aee7a59adb57237616a87a6c23102f90eacd8f /include/net/sch_generic.h | |
parent | c87a124a5d5e8cf8e21c4363c3372bcaf53ea190 (diff) |
net_sched: restore "overhead xxx" handling
commit 56b765b79 ("htb: improved accuracy at high rates")
broke the "overhead xxx" handling, as well as the "linklayer atm"
attribute.
tc class add ... htb rate X ceil Y linklayer atm overhead 10
This patch restores the "overhead xxx" handling, for htb, tbf
and act_police
The "linklayer atm" thing needs a separate fix.
Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Vimalkumar <j.vimal@gmail.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 |