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
179179 TCA_TBF_PRATE64,
180180 TCA_TBF_BURST,
181181 TCA_TBF_PBURST,
182+ TCA_TBF_PAD,
182183 __TCA_TBF_MAX,
183184 };
184185
@@ -368,6 +369,7 @@ enum { · 183 unmodified lines
368369 TCA_HTB_DIRECT_QLEN,
369370 TCA_HTB_RATE64,
370371 TCA_HTB_CEIL64,
372+ TCA_HTB_PAD,
371373 __TCA_HTB_MAX,
372374 };
373375
@@ -531,6 +533,7 @@ enum { · 157 unmodified lines
531533 TCA_NETEM_RATE,
532534 TCA_NETEM_ECN,
533535 TCA_NETEM_RATE64,
536+ TCA_NETEM_PAD,
534537 __TCA_NETEM_MAX,
535538 };
536539
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
11221122 if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt))
11231123 goto nla_put_failure;
11241124 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))
11261127 goto nla_put_failure;
11271128 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))
11291131 goto nla_put_failure;
11301132
11311133 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
994994 goto nla_put_failure;
995995
996996 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))
998999 goto nla_put_failure;
9991000 rate.rate = ~0U;
10001001 } 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
472472 if (nla_put(skb, TCA_TBF_PARMS, sizeof(opt), &opt))
473473 goto nla_put_failure;
474474 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))
476477 goto nla_put_failure;
477478 if (tbf_peak_present(q) &&
478479 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))
480482 goto nla_put_failure;
481483
482484 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