1. 12 Feb, 2016 6 commits
    • Edward Cree's avatar
      net: enable LCO for udp_tunnel_handle_offloads() users · 21e2e7f9
      Edward Cree authored
      The only protocol affected at present is Geneve.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21e2e7f9
    • Edward Cree's avatar
      net: udp: always set up for CHECKSUM_PARTIAL offload · d75f1306
      Edward Cree authored
      If the dst device doesn't support it, it'll get fixed up later anyway
       by validate_xmit_skb().  Also, this allows us to take advantage of LCO
       to avoid summing the payload multiple times.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d75f1306
    • Edward Cree's avatar
      net: local checksum offload for encapsulation · 179bc67f
      Edward Cree authored
      The arithmetic properties of the ones-complement checksum mean that a
       correctly checksummed inner packet, including its checksum, has a ones
       complement sum depending only on whatever value was used to initialise
       the checksum field before checksumming (in the case of TCP and UDP,
       this is the ones complement sum of the pseudo header, complemented).
      Consequently, if we are going to offload the inner checksum with
       CHECKSUM_PARTIAL, we can compute the outer checksum based only on the
       packed data not covered by the inner checksum, and the initial value of
       the inner checksum field.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      179bc67f
    • David S. Miller's avatar
      Merge branch 'tcp_dccp_ports' · e51271d4
      David S. Miller authored
      Eric Dumazet says:
      
      ====================
      tcp/dccp: better use of ephemeral ports
      
      Big servers have bloated bind table, making very hard to succeed
      ephemeral port allocations, without special containers/namespace tricks.
      
      This patch series extends the strategy added in commit 07f4c900
      ("tcp/dccp: try to not exhaust ip_local_port_range in connect()").
      
      Since ports used by connect() are much likely to be shared among them,
      we give a hint to both bind() and connect() to keep the crowds separated
      if possible.
      
      Of course, if on a specific host an application needs to allocate ~30000
      ports using bind(), it will still be able to do so. Same for ~30000 connect()
      to a unique 2-tuple (dst addr, dst port)
      
      New implemetation is also more friendly to softirqs and reschedules.
      
      v2: rebase after TCP SO_REUSEPORT changes
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e51271d4
    • Eric Dumazet's avatar
      tcp/dccp: better use of ephemeral ports in bind() · ea8add2b
      Eric Dumazet authored
      Implement strategy used in __inet_hash_connect() in opposite way :
      
      Try to find a candidate using odd ports, then fallback to even ports.
      
      We no longer disable BH for whole traversal, but one bucket at a time.
      We also use cond_resched() to yield cpu to other tasks if needed.
      
      I removed one indentation level and tried to mirror the loop we have
      in __inet_hash_connect() and variable names to ease code maintenance.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea8add2b
    • Eric Dumazet's avatar
      tcp/dccp: better use of ephemeral ports in connect() · 1580ab63
      Eric Dumazet authored
      In commit 07f4c900 ("tcp/dccp: try to not exhaust ip_local_port_range
      in connect()"), I added a very simple heuristic, so that we got better
      chances to use even ports, and allow bind() users to have more available
      slots.
      
      It gave nice results, but with more than 200,000 TCP sessions on a typical
      server, the ~30,000 ephemeral ports are still a rare resource.
      
      I chose to go a step further, by looking at all even ports, and if none
      was available, fallback to odd ports.
      
      The companion patch does the same in bind(), but in opposite way.
      
      I've seen exec times of up to 30ms on busy servers, so I no longer
      disable BH for the whole traversal, but only for each hash bucket.
      I also call cond_resched() to be gentle to other tasks.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1580ab63
  2. 11 Feb, 2016 34 commits