]> git.karo-electronics.de Git - linux-beck.git/commit
net: sch_netem: Fix an inconsistency in ingress netem timestamps.
authorJarek Poplawski <jarkao2@gmail.com>
Fri, 17 Apr 2009 10:08:49 +0000 (10:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Apr 2009 09:14:59 +0000 (02:14 -0700)
commit8caf153974f2274301e583fda732cc8e5b80331f
treed7f52b67e74b4bb4c81f2a4c34dae912a608f6fc
parentc7c1a0f60b90955855ba8cd9cfc480167bf6c3da
net: sch_netem: Fix an inconsistency in ingress netem timestamps.

Alex Sidorenko reported:

"while experimenting with 'netem' we have found some strange behaviour. It
seemed that ingress delay as measured by 'ping' command shows up on some
hosts but not on others.

After some investigation I have found that the problem is that skbuff->tstamp
field value depends on whether there are any packet sniffers enabled. That
is:

- if any ptype_all handler is registered, the tstamp field is as expected
- if there are no ptype_all handlers, the tstamp field does not show the delay"

This patch prevents unnecessary update of tstamp in dev_queue_xmit_nit()
on ingress path (with act_mirred) adding a check, so minimal overhead on
the fast path, but only when sniffers etc. are active.

Since netem at ingress seems to logically emulate a network before a host,
tstamp is zeroed to trigger the update and pretend delays are from the
outside.

Reported-by: Alex Sidorenko <alexandre.sidorenko@hp.com>
Tested-by: Alex Sidorenko <alexandre.sidorenko@hp.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c
net/sched/sch_netem.c