From: Stephen Hemminger <shemminger@vyatta•com>
To: "David S. Miller" <davem@davemloft•net>
Cc: netdev@vger•kernel.org
Subject: [PATCH net-next 3/6] netem: define NETEM_DIST_MAX
Date: Wed, 23 Feb 2011 15:04:19 -0800 [thread overview]
Message-ID: <20110223230534.268429590@vyatta.com> (raw)
In-Reply-To: 20110223230416.532009518@vyatta.com
[-- Attachment #1: netem-maxsize.patch --]
[-- Type: text/plain, Size: 930 bytes --]
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>
---
include/linux/pkt_sched.h | 1 +
net/sched/sch_netem.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
--- a/include/linux/pkt_sched.h 2011-02-23 14:43:08.838297372 -0800
+++ b/include/linux/pkt_sched.h 2011-02-23 14:50:10.329760558 -0800
@@ -495,6 +495,7 @@ struct tc_netem_corrupt {
};
#define NETEM_DIST_SCALE 8192
+#define NETEM_DIST_MAX 16384
/* DRR */
--- a/net/sched/sch_netem.c 2011-02-23 14:50:09.445745344 -0800
+++ b/net/sched/sch_netem.c 2011-02-23 14:50:10.329760558 -0800
@@ -332,7 +332,7 @@ static int get_dist_table(struct Qdisc *
int i;
size_t s;
- if (n > 65536)
+ if (n > NETEM_DIST_MAX)
return -EINVAL;
s = sizeof(struct disttable) + n * sizeof(s16);
next prev parent reply other threads:[~2011-02-23 23:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-23 23:04 [PATCH net-next 0/6] netem patches Stephen Hemminger
2011-02-23 23:04 ` [PATCH net-next 1/6] [PATCH 5/9] netem: cleanup dump code Stephen Hemminger
2011-02-23 23:04 ` [PATCH net-next 2/6] netem: use vmalloc for distribution table Stephen Hemminger
2011-02-23 23:04 ` Stephen Hemminger [this message]
2011-02-23 23:04 ` [PATCH net-next 4/6] [PATCH] Revert "sch_netem: Remove classful functionality" Stephen Hemminger
2011-02-23 23:04 ` [PATCH net-next 5/6] netem: revised correlated loss generator Stephen Hemminger
2011-02-23 23:04 ` [PATCH net-next 6/6] netem: update version and cleanup Stephen Hemminger
2011-02-25 6:14 ` [PATCH net-next 0/6] netem patches David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110223230534.268429590@vyatta.com \
--to=shemminger@vyatta$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox