diff options
author | Eric Dumazet <edumazet@google.com> | 2013-09-19 18:10:03 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-20 20:41:02 +0200 |
commit | 3e1e3aae1f5d4e8e5edb7e332f6e265597cc5b0a (patch) | |
tree | 26737c73709aa3a29ad1c435e6bb7cd83126f4c6 /include | |
parent | net: ethernet: eth.c: removed checkpatch warnings and errors (diff) | |
download | linux-3e1e3aae1f5d4e8e5edb7e332f6e265597cc5b0a.tar.xz linux-3e1e3aae1f5d4e8e5edb7e332f6e265597cc5b0a.zip |
net_sched: add u64 rate to psched_ratecfg_precompute()
Add an extra u64 rate parameter to psched_ratecfg_precompute()
so that some qdisc can opt-in for 64bit rates in the future,
to overcome the ~34 Gbits limit.
psched_ratecfg_getrate() reports a legacy structure to
tc utility, so if actual rate is above the 32bit rate field,
cap it to the 34Gbit limit.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sch_generic.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f4eb365f7dcd..d0a6321c302e 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -702,13 +702,20 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, } void psched_ratecfg_precompute(struct psched_ratecfg *r, - const struct tc_ratespec *conf); + const struct tc_ratespec *conf, + u64 rate64); static inline void psched_ratecfg_getrate(struct tc_ratespec *res, const struct psched_ratecfg *r) { memset(res, 0, sizeof(*res)); - res->rate = r->rate_bytes_ps; + + /* legacy struct tc_ratespec has a 32bit @rate field + * Qdisc using 64bit rate should add new attributes + * in order to maintain compatibility. + */ + res->rate = min_t(u64, r->rate_bytes_ps, ~0U); + res->overhead = r->overhead; res->linklayer = (r->linklayer & TC_LINKLAYER_MASK); } |