diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2009-02-12 00:03:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 01:43:33 -0500 |
commit | cb9eff097831007afb30d64373f29d99825d0068 (patch) | |
tree | 823a5668c6f4b3f577a1d4cc73b3df2d7e33c5c4 /arch | |
parent | a75244c3d519fcb490ca2bf3f123c98017f1e8d0 (diff) |
net: new user space API for time stamping of incoming and outgoing packets
User space can request hardware and/or software time stamping.
Reporting of the result(s) via a new control message is enabled
separately for each field in the message because some of the
fields may require additional computation and thus cause overhead.
User space can tell the different kinds of time stamps apart
and choose what suits its needs.
When a TX timestamp operation is requested, the TX skb will be cloned
and the clone will be time stamped (in hardware or software) and added
to the socket error queue of the skb, if the skb has a socket
associated with it.
The actual TX timestamp will reach userspace as a RX timestamp on the
cloned packet. If timestamping is requested and no timestamping is
done in the device driver (potentially this may use hardware
timestamping), it will be done in software after the device's
start_hard_xmit routine.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/avr32/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/blackfin/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/cris/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/h8300/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/ia64/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/m68k/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/parisc/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/s390/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/sh/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/sparc/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/socket.h | 3 | ||||
-rw-r--r-- | arch/xtensa/include/asm/socket.h | 3 |
16 files changed, 48 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index a1057c2d95e7..3641ec1452f4 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h | |||
@@ -62,6 +62,9 @@ | |||
62 | 62 | ||
63 | #define SO_MARK 36 | 63 | #define SO_MARK 36 |
64 | 64 | ||
65 | #define SO_TIMESTAMPING 37 | ||
66 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
67 | |||
65 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | 68 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we |
66 | * have to define SOCK_NONBLOCK to a different value here. | 69 | * have to define SOCK_NONBLOCK to a different value here. |
67 | */ | 70 | */ |
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h index 6817be9573a6..537de4e0ef50 100644 --- a/arch/arm/include/asm/socket.h +++ b/arch/arm/include/asm/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_SOCKET_H */ | 60 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h index 35863f260929..04c860619700 100644 --- a/arch/avr32/include/asm/socket.h +++ b/arch/avr32/include/asm/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* __ASM_AVR32_SOCKET_H */ | 60 | #endif /* __ASM_AVR32_SOCKET_H */ |
diff --git a/arch/blackfin/include/asm/socket.h b/arch/blackfin/include/asm/socket.h index 2ca702e44d47..fac7fe9e1f8a 100644 --- a/arch/blackfin/include/asm/socket.h +++ b/arch/blackfin/include/asm/socket.h | |||
@@ -53,4 +53,7 @@ | |||
53 | 53 | ||
54 | #define SO_MARK 36 | 54 | #define SO_MARK 36 |
55 | 55 | ||
56 | #define SO_TIMESTAMPING 37 | ||
57 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
58 | |||
56 | #endif /* _ASM_SOCKET_H */ | 59 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h index 9df0ca82f5de..d5cf74005408 100644 --- a/arch/cris/include/asm/socket.h +++ b/arch/cris/include/asm/socket.h | |||
@@ -56,6 +56,9 @@ | |||
56 | 56 | ||
57 | #define SO_MARK 36 | 57 | #define SO_MARK 36 |
58 | 58 | ||
59 | #define SO_TIMESTAMPING 37 | ||
60 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
61 | |||
59 | #endif /* _ASM_SOCKET_H */ | 62 | #endif /* _ASM_SOCKET_H */ |
60 | 63 | ||
61 | 64 | ||
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h index da2520dbf254..602518a70a1a 100644 --- a/arch/h8300/include/asm/socket.h +++ b/arch/h8300/include/asm/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_SOCKET_H */ | 60 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h index d5ef0aa3e312..745421225ec6 100644 --- a/arch/ia64/include/asm/socket.h +++ b/arch/ia64/include/asm/socket.h | |||
@@ -63,4 +63,7 @@ | |||
63 | 63 | ||
64 | #define SO_MARK 36 | 64 | #define SO_MARK 36 |
65 | 65 | ||
66 | #define SO_TIMESTAMPING 37 | ||
67 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
68 | |||
66 | #endif /* _ASM_IA64_SOCKET_H */ | 69 | #endif /* _ASM_IA64_SOCKET_H */ |
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h index dbc64e92c41a..ca87f938b03f 100644 --- a/arch/m68k/include/asm/socket.h +++ b/arch/m68k/include/asm/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_SOCKET_H */ | 60 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h index facc2d7a87ca..2abca1780169 100644 --- a/arch/mips/include/asm/socket.h +++ b/arch/mips/include/asm/socket.h | |||
@@ -75,6 +75,9 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | |||
75 | 75 | ||
76 | #define SO_MARK 36 | 76 | #define SO_MARK 36 |
77 | 77 | ||
78 | #define SO_TIMESTAMPING 37 | ||
79 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
80 | |||
78 | #ifdef __KERNEL__ | 81 | #ifdef __KERNEL__ |
79 | 82 | ||
80 | /** sock_type - Socket types | 83 | /** sock_type - Socket types |
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h index fba402c95ac2..885472bf7b78 100644 --- a/arch/parisc/include/asm/socket.h +++ b/arch/parisc/include/asm/socket.h | |||
@@ -54,6 +54,9 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 0x401f | 55 | #define SO_MARK 0x401f |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 0x4020 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | 60 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we |
58 | * have to define SOCK_NONBLOCK to a different value here. | 61 | * have to define SOCK_NONBLOCK to a different value here. |
59 | */ | 62 | */ |
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h index f5a4e168e498..1e5cfad0e3f7 100644 --- a/arch/powerpc/include/asm/socket.h +++ b/arch/powerpc/include/asm/socket.h | |||
@@ -61,4 +61,7 @@ | |||
61 | 61 | ||
62 | #define SO_MARK 36 | 62 | #define SO_MARK 36 |
63 | 63 | ||
64 | #define SO_TIMESTAMPING 37 | ||
65 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
66 | |||
64 | #endif /* _ASM_POWERPC_SOCKET_H */ | 67 | #endif /* _ASM_POWERPC_SOCKET_H */ |
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h index c786ab623b2d..02330c50241b 100644 --- a/arch/s390/include/asm/socket.h +++ b/arch/s390/include/asm/socket.h | |||
@@ -62,4 +62,7 @@ | |||
62 | 62 | ||
63 | #define SO_MARK 36 | 63 | #define SO_MARK 36 |
64 | 64 | ||
65 | #define SO_TIMESTAMPING 37 | ||
66 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
67 | |||
65 | #endif /* _ASM_SOCKET_H */ | 68 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/sh/include/asm/socket.h b/arch/sh/include/asm/socket.h index 6d4bf6512959..345653b96826 100644 --- a/arch/sh/include/asm/socket.h +++ b/arch/sh/include/asm/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* __ASM_SH_SOCKET_H */ | 60 | #endif /* __ASM_SH_SOCKET_H */ |
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h index bf50d0c2d583..982a12f959f4 100644 --- a/arch/sparc/include/asm/socket.h +++ b/arch/sparc/include/asm/socket.h | |||
@@ -50,6 +50,9 @@ | |||
50 | 50 | ||
51 | #define SO_MARK 0x0022 | 51 | #define SO_MARK 0x0022 |
52 | 52 | ||
53 | #define SO_TIMESTAMPING 0x0023 | ||
54 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
55 | |||
53 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 56 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
54 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 57 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
55 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 | 58 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 |
diff --git a/arch/x86/include/asm/socket.h b/arch/x86/include/asm/socket.h index 8ab9cc8b2ecc..ca8bf2cd0ba9 100644 --- a/arch/x86/include/asm/socket.h +++ b/arch/x86/include/asm/socket.h | |||
@@ -54,4 +54,7 @@ | |||
54 | 54 | ||
55 | #define SO_MARK 36 | 55 | #define SO_MARK 36 |
56 | 56 | ||
57 | #define SO_TIMESTAMPING 37 | ||
58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
59 | |||
57 | #endif /* _ASM_X86_SOCKET_H */ | 60 | #endif /* _ASM_X86_SOCKET_H */ |
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h index 6100682b1da2..dd1a7a4a1cea 100644 --- a/arch/xtensa/include/asm/socket.h +++ b/arch/xtensa/include/asm/socket.h | |||
@@ -65,4 +65,7 @@ | |||
65 | 65 | ||
66 | #define SO_MARK 36 | 66 | #define SO_MARK 36 |
67 | 67 | ||
68 | #define SO_TIMESTAMPING 37 | ||
69 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
70 | |||
68 | #endif /* _XTENSA_SOCKET_H */ | 71 | #endif /* _XTENSA_SOCKET_H */ |