1. 16 Feb, 2009 8 commits
    • Patrick Ohly's avatar
      igb: access to NIC time · 38c845c7
      Patrick Ohly authored
      Adds the register definitions and code to read the time
      register.
      Signed-off-by: default avatarJohn Ronciak <john.ronciak@intel.com>
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38c845c7
    • Patrick Ohly's avatar
    • Patrick Ohly's avatar
      ip: support for TX timestamps on UDP and RAW sockets · 51f31cab
      Patrick Ohly authored
      Instructions for time stamping outgoing packets are take from the
      socket layer and later copied into the new skb.
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      51f31cab
    • Patrick Ohly's avatar
      net: socket infrastructure for SO_TIMESTAMPING · 20d49473
      Patrick Ohly authored
      The overlap with the old SO_TIMESTAMP[NS] options is handled so
      that time stamping in software (net_enable_timestamp()) is
      enabled when SO_TIMESTAMP[NS] and/or SO_TIMESTAMPING_RX_SOFTWARE
      is set.  It's disabled if all of these are off.
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20d49473
    • Patrick Ohly's avatar
      net: infrastructure for hardware time stamping · ac45f602
      Patrick Ohly authored
      The additional per-packet information (16 bytes for time stamps, 1
      byte for flags) is stored for all packets in the skb_shared_info
      struct. This implementation detail is hidden from users of that
      information via skb_* accessor functions. A separate struct resp.
      union is used for the additional information so that it can be
      stored/copied easily outside of skb_shared_info.
      
      Compared to previous implementations (reusing the tstamp field
      depending on the context, optional additional structures) this
      is the simplest solution. It does not extend sk_buff itself.
      
      TX time stamping is implemented in software if the device driver
      doesn't support hardware time stamping.
      
      The new semantic for hardware/software time stamping around
      ndo_start_xmit() is based on two assumptions about existing
      network device drivers which don't support hardware time
      stamping and know nothing about it:
       - they leave the new skb_shared_tx unmodified
       - the keep the connection to the originating socket in skb->sk
         alive, i.e., don't call skb_orphan()
      
      Given that skb_shared_tx is new, the first assumption is safe.
      The second is only true for some drivers. As a result, software
      TX time stamping currently works with the bnx2 driver, but not
      with the unmodified igb driver (the two drivers this patch series
      was tested with).
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac45f602
    • 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.pdfAcked-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. 15 Feb, 2009 6 commits
  3. 13 Feb, 2009 26 commits