netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6 PKT_SCHED]: Fix overflow on 64bit in times reported to userspace by tc actions
@ 2004-11-09  9:25 Patrick McHardy
  2004-11-11 23:03 ` David S. Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2004-11-09  9:25 UTC (permalink / raw)
  To: David S. Miller; +Cc: jamal, netdev

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

This patch fixes on overflow in tc actions times reported to
userspace on 64 bit architectures. struct tcf_t only contains
32-bit timestamps, but they are initialized to jiffies. When
jiffies is larger than 2^32-1 only the low 32 bit are saved,
and the diff between jiffies and the current timestamp becomes
very large. This happens immediately after boottime since jiffies
is initialized to 2^32-300. It was invisible until now because
only the lower 32bit were reported to userspace, but with the
USER_HZ conversion the reported times start somewhere around
4294967s.

This patch extends the timestamps to 64bit. It breaks userspace
compatibility for actions, but considering that most of this is
not even in iproute yet this should be acceptable.

Regards
Patrick


[-- Attachment #2: y --]
[-- Type: text/plain, Size: 840 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/09 09:30:28+01:00 kaber@coreworks.de 
#   [PKT_SCHED]: Fix overflow on 64bit in times reported to userspace by tc actions
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# include/linux/pkt_cls.h
#   2004/11/09 09:30:21+01:00 kaber@coreworks.de +3 -3
#   [PKT_SCHED]: Fix overflow on 64bit in times reported to userspace by tc actions
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
--- a/include/linux/pkt_cls.h	2004-11-09 09:31:44 +01:00
+++ b/include/linux/pkt_cls.h	2004-11-09 09:31:44 +01:00
@@ -138,9 +138,9 @@
 
 struct tcf_t
 {
-	__u32   install;
-	__u32   lastuse;
-	__u32   expires;
+	__u64   install;
+	__u64   lastuse;
+	__u64   expires;
 };
 
 struct tc_cnt

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

end of thread, other threads:[~2004-11-23 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-09  9:25 [PATCH 2.6 PKT_SCHED]: Fix overflow on 64bit in times reported to userspace by tc actions Patrick McHardy
2004-11-11 23:03 ` David S. Miller
2004-11-21 17:47   ` jamal
2004-11-22 11:12     ` Patrick McHardy
2004-11-22 13:24       ` jamal
2004-11-22 19:40         ` Patrick McHardy
2004-11-23 13:39           ` jamal

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).