1. 22 May, 2017 27 commits
  2. 21 May, 2017 13 commits
    • Eric Dumazet's avatar
      tcp: fix tcp_probe_timer() for TCP_USER_TIMEOUT · 4ab68879
      Eric Dumazet authored
      TCP_USER_TIMEOUT is still converted to jiffies value in
      icsk_user_timeout
      
      So we need to make a conversion for the cases HZ != 1000
      
      Fixes: 9a568de4 ("tcp: switch TCP TS option (RFC 7323) to 1ms clock")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ab68879
    • stephen hemminger's avatar
      ipv6: drop unused variables in seg6_genl_dumphac · 0a9fc39e
      stephen hemminger authored
      THe seg6_pernet_data variable was set but never used.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0a9fc39e
    • stephen hemminger's avatar
      fou: make local function static · 9dc621af
      stephen hemminger authored
      The build header functions are not used by any other code.
      
      net/ipv6/fou6.c:36:5: warning: no previous prototype for ‘fou6_build_header’ [-Wmissing-prototypes]
      net/ipv6/fou6.c:54:5: warning: no previous prototype for ‘gue6_build_header’ [-Wmissing-prototypes]
      
      Need to do some code rearranging to satisfy different Kconfig possiblities.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9dc621af
    • stephen hemminger's avatar
      tcpnv: do not export local function · c718c6d6
      stephen hemminger authored
      The TCP New Vegas congestion control was exporting an internal
      function tcpnv_get_info which is not used by any other in tree
      kernel code. Make it static.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c718c6d6
    • stephen hemminger's avatar
      inet: fix warning about missing prototype · 9691724e
      stephen hemminger authored
      The prototype for inet_rcv_saddr_equal was not being included.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9691724e
    • stephen hemminger's avatar
      ila: propagate error code in ila_output · 9e7b19c5
      stephen hemminger authored
      This warning:
      net/ipv6/ila/ila_lwt.c: In function ‘ila_output’:
      net/ipv6/ila/ila_lwt.c:42:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
      
      It looks like the code attempts to set propagate different error
      values, but always returned -EINVAL.
      
      Compile tested only. Needs review by original author.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e7b19c5
    • stephen hemminger's avatar
      dcb: enforce minimum length on IEEE_APPS attribute · 332b4fc8
      stephen hemminger authored
      Found by reviewing the warning about unused policy table.
      The code implies that it meant to check for size, but since
      it unrolled the loop for attribute validation that is never used.
      Instead do explicit check for attribute.
      
      Compile tested only. Needs review by original author.
      Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      332b4fc8
    • David S. Miller's avatar
      Merge branch 'net-extend-socket-timestamping-API' · dae37055
      David S. Miller authored
      Miroslav Lichvar says:
      
      ====================
      Extend socket timestamping API
      
      Changes v5->v6:
      - fixed skb_is_swtx_tstamp() when OPT_TX_SWHW is disabled and improved
        its description
      - improved OPT_PKTINFO documentation
      - improved scm_timestamping documentation
      
      Changes v4->v5:
      - fixed initialization of reserved fields in struct scm_ts_pktinfo
      
      Changes v3->v4:
      - added reserved fields to struct scm_ts_pktinfo
      - replaced patch fixing false SW timestamps with a documentation fix
      - updated OPT_TX_SWHW patch to handle false SW timestamps
      
      Changes v2->v3:
      - modified struct scm_ts_pktinfo to use fixed-width integer types
      - added WARN_ON_ONCE for missing RCU lock in dev_get_by_napi_id()
      - modified dev_get_by_napi_id() to not return dev in unexpected branch
      - modified recv to return SCM_TIMESTAMPING_PKTINFO even if the interface
        index is unknown
      
      Changes v1->v2:
      - added separate patch for new NAPI functions
      - split code from __sock_recv_timestamp() for better readability
      - fixed RCU locking
      - fixed compiler warning (missing case in switch in first patch)
      - inline sw_tx_timestamp() in its only user
      
      Changes RFC->v1:
      - reworked SOF_TIMESTAMPING_OPT_PKTINFO patch to not add new fields to
        skb shared info (net device is now looked up by napi_id), not require
        any changes in drivers, and restrict the cmsg to incoming packets
      - renamed SOF_TIMESTAMPING_OPT_MULTIMSG to SOF_TIMESTAMPING_OPT_TX_SWHW
        and fixed its description
      - moved struct scm_ts_pktinfo from errqueue.h to net_tstamp.h as it
        can't be received from the error queue anymore
      - improved commit descriptions and removed incorrect comment
      
      This patchset adds new options to the timestamping API that will be
      useful for NTP implementations and possibly other applications.
      
      The first patch specifies a timestamp filter for NTP packets. The second
      patch updates drivers that can timestamp all packets, or need to list
      the filter as unsupported. There is no attempt to add the support to the
      phyter driver.
      
      The third patch adds two helper functions working with NAPI ID, which is
      needed by the next patch. The fourth patch adds a new option to get a
      new control message with the L2 length and interface index for incoming
      packets with hardware timestamps.
      
      The fifth patch fixes documentation on number of non-zero fields in
      scm_timestamping and warns about false software timestamps when
      SO_TIMESTAMP(NS) is combined with SCM_TIMESTAMPING.
      
      The sixth patch adds a new option to request both software and hardware
      timestamps for outgoing packets. The seventh patch updates drivers that
      assumed software timestamping cannot be used together with hardware
      timestamping.
      
      The patches have been tested on x86_64 machines with igb and e1000e
      drivers.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dae37055
    • Miroslav Lichvar's avatar
      net: ethernet: update drivers to make both SW and HW TX timestamps · 74abc9b1
      Miroslav Lichvar authored
      Some drivers were calling the skb_tx_timestamp() function only when
      a hardware timestamp was not requested. Now that applications can use
      the SOF_TIMESTAMPING_OPT_TX_SWHW option to request both software and
      hardware timestamps, the drivers need to be modified to unconditionally
      call skb_tx_timestamp().
      
      CC: Richard Cochran <richardcochran@gmail.com>
      CC: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74abc9b1
    • Miroslav Lichvar's avatar
      net: allow simultaneous SW and HW transmit timestamping · b50a5c70
      Miroslav Lichvar authored
      Add SOF_TIMESTAMPING_OPT_TX_SWHW option to allow an outgoing packet to
      be looped to the socket's error queue with a software timestamp even
      when a hardware transmit timestamp is expected to be provided by the
      driver.
      
      Applications using this option will receive two separate messages from
      the error queue, one with a software timestamp and the other with a
      hardware timestamp. As the hardware timestamp is saved to the shared skb
      info, which may happen before the first message with software timestamp
      is received by the application, the hardware timestamp is copied to the
      SCM_TIMESTAMPING control message only when the skb has no software
      timestamp or it is an incoming packet.
      
      While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as
      there are no other users.
      
      CC: Richard Cochran <richardcochran@gmail.com>
      CC: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b50a5c70
    • Miroslav Lichvar's avatar
      net: fix documentation of struct scm_timestamping · 67953d47
      Miroslav Lichvar authored
      The scm_timestamping struct may return multiple non-zero fields, e.g.
      when both software and hardware RX timestamping is enabled, or when the
      SO_TIMESTAMP(NS) option is combined with SCM_TIMESTAMPING and a false
      software timestamp is generated in the recvmsg() call in order to always
      return a SCM_TIMESTAMP(NS) message.
      
      CC: Richard Cochran <richardcochran@gmail.com>
      CC: Willem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67953d47
    • Miroslav Lichvar's avatar
      net: add new control message for incoming HW-timestamped packets · aad9c8c4
      Miroslav Lichvar authored
      Add SOF_TIMESTAMPING_OPT_PKTINFO option to request a new control message
      for incoming packets with hardware timestamps. It contains the index of
      the real interface which received the packet and the length of the
      packet at layer 2.
      
      The index is useful with bonding, bridges and other interfaces, where
      IP_PKTINFO doesn't allow applications to determine which PHC made the
      timestamp. With the L2 length (and link speed) it is possible to
      transpose preamble timestamps to trailer timestamps, which are used in
      the NTP protocol.
      
      While this information could be provided by two new socket options
      independently from timestamping, it doesn't look like they would be very
      useful. With this option any performance impact is limited to hardware
      timestamping.
      
      Use dev_get_by_napi_id() to get the device and its index. On kernels
      with disabled CONFIG_NET_RX_BUSY_POLL or drivers not using NAPI, a zero
      index will be returned in the control message.
      
      CC: Richard Cochran <richardcochran@gmail.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aad9c8c4
    • Miroslav Lichvar's avatar
      net: add function to retrieve original skb device using NAPI ID · 90b602f8
      Miroslav Lichvar authored
      Since commit b6858177 ("net: Make skb->skb_iif always track
      skb->dev") skbs don't have the original index of the interface which
      received the packet. This information is now needed for a new control
      message related to hardware timestamping.
      
      Instead of adding a new field to skb, we can find the device by the NAPI
      ID if it is available, i.e. CONFIG_NET_RX_BUSY_POLL is enabled and the
      driver is using NAPI. Add dev_get_by_napi_id() and also skb_napi_id() to
      hide the CONFIG_NET_RX_BUSY_POLL ifdef.
      
      CC: Richard Cochran <richardcochran@gmail.com>
      Suggested-by: default avatarWillem de Bruijn <willemb@google.com>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      90b602f8