All of lore.kernel.org
 help / color / mirror / Atom feed
* hardware time stamping with optional structs in data area
@ 2008-12-15 14:54 ` Patrick Ohly
  0 siblings, 0 replies; 73+ messages in thread
From: Patrick Ohly @ 2008-12-15 14:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, David Miller, John Stultz, linux-api

This is the third iteration of a patch series which adds a user space
API for hardware time stamping of network packets and the
infrastructure that implements that API. The igb driver is used as
example for how a network driver can use this new infrastructure.
The patches are based on net-next as of today.

This proposal is based on adding just a short flag field to struct
sk_buff itself, with the actual new information stored in the data
area if indicated by the flags. This is based on the suggestion by
Oliver Hartkopp and modelled after the way how skb_shared_info is
stored. The previous two revisions of the patch reused skb->tstamp
resp. added skb->hwtstamp.

The latest approach is more flexible: it allows adding more optional
information in the future. It turned out to be a bit harder to use by
drivers, though. The igb driver allocates the skb for incoming packets
in advance. At that time it is not yet known which packets will need
the extra space for hardware time stamps. The current example igb
patch just allocates that space for all packets, all the time. More
efficient solutions would be possible.

The functions which allocate an skb had to be modified so that
the new flags can be passed down to __netdev_alloc_skb(). I renamed
functions as necessary, so that existing code should continue to
work without changes. In sock_alloc_send_skb_flags() (formerly
known as sock_alloc_send_skb_pskb()) I removed some dead code (see
patch 04/12).

As discussed with John Stultz, the changes to clocksource.[ch]
now adds new structures as needed. John, I chose not to add new files
for these. Please let me know whether you agree with that approach,
see patch 09/12 for details.

The user space API is still as it was designed for the previous two
implementations. IMHO this shows that it was flexible enough to cope
with changes in the implementation. On the other hand some of its
aspects (user space has fine-grained control over what information
is gathered and provided by the kernel) might be seen as overkill
now that drivers can add this information more easily.

I think the API still makes sense because the additional information
might be used for optimizations in the future (drivers could
skip time stamp conversion if no-one is interested).

Also fixed in this iteration:
* comment style, too many/large inline functions (pointed out by Andrew Morton)
* __KERNEL__ instead __kernel__, user space API now in linux/net_tstamp.h (David Miller)

Bye, Patrick

 Documentation/networking/timestamping.txt          |  180 ++++++++
 Documentation/networking/timestamping/.gitignore   |    1 +
 Documentation/networking/timestamping/Makefile     |    3 +
 .../networking/timestamping/timestamping.c         |  469 ++++++++++++++++++++
 arch/x86/include/asm/socket.h                      |    3 +
 drivers/net/igb/e1000_82575.h                      |    1 +
 drivers/net/igb/e1000_defines.h                    |    1 +
 drivers/net/igb/e1000_regs.h                       |   68 +++
 drivers/net/igb/igb.h                              |    8 +
 drivers/net/igb/igb_main.c                         |  397 ++++++++++++++++-
 fs/compat_ioctl.c                                  |    1 +
 include/linux/clocksource.h                        |   99 ++++
 include/linux/clocksync.h                          |   85 ++++
 include/linux/errqueue.h                           |    1 +
 include/linux/net_tstamp.h                         |  104 +++++
 include/linux/skbuff.h                             |  196 ++++++++-
 include/linux/sockios.h                            |    3 +
 include/net/ip.h                                   |    1 +
 include/net/sock.h                                 |   57 ++-
 kernel/time/Makefile                               |    2 +-
 kernel/time/clocksource.c                          |   76 ++++
 kernel/time/clocksync.c                            |  182 ++++++++
 net/can/raw.c                                      |   14 +-
 net/compat.c                                       |   19 +-
 net/core/dev.c                                     |   36 ++-
 net/core/skbuff.c                                  |  139 +++++-
 net/core/sock.c                                    |  129 +++---
 net/ipv4/icmp.c                                    |    2 +
 net/ipv4/ip_output.c                               |   18 +-
 net/ipv4/raw.c                                     |    1 +
 net/ipv4/udp.c                                     |    4 +
 net/socket.c                                       |   86 +++-
 32 files changed, 2258 insertions(+), 128 deletions(-)

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

end of thread, other threads:[~2009-02-04 15:01 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-15 14:54 hardware time stamping with optional structs in data area Patrick Ohly
2008-12-15 14:54 ` Patrick Ohly
2008-12-15 14:54 ` [RFC PATCH 01/12] net: new user space API for time stamping of incoming and outgoing packets Patrick Ohly
2008-12-15 14:54   ` [RFC PATCH 02/12] net: infrastructure for hardware time stamping Patrick Ohly
2008-12-15 14:54     ` [RFC PATCH 03/12] net: socket infrastructure for SO_TIMESTAMPING Patrick Ohly
2008-12-15 14:54       ` Patrick Ohly
2008-12-15 14:54       ` [RFC PATCH 04/12] sockets: allow allocating skb with optional structures Patrick Ohly
2008-12-15 14:54         ` [RFC PATCH 05/12] ip: support for TX timestamps on UDP and RAW sockets Patrick Ohly
2008-12-15 14:54           ` [RFC PATCH 06/12] debug: NULL pointer check in ip_output Patrick Ohly
2008-12-15 14:54             ` Patrick Ohly
2008-12-15 14:54             ` [RFC PATCH 07/12] net: pass new SIOCSHWTSTAMP through to device drivers Patrick Ohly
2008-12-15 14:54               ` [RFC PATCH 08/12] igb: stub support for SIOCSHWTSTAMP Patrick Ohly
2008-12-15 14:54                 ` Patrick Ohly
2008-12-15 14:54                 ` [RFC PATCH 09/12] clocksource: allow usage independent of timekeeping.c Patrick Ohly
2008-12-15 14:54                   ` Patrick Ohly
2008-12-15 14:54                   ` [RFC PATCH 10/12] igb: access to NIC time Patrick Ohly
2008-12-15 14:54                     ` Patrick Ohly
2008-12-15 14:54                     ` [RFC PATCH 11/12] time sync: generic infrastructure to map between time stamps generated by a time counter and system time Patrick Ohly
2008-12-15 14:54                       ` Patrick Ohly
2008-12-15 14:54                       ` [RFC PATCH 12/12] igb: use clocksync to implement hardware time stamping Patrick Ohly
2008-12-15 16:26                   ` [RFC PATCH 09/12] clocksource: allow usage independent of timekeeping.c John Stultz
2008-12-15 16:26                     ` John Stultz
2008-12-15 16:45                     ` Patrick Ohly
2008-12-15 16:45                       ` Patrick Ohly
2009-02-04 14:29                     ` Daniel Walker
2009-02-04 15:00                       ` Patrick Ohly
2008-12-15 21:53     ` [RFC PATCH 02/12] net: infrastructure for hardware time stamping Herbert Xu
2008-12-15 21:53       ` Herbert Xu
2008-12-15 21:53       ` Herbert Xu
2008-12-16  7:56       ` Patrick Ohly
2008-12-16  7:56         ` Patrick Ohly
2009-01-16 10:36 ` hardware time stamping with optional structs in data area Patrick Ohly
2009-01-16 10:36   ` Patrick Ohly
2009-01-16 19:00   ` David Miller
2009-01-16 19:00     ` David Miller
2009-01-21 10:07     ` Patrick Ohly
2009-01-21 10:07       ` Patrick Ohly
2009-01-21 10:10       ` [PATCH NET-NEXT 01/12] net: new user space API for time stamping of incoming and outgoing packets Patrick Ohly
2009-01-21 10:10         ` Patrick Ohly
2009-01-21 10:10         ` [PATCH NET-NEXT 02/12] net: infrastructure for hardware time stamping Patrick Ohly
2009-01-21 10:10           ` [PATCH NET-NEXT 03/12] net: socket infrastructure for SO_TIMESTAMPING Patrick Ohly
2009-01-21 10:10             ` [PATCH NET-NEXT 04/12] sockets: allow allocating skb with optional structures Patrick Ohly
2009-01-21 10:10               ` Patrick Ohly
2009-01-21 10:10               ` [PATCH NET-NEXT 05/12] ip: support for TX timestamps on UDP and RAW sockets Patrick Ohly
2009-01-21 10:10                 ` Patrick Ohly
2009-01-21 10:10                 ` [PATCH NET-NEXT 06/12] debug: NULL pointer check in ip_output Patrick Ohly
2009-01-21 10:10                   ` Patrick Ohly
2009-01-21 10:10                   ` [PATCH NET-NEXT 07/12] net: pass new SIOCSHWTSTAMP through to device drivers Patrick Ohly
2009-01-21 10:10                     ` Patrick Ohly
2009-01-21 10:10                     ` [PATCH NET-NEXT 08/12] igb: stub support for SIOCSHWTSTAMP Patrick Ohly
2009-01-21 10:10                       ` Patrick Ohly
2009-01-21 10:10                       ` [PATCH NET-NEXT 09/12] clocksource: allow usage independent of timekeeping.c Patrick Ohly
2009-01-21 10:10                         ` Patrick Ohly
2009-01-21 10:10                         ` [PATCH NET-NEXT 10/12] igb: access to NIC time Patrick Ohly
2009-01-21 10:10                           ` Patrick Ohly
2009-01-21 10:10                           ` [PATCH NET-NEXT 11/12] time sync: generic infrastructure to map between time stamps generated by a time counter and system time Patrick Ohly
2009-01-21 10:10                             ` [PATCH NET-NEXT 12/12] igb: use clocksync to implement hardware time stamping Patrick Ohly
2009-01-21 10:33                             ` [PATCH NET-NEXT 11/12] time sync: generic infrastructure to map between time stamps generated by a time counter and system time Ingo Molnar
2009-01-21 10:33                               ` Ingo Molnar
2009-01-21 14:42                               ` Patrick Ohly
2009-01-26  5:04       ` hardware time stamping with optional structs in data area David Miller
2009-01-26 20:39         ` Patrick Ohly
2009-01-27  1:22           ` David Miller
2009-01-27  1:22             ` David Miller
2009-01-27 15:23             ` Patrick Ohly
2009-01-28  9:08               ` Herbert Xu
2009-01-28  9:52                 ` Patrick Ohly
2009-01-28  9:52                   ` Patrick Ohly
2009-01-28  9:54                   ` Herbert Xu
2009-01-28  9:54                     ` Herbert Xu
2009-02-01  8:14                 ` David Miller
2009-02-01  8:14                   ` David Miller
2009-02-04 13:02                   ` Patrick Ohly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.