Skip to content

Commit

Permalink
netem: define NETEM_DIST_MAX
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stephen hemminger authored and David S. Miller committed Feb 25, 2011
1 parent 6373a9a commit df173bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/linux/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ struct tc_netem_corrupt {
};

#define NETEM_DIST_SCALE 8192
#define NETEM_DIST_MAX 16384

/* DRR */

Expand Down
2 changes: 1 addition & 1 deletion net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
int i;
size_t s;

if (n > 65536)
if (n > NETEM_DIST_MAX)
return -EINVAL;

s = sizeof(struct disttable) + n * sizeof(s16);
Expand Down

0 comments on commit df173bd

Please sign in to comment.