diff options
author | stephen hemminger <shemminger@vyatta.com> | 2011-02-23 08:04:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-25 01:11:54 -0500 |
commit | df173bda2639ac744ccf596ec1f8f7e66fe4c343 (patch) | |
tree | bd74a3a10b0503c578eb1ba5dcd6a4bad59c47d1 | |
parent | 6373a9a286bdd955a76924cee88a2f8f784988b1 (diff) |
netem: define NETEM_DIST_MAX
Rather than magic constant in code, expose the maximum size of
packet distribution table in API. In iproute2, q_netem defines
MAX_DIST as 16K already.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/pkt_sched.h | 1 | ||||
-rw-r--r-- | net/sched/sch_netem.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 5afee2b238bd..891382268fe1 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -495,6 +495,7 @@ struct tc_netem_corrupt { | |||
495 | }; | 495 | }; |
496 | 496 | ||
497 | #define NETEM_DIST_SCALE 8192 | 497 | #define NETEM_DIST_SCALE 8192 |
498 | #define NETEM_DIST_MAX 16384 | ||
498 | 499 | ||
499 | /* DRR */ | 500 | /* DRR */ |
500 | 501 | ||
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 86dad1eee549..289febd3ccac 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -332,7 +332,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr) | |||
332 | int i; | 332 | int i; |
333 | size_t s; | 333 | size_t s; |
334 | 334 | ||
335 | if (n > 65536) | 335 | if (n > NETEM_DIST_MAX) |
336 | return -EINVAL; | 336 | return -EINVAL; |
337 | 337 | ||
338 | s = sizeof(struct disttable) + n * sizeof(s16); | 338 | s = sizeof(struct disttable) + n * sizeof(s16); |