From: Eric Dumazet <eric.dumazet@gmail.com>
To: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: netdev@vger.kernel.org, Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: [PATCH v2 net-next 2/2] netem: add cell concept to simulate special MAC behavior
Date: Tue, 29 Nov 2011 00:48:45 +0100 [thread overview]
Message-ID: <1322524125.2970.48.camel@edumazet-laptop> (raw)
In-Reply-To: <20111128233004.GH3045@nuttenaction>
Le mardi 29 novembre 2011 à 00:30 +0100, Hagen Paul Pfeifer a écrit :
> * Eric Dumazet | 2011-11-29 00:01:07 [+0100]:
>
> >> -static psched_time_t packet_len_2_sched_time(unsigned int len, u32 rate)
> >> +static psched_time_t packet_len_2_sched_time(unsigned int len,
> >> + struct netem_sched_data *q)
> >> {
> >> - return PSCHED_NS2TICKS((u64)len * NSEC_PER_SEC / rate);
> >> + len += q->packet_overhead;
> >> +
> >> + if (q->cell_size) {
> >> + u32 carry = len % q->cell_size;
> >> + len += carry;
> >
> >I dont understand this part (len += carry;)
>
> Say the original packet is 100 byte, cellsize is 40 byte: three full size link
> layer frames are required: 40 + 40 + 40 == 100 + 20. This is used for TDMA,
> ATM or slot schemes where the remainder cannot be used.
>
I still dont understand.
Say you send 119 bytes
119 % 40 = 39
119 + 39 = 158
Is it was is really needed ?
> Later in code carry is reused if cell overhead is configured.
>
In this example, cells will be :
158 / 40 = 3 + one (because carry is not 0)
len += 4 * cell_overhead
next prev parent reply other threads:[~2011-11-28 23:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-24 17:39 [PATCH net-next 1/2] netem: rate-latency extension Hagen Paul Pfeifer
2011-11-24 17:39 ` [PATCH net-next 2/2] netem: add cell concept to simulate special MAC behavior Hagen Paul Pfeifer
2011-11-24 22:14 ` [PATCH net-next 1/2] netem: rate-latency extension Eric Dumazet
2011-11-24 22:31 ` Hagen Paul Pfeifer
2011-11-25 1:06 ` Bill Fink
2011-11-25 1:23 ` Hagen Paul Pfeifer
2011-11-25 5:09 ` Stephen Hemminger
2011-11-25 6:13 ` Eric Dumazet
2011-11-25 12:02 ` Hagen Paul Pfeifer
2011-11-25 2:22 ` [PATCH v2 net-next 1/2] netem: rate extension Hagen Paul Pfeifer
2011-11-25 2:22 ` [PATCH v2 net-next 2/2] netem: add cell concept to simulate special MAC behavior Hagen Paul Pfeifer
2011-11-28 23:01 ` Eric Dumazet
2011-11-28 23:30 ` Hagen Paul Pfeifer
2011-11-28 23:48 ` Eric Dumazet [this message]
2011-11-29 0:07 ` Hagen Paul Pfeifer
2011-11-26 11:00 ` [PATCH v2 net-next 1/2] netem: rate extension Eric Dumazet
2011-11-25 2:23 ` [PATCH v2 iproute2 1/2] utils: add s32 parser Hagen Paul Pfeifer
2011-11-25 2:23 ` [PATCH v2 iproute2 2/2] tc: netem rate shaping and cell extension Hagen Paul Pfeifer
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=1322524125.2970.48.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=hagen@jauu.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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