From: Hagen Paul Pfeifer <hagen@jauu.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Tom Herbert <therbert@google.com>,
Neal Cardwell <ncardwell@google.com>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH net-next] netem: add ECN capability
Date: Tue, 1 May 2012 11:28:50 +0200 [thread overview]
Message-ID: <20120501092849.GB3453@hell> (raw)
In-Reply-To: <1335863465.11396.45.camel@edumazet-glaptop>
Nice!
* Eric Dumazet | 2012-05-01 11:11:05 [+0200]:
> u32 loss;
>+ u32 ecn;
Why no bool here Eric?
> u32 limit;
> u32 counter;
> u32 gap;
>@@ -374,9 +376,12 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> ++count;
>
> /* Drop packet? */
>- if (loss_event(q))
>- --count;
>-
>+ if (loss_event(q)) {
>+ if (q->ecn && INET_ECN_set_ce(skb))
>+ sch->qstats.drops++; /* mark packet */
>+ else
>+ --count;
>+ }
> if (count == 0) {
> sch->qstats.drops++;
> kfree_skb(skb);
>@@ -706,6 +711,7 @@ static const struct nla_policy netem_policy[TCA_NETEM_MAX + 1] = {
> [TCA_NETEM_CORRUPT] = { .len = sizeof(struct tc_netem_corrupt) },
> [TCA_NETEM_RATE] = { .len = sizeof(struct tc_netem_rate) },
> [TCA_NETEM_LOSS] = { .type = NLA_NESTED },
>+ [TCA_NETEM_ECN] = { .type = NLA_U32 },
This netem API, what a heck ... Ideal we would extend TCA_NETEM_LOSS
somehow[tm], but yes ... ;(
Acked-by: Hagen Paul Pfeifer <hagen@jauu.net>
next prev parent reply other threads:[~2012-05-01 9:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 9:11 [PATCH net-next] netem: add ECN capability Eric Dumazet
2012-05-01 9:28 ` Hagen Paul Pfeifer [this message]
2012-05-01 10:14 ` Dave Taht
2012-05-01 13:40 ` David Miller
2012-05-01 16:59 ` Stephen Hemminger
2012-05-01 17:17 ` David Miller
2012-05-01 18:49 ` Dave Taht
2012-05-01 19:13 ` David Miller
2012-05-01 16:59 ` Stephen Hemminger
2012-05-01 17:10 ` Eric Dumazet
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=20120501092849.GB3453@hell \
--to=hagen@jauu.net \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=therbert@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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