History

sched: use nla_put_u64_64bit()

Nicolas Dichtel committed 10 years ago

Commit 2a51c1e1 parent 343a6d84 files · +13 −5Browse files

Unified · Split

4 files
  1. include/uapi/linux/pkt_sched.h +3 −0
  2. net/sched/sch_htb.c +4 −2
  3. net/sched/sch_netem.c +2 −1
  4. net/sched/sch_tbf.c +4 −2
include/uapi/linux/pkt_sched.h+3−0
@@ -179,6 +179,7 @@ enum { · 178 unmodified lines
179 TCA_TBF_PRATE64,179 TCA_TBF_PRATE64,
180 TCA_TBF_BURST,180 TCA_TBF_BURST,
181 TCA_TBF_PBURST,181 TCA_TBF_PBURST,
182 TCA_TBF_PAD,
182 __TCA_TBF_MAX,183 __TCA_TBF_MAX,
183};184};
184 185
@@ -368,6 +369,7 @@ enum { · 183 unmodified lines
368 TCA_HTB_DIRECT_QLEN,369 TCA_HTB_DIRECT_QLEN,
369 TCA_HTB_RATE64,370 TCA_HTB_RATE64,
370 TCA_HTB_CEIL64,371 TCA_HTB_CEIL64,
372 TCA_HTB_PAD,
371 __TCA_HTB_MAX,373 __TCA_HTB_MAX,
372};374};
373 375
@@ -531,6 +533,7 @@ enum { · 157 unmodified lines
531 TCA_NETEM_RATE,533 TCA_NETEM_RATE,
532 TCA_NETEM_ECN,534 TCA_NETEM_ECN,
533 TCA_NETEM_RATE64,535 TCA_NETEM_RATE64,
536 TCA_NETEM_PAD,
534 __TCA_NETEM_MAX,537 __TCA_NETEM_MAX,
535};538};
536 539
net/sched/sch_htb.c+4−2
@@ -1122,10 +1122,12 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, · 1121 unmodified lines
1122 if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt))1122 if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt))
1123 goto nla_put_failure;1123 goto nla_put_failure;
1124 if ((cl->rate.rate_bytes_ps >= (1ULL << 32)) &&1124 if ((cl->rate.rate_bytes_ps >= (1ULL << 32)) &&
1125 nla_put_u64(skb, TCA_HTB_RATE64, cl->rate.rate_bytes_ps))1125 nla_put_u64_64bit(skb, TCA_HTB_RATE64, cl->rate.rate_bytes_ps,
1126 TCA_HTB_PAD))
1126 goto nla_put_failure;1127 goto nla_put_failure;
1127 if ((cl->ceil.rate_bytes_ps >= (1ULL << 32)) &&1128 if ((cl->ceil.rate_bytes_ps >= (1ULL << 32)) &&
1128 nla_put_u64(skb, TCA_HTB_CEIL64, cl->ceil.rate_bytes_ps))1129 nla_put_u64_64bit(skb, TCA_HTB_CEIL64, cl->ceil.rate_bytes_ps,
1130 TCA_HTB_PAD))
1129 goto nla_put_failure;1131 goto nla_put_failure;
1130 1132
1131 return nla_nest_end(skb, nest);1133 return nla_nest_end(skb, nest);
net/sched/sch_netem.c+2−1
@@ -994,7 +994,8 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb) · 993 unmodified lines
994 goto nla_put_failure;994 goto nla_put_failure;
995 995
996 if (q->rate >= (1ULL << 32)) {996 if (q->rate >= (1ULL << 32)) {
997 if (nla_put_u64(skb, TCA_NETEM_RATE64, q->rate))997 if (nla_put_u64_64bit(skb, TCA_NETEM_RATE64, q->rate,
998 TCA_NETEM_PAD))
998 goto nla_put_failure;999 goto nla_put_failure;
999 rate.rate = ~0U;1000 rate.rate = ~0U;
1000 } else {1001 } else {
net/sched/sch_tbf.c+4−2
@@ -472,11 +472,13 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb) · 471 unmodified lines
472 if (nla_put(skb, TCA_TBF_PARMS, sizeof(opt), &opt))472 if (nla_put(skb, TCA_TBF_PARMS, sizeof(opt), &opt))
473 goto nla_put_failure;473 goto nla_put_failure;
474 if (q->rate.rate_bytes_ps >= (1ULL << 32) &&474 if (q->rate.rate_bytes_ps >= (1ULL << 32) &&
475 nla_put_u64(skb, TCA_TBF_RATE64, q->rate.rate_bytes_ps))475 nla_put_u64_64bit(skb, TCA_TBF_RATE64, q->rate.rate_bytes_ps,
476 TCA_TBF_PAD))
476 goto nla_put_failure;477 goto nla_put_failure;
477 if (tbf_peak_present(q) &&478 if (tbf_peak_present(q) &&
478 q->peak.rate_bytes_ps >= (1ULL << 32) &&479 q->peak.rate_bytes_ps >= (1ULL << 32) &&
479 nla_put_u64(skb, TCA_TBF_PRATE64, q->peak.rate_bytes_ps))480 nla_put_u64_64bit(skb, TCA_TBF_PRATE64, q->peak.rate_bytes_ps,
481 TCA_TBF_PAD))
480 goto nla_put_failure;482 goto nla_put_failure;
481 483
482 return nla_nest_end(skb, nest);484 return nla_nest_end(skb, nest);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t