Skip to content
  1. Jul 02, 2014
  2. Jun 30, 2014
  3. Jun 28, 2014
    • David S. Miller's avatar
      Merge branch 'tcp_conn_request_unification' · 9e1a21b6
      David S. Miller authored
      
      
      Octavian Purdila says:
      
      ====================
      tcp: remove code duplication in tcp_v[46]_conn_request
      
      This patch series unifies the TCPv4 and TCPv6 connection request flow
      in a single new function (tcp_conn_request).
      
      The first 3 patches are small cleanups and fixes found during the code
      merge process.
      
      The next patches add new methods in tcp_request_sock_ops to abstract
      the IPv4/IPv6 operations and keep the TCP connection request flow
      common.
      
      To identify potential performance issues this patch has been tested
      by measuring the connection per second rate with nginx and a httperf
      like client (to allow for concurrent connection requests - 256 CC were
      used during testing) using the loopback interface. A dual-core i5 Ivy
      Bridge processor was used and each process was bounded to a different
      core to make results consistent.
      
      Results for IPv4, unit is connections per second, higher is better, 20
      measurements have been collected:
      
      		before		after
      min		27917		27962
      max		28262		28366
      avg		28094.1		28212.75
      stdev		87.35		97.26
      
      Results for IPv6, unit is connections per second, higher is better, 20
      measurements have been collected:
      
      		before		after
      min		24813		24877
      max		25029		25119
      avg		24935.5		25017
      stdev		64.13		62.93
      
      Changes since v1:
      
       * add benchmarking datapoints
      
       * fix a few issues in the last patch (IPv6 related)
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e1a21b6
    • Octavian Purdila's avatar
      tcp: add tcp_conn_request · 1fb6f159
      Octavian Purdila authored
      
      
      Create tcp_conn_request and remove most of the code from
      tcp_v4_conn_request and tcp_v6_conn_request.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1fb6f159
    • Octavian Purdila's avatar
      tcp: add queue_add_hash to tcp_request_sock_ops · 695da14e
      Octavian Purdila authored
      
      
      Add queue_add_hash member to tcp_request_sock_ops so that we can later
      unify tcp_v4_conn_request and tcp_v6_conn_request.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      695da14e
    • Octavian Purdila's avatar
      tcp: add mss_clamp to tcp_request_sock_ops · 2aec4a29
      Octavian Purdila authored
      
      
      Add mss_clamp member to tcp_request_sock_ops so that we can later
      unify tcp_v4_conn_request and tcp_v6_conn_request.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2aec4a29
    • Octavian Purdila's avatar
    • Octavian Purdila's avatar
      tcp: add send_synack method to tcp_request_sock_ops · d6274bd8
      Octavian Purdila authored
      
      
      Create a new tcp_request_sock_ops method to unify the IPv4/IPv6
      signature for tcp_v[46]_send_synack. This allows us to later unify
      tcp_v4_rtx_synack with tcp_v6_rtx_synack and tcp_v4_conn_request with
      tcp_v4_conn_request.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d6274bd8
    • Octavian Purdila's avatar
      tcp: add init_seq method to tcp_request_sock_ops · 936b8bdb
      Octavian Purdila authored
      
      
      More work in preparation of unifying tcp_v4_conn_request and
      tcp_v6_conn_request: indirect the init sequence calls via the
      tcp_request_sock_ops.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      936b8bdb
    • Octavian Purdila's avatar
      tcp: move around a few calls in tcp_v6_conn_request · 94037159
      Octavian Purdila authored
      
      
      Make the tcp_v6_conn_request calls flow similar with that of
      tcp_v4_conn_request.
      
      Note that want_cookie can be true only if isn is zero and that is why
      we can move the if (want_cookie) block out of the if (!isn) block.
      
      Moving security_inet_conn_request() has a couple of side effects:
      missing inet_rsk(req)->ecn_ok update and the req->cookie_ts
      update. However, neither SELinux nor Smack security hooks seems to
      check them. This change should also avoid future different behaviour
      for IPv4 and IPv6 in the security hooks.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94037159
    • Octavian Purdila's avatar
      tcp: add route_req method to tcp_request_sock_ops · d94e0417
      Octavian Purdila authored
      
      
      Create wrappers with same signature for the IPv4/IPv6 request routing
      calls and use these wrappers (via route_req method from
      tcp_request_sock_ops) in tcp_v4_conn_request and tcp_v6_conn_request
      with the purpose of unifying the two functions in a later patch.
      
      We can later drop the wrapper functions and modify inet_csk_route_req
      and inet6_cks_route_req to use the same signature.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d94e0417
    • Octavian Purdila's avatar
      tcp: add init_cookie_seq method to tcp_request_sock_ops · fb7b37a7
      Octavian Purdila authored
      
      
      Move the specific IPv4/IPv6 cookie sequence initialization to a new
      method in tcp_request_sock_ops in preparation for unifying
      tcp_v4_conn_request and tcp_v6_conn_request.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb7b37a7
    • Octavian Purdila's avatar
      tcp: add init_req method to tcp_request_sock_ops · 16bea70a
      Octavian Purdila authored
      
      
      Move the specific IPv4/IPv6 intializations to a new method in
      tcp_request_sock_ops in preparation for unifying tcp_v4_conn_request
      and tcp_v6_conn_request.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16bea70a
    • Octavian Purdila's avatar
      net: remove inet6_reqsk_alloc · 476eab82
      Octavian Purdila authored
      
      
      Since pktops is only used for IPv6 only and opts is used for IPv4
      only, we can move these fields into a union and this allows us to drop
      the inet6_reqsk_alloc function as after this change it becomes
      equivalent with inet_reqsk_alloc.
      
      This patch also fixes a kmemcheck issue in the IPv6 stack: the flags
      field was not annotated after a request_sock was allocated.
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      476eab82
    • Octavian Purdila's avatar
      tcp: tcp_v[46]_conn_request: fix snt_synack initialization · aa27fc50
      Octavian Purdila authored
      Commit 016818d0 (tcp: TCP Fast Open Server - take SYNACK RTT after
      completing 3WHS) changes the code to only take a snt_synack timestamp
      when a SYNACK transmit or retransmit succeeds. This behaviour is later
      broken by commit 843f4a55 (tcp: use tcp_v4_send_synack on first
      SYN-ACK), as snt_synack is now updated even if tcp_v4_send_synack
      fails.
      
      Also, commit 3a19ce0e (tcp: IPv6 support for fastopen server) misses
      the required IPv6 updates for 016818d0
      
      .
      
      This patch makes sure that snt_synack is updated only when the SYNACK
      trasnmit/retransmit succeeds, for both IPv4 and IPv6.
      
      Cc: Cardwell <ncardwell@google.com>
      Cc: Daniel Lee <longinus00@gmail.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      
      Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa27fc50
    • Octavian Purdila's avatar
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next · c1c27fb9
      David S. Miller authored
      
      
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2014-06-26
      
      This series contains updates to i40e and i40evf.
      
      Kamil provides a cleanup patch to i40e where we do not need to acquire the
      NVM for shadow RAM checksum calculation, since we only read the shadow RAM
      through SRCTL register.
      
      Paul provides a fix for handling HMC for big endian architectures for i40e
      and i40evf.
      
      Mitch provides four cleanup and fixes for i40evf.  Fix an issue where if
      the VF driver fails to complete early init, then rmmod can cause a softlock
      when the driver tries to stop a watchdog timer that never got initialized.
      So add a check to see if the timer is actually initialized before stopping
      it.  Make the function i40evf_send_api_ver() return more useful information,
      instead of just returning -EIO by propagating firmware errors back to the
      caller and log a message if the PF sends an invalid reply.  Fix up a log
      message that was missing a word, which makes the log message more readable.
      Fix an initialization failure if many VFs are instantiated at the same time
      and the VF module is autoloaded by simply resending firmware request if
      there is no response the first time.
      
      Jacob does a rename of the function i40e_ptp_enable() to
      i40e_ptp_feature_enable(), like he did for ixgbe, to reduce possible
      confusion and ambugity in the purpose of the function.  Does follow on
      PTP work on i40e, like he did for ixgbe, by breaking the PTP hardware
      control from the ioctl command for timestamping mode.  By doing this,
      we can maintain state about the 1588 timestamping mode and properly
      re-enable to the last known mode during a re-initialization of 1588 bits.
      
      Anjali cleans up the i40e driver where TCP-IPv4 filters were being added
      twice, which seems to be left over from when we had to add two PTYPEs for
      one filter.  Fixes the flow director sideband logic to detect when there
      is a full flow director table.  Also fixes the programming of FDIR where
      a couple of fields in the descriptor setup that were not being
      programmed, which left the opportunity for stale data to be pushed as
      part of the descriptor next time it was used.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1c27fb9
    • David S. Miller's avatar
      Merge branch 'tipc-next' · 0ff9275a
      David S. Miller authored
      
      
      Jon Maloy says:
      
      ====================
      tipc: new unicast transmission code
      
      As a step towards making the data transmission code more maintainable
      and performant, we introduce a number of new functions, both for
      building, sending and rejecting messages. The new functions will
      eventually be used for alla data transmission, user data unicast,
      service internal messaging, and multicast/broadcast.
      
      We start with this series, where we introduce the functions, and
      let user data unicast and the internal connection protocol use them.
      The remaining users will come in a later series.
      
      There are only minor changes to data structures, and no protocol
      changes, so the older functions can still be used in parallel for
      some time. Until the old functions are removed, we use temporary
      names for the new functions, such as tipc_build_msg2, tipc_link_xmit2.
      
      It should be noted that the first two commits are unrelated to the
      rest of the series.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ff9275a
    • Jon Paul Maloy's avatar
      tipc: simplify connection congestion handling · 60120526
      Jon Paul Maloy authored
      
      
      As a consequence of the recently introduced serialized access
      to the socket in commit 8d94168a761819d10252bab1f8de6d7b202c3baa
      ("tipc: same receive code path for connection protocol and data
      messages") we can make a number of simplifications in the
      detection and handling of connection congestion situations.
      
      - We don't need to keep two counters, one for sent messages and one
        for acked messages. There is no longer any risk for races between
        acknowledge messages arriving in BH and data message sending
        running in user context. So we merge this into one counter,
        'sent_unacked', which is incremented at sending and subtracted
        from at acknowledge reception.
      
      - We don't need to set the 'congested' field in tipc_port to
        true before we sent the message, and clear it when sending
        is successful. (As a matter of fact, it was never necessary;
        the field was set in link_schedule_port() before any wakeup
        could arrive anyway.)
      
      - We keep the conditions for link congestion and connection connection
        congestion separated. There would otherwise be a risk that an arriving
        acknowledge message may wake up a user sleeping because of link
        congestion.
      
      - We can simplify reception of acknowledge messages.
      
      We also make some cosmetic/structural changes:
      
      - We rename the 'congested' field to the more correct 'link_cong´.
      
      - We rename 'conn_unacked' to 'rcv_unacked'
      
      - We move the above mentioned fields from struct tipc_port to
        struct tipc_sock.
      
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      60120526
    • Jon Paul Maloy's avatar
      tipc: clean up connection protocol reception function · ac0074ee
      Jon Paul Maloy authored
      
      
      We simplify the code for receiving connection probes, leveraging the
      recently introduced tipc_msg_reverse() function. We also stick to
      the principle of sending a possible response message directly from
      the calling (tipc_sk_rcv or backlog_rcv) functions, hence making
      the call chain shallower and easier to follow.
      
      We make one small protocol change here, allowed according to
      the spec. If a protocol message arrives from a remote socket that
      is not the one we are connected to, we are currently generating a
      connection abort message and send it to the source. This behavior
      is unnecessary, and might even be a security risk, so instead we
      now choose to only ignore the message. The consequnce for the sender
      is that he will need longer time to discover his mistake (until the
      next timeout), but this is an extreme corner case, and may happen
      anyway under other circumstances, so we deem this change acceptable.
      
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac0074ee
    • Jon Paul Maloy's avatar
      tipc: same receive code path for connection protocol and data messages · ec8a2e56
      Jon Paul Maloy authored
      
      
      As a preparation to eliminate port_lock we need to bring reception
      of connection protocol messages under proper protection of bh_lock_sock
      or socket owner.
      
      We fix this by letting those messages follow the same code path as
      incoming data messages.
      
      As a side effect of this change, the last reference to the function
      net_route_msg() disappears, and we can eliminate that function.
      
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ec8a2e56