netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] net: force a fresh timestamp for ingress packets
@ 2010-12-15 15:50 Eric Dumazet
  2010-12-16 21:17 ` Jarek Poplawski
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Dumazet @ 2010-12-15 15:50 UTC (permalink / raw)
  To: David Miller; +Cc: Changli Gao, Jarek Poplawski, netdev, Patrick McHardy

In commit 8caf153974f2 (net: sch_netem: Fix an inconsistency in ingress
netem timestamps.), Jarek added a logic to refresh timestamps of
ingressed packets going through netem.

I believe we should generalize this, forcing a refresh of timestamps in
dev_queue_xmit_nit() for all ingress packets, whatever qdisc/class they
used before being delivered.

This way, we can have a good idea when packets are delivered to our
stack (tcpdump -i ifb0), while a tcpdump on original device gives
timestamps right before ingressing.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/core/dev.c        |    2 +-
 net/sched/sch_netem.c |    8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index d28b3a0..a2846f8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1506,7 +1506,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
 	struct packet_type *ptype;
 
 #ifdef CONFIG_NET_CLS_ACT
-	if (!(skb->tstamp.tv64 && (G_TC_FROM(skb->tc_verd) & AT_INGRESS)))
+	if (!skb->tstamp.tv64 || (G_TC_FROM(skb->tc_verd) & AT_INGRESS))
 		net_timestamp_set(skb);
 #else
 	net_timestamp_set(skb);
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index e5593c0..1c29cc0 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -281,14 +281,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 			if (unlikely(!skb))
 				return NULL;
 
-#ifdef CONFIG_NET_CLS_ACT
-			/*
-			 * If it's at ingress let's pretend the delay is
-			 * from the network (tstamp will be updated).
-			 */
-			if (G_TC_FROM(skb->tc_verd) & AT_INGRESS)
-				skb->tstamp.tv64 = 0;
-#endif
 			pr_debug("netem_dequeue: return skb=%p\n", skb);
 			sch->q.qlen--;
 			return skb;



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-12-21 18:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-15 15:50 [PATCH net-next-2.6] net: force a fresh timestamp for ingress packets Eric Dumazet
2010-12-16 21:17 ` Jarek Poplawski
2010-12-16 21:30   ` Eric Dumazet
2010-12-16 22:08     ` Jarek Poplawski
2010-12-16 22:26       ` Eric Dumazet
2010-12-16 22:42         ` Jarek Poplawski
2010-12-16 23:31           ` Eric Dumazet
2010-12-17  7:30             ` Jarek Poplawski
2010-12-17  8:08               ` Eric Dumazet
2010-12-17  8:34                 ` Jarek Poplawski
2010-12-17  8:59                   ` Jarek Poplawski
2010-12-17  9:26                     ` Eric Dumazet
2010-12-21  7:22                       ` [PATCH net-next-2.6] net: timestamp cloned packet in dev_queue_xmit_nit Eric Dumazet
2010-12-21  7:56                         ` Changli Gao
2010-12-21 18:50                           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).