Skip to content
  1. Feb 16, 2009
    • Patrick Ohly's avatar
      net: new user space API for time stamping of incoming and outgoing packets · cb9eff09
      Patrick Ohly authored
      
      
      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: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb9eff09
    • Patrick Ohly's avatar
      timecompare: generic infrastructure to map between two time bases · a75244c3
      Patrick Ohly authored
      Mapping from a struct timecounter to a time returned by functions like
      ktime_get_real() is implemented. This is sufficient to use this code
      in a network device driver which wants to support hardware time
      stamping and transformation of hardware time stamps to system time.
      
      The interface could have been made more versatile by not depending on
      a time counter, but this wasn't done to avoid writing glue code
      elsewhere.
      
      The method implemented here is the one used and analyzed under the name
      "assisted PTP" in the LCI PTP paper:
      http://www.linuxclustersinstitute.org/conferences/archive/2008/PDF/Ohly_92221.pdf
      
      
      
      Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a75244c3
    • Patrick Ohly's avatar
      clocksource: allow usage independent of timekeeping.c · a038a353
      Patrick Ohly authored
      
      
      So far struct clocksource acted as the interface between time/timekeeping.c
      and hardware. This patch generalizes the concept so that a similar
      interface can also be used in other contexts. For that it introduces
      new structures and related functions *without* touching the existing
      struct clocksource.
      
      The reasons for adding these new structures to clocksource.[ch] are
      * the APIs are clearly related
      * struct clocksource could be cleaned up to use the new structs
      * avoids proliferation of files with similar names (timesource.h?
        timecounter.h?)
      
      As outlined in the discussion with John Stultz, this patch adds
      * struct cyclecounter: stateless API to hardware which counts clock cycles
      * struct timecounter: stateful utility code built on a cyclecounter which
        provides a nanosecond counter
      * only the function to read the nanosecond counter; deltas are used internally
        and not exposed to users of timecounter
      
      The code does no locking of the shared state. It must be called at least
      as often as the cycle counter wraps around to detect these wrap arounds.
      Both is the responsibility of the timecounter user.
      
      Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a038a353
  2. Feb 15, 2009
  3. Feb 14, 2009