Skip to content

Commit df173bd

Browse files
stephen hemmingerdavem330
authored andcommitted
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>
1 parent 6373a9a commit df173bd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/linux/pkt_sched.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ struct tc_netem_corrupt {
495495
};
496496

497497
#define NETEM_DIST_SCALE 8192
498+
#define NETEM_DIST_MAX 16384
498499

499500
/* DRR */
500501

net/sched/sch_netem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
332332
int i;
333333
size_t s;
334334

335-
if (n > 65536)
335+
if (n > NETEM_DIST_MAX)
336336
return -EINVAL;
337337

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

0 commit comments

Comments
 (0)