1. 20 7月, 2012 2 次提交
    • E
      ipv4: tcp: remove per net tcp_sock · be9f4a44
      Eric Dumazet 提交于
      tcp_v4_send_reset() and tcp_v4_send_ack() use a single socket
      per network namespace.
      
      This leads to bad behavior on multiqueue NICS, because many cpus
      contend for the socket lock and once socket lock is acquired, extra
      false sharing on various socket fields slow down the operations.
      
      To better resist to attacks, we use a percpu socket. Each cpu can
      run without contention, using appropriate memory (local node)
      
      Additional features :
      
      1) We also mirror the queue_mapping of the incoming skb, so that
      answers use the same queue if possible.
      
      2) Setting SOCK_USE_WRITE_QUEUE socket flag speedup sock_wfree()
      
      3) We now limit the number of in-flight RST/ACK [1] packets
      per cpu, instead of per namespace, and we honor the sysctl_wmem_default
      limit dynamically. (Prior to this patch, sysctl_wmem_default value was
      copied at boot time, so any further change would not affect tcp_sock
      limit)
      
      [1] These packets are only generated when no socket was matched for
      the incoming packet.
      Reported-by: NBill Sommerfeld <wsommerfeld@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be9f4a44
    • J
      ipv4: use seqlock for nh_exceptions · aee06da6
      Julian Anastasov 提交于
      Use global seqlock for the nh_exceptions. Call
      fnhe_oldest with the right hash chain. Correct the diff
      value for dst_set_expires.
      
      v2: after suggestions from Eric Dumazet:
      * get rid of spin lock fnhe_lock, rearrange update_or_create_fnhe
      * continue daddr search in rt_bind_exception
      
      v3:
      * remove the daddr check before seqlock in rt_bind_exception
      * restart lookup in rt_bind_exception on detected seqlock change,
      as suggested by David Miller
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aee06da6
  2. 19 7月, 2012 38 次提交