Skip to content
  1. Jun 11, 2012
    • David S. Miller's avatar
    • David S. Miller's avatar
      inet: Add family scope inetpeer flushes. · b48c80ec
      David S. Miller authored
      
      
      This implementation can deal with having many inetpeer roots, which is
      a necessary prerequisite for per-FIB table rooted peer tables.
      
      Each family (AF_INET, AF_INET6) has a sequence number which we bump
      when we get a family invalidation request.
      
      Each peer lookup cheaply checks whether the flush sequence of the
      root we are using is out of date, and if so flushes it and updates
      the sequence number.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b48c80ec
    • David S. Miller's avatar
      ipv4: Kill ip_rt_frag_needed(). · 46517008
      David S. Miller authored
      
      
      There is zero point to this function.
      
      It's only real substance is to perform an extremely outdated BSD4.2
      ICMP check, which we can safely remove.  If you really have a MTU
      limited link being routed by a BSD4.2 derived system, here's a nickel
      go buy yourself a real router.
      
      The other actions of ip_rt_frag_needed(), checking and conditionally
      updating the peer, are done by the per-protocol handlers of the ICMP
      event.
      
      TCP, UDP, et al. have a handler which will receive this event and
      transmit it back into the associated route via dst_ops->update_pmtu().
      
      This simplification is important, because it eliminates the one place
      where we do not have a proper route context in which to make an
      inetpeer lookup.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46517008
    • David S. Miller's avatar
      inet: Hide route peer accesses behind helpers. · 97bab73f
      David S. Miller authored
      
      
      We encode the pointer(s) into an unsigned long with one state bit.
      
      The state bit is used so we can store the inetpeer tree root to use
      when resolving the peer later.
      
      Later the peer roots will be per-FIB table, and this change works to
      facilitate that.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      97bab73f
  2. Jun 10, 2012
  3. Jun 09, 2012
    • David S. Miller's avatar
      tcp: Get rid of inetpeer special cases. · 4670fd81
      David S. Miller authored
      
      
      The get_peer method TCP uses is full of special cases that make no
      sense accommodating, and it also gets in the way of doing more
      reasonable things here.
      
      First of all, if the socket doesn't have a usable cached route, there
      is no sense in trying to optimize timewait recycling.
      
      Likewise for the case where we have IP options, such as SRR enabled,
      that make the IP header destination address (and thus the destination
      address of the route key) differ from that of the connection's
      destination address.
      
      Just return a NULL peer in these cases, and thus we're also able to
      get rid of the clumsy inetpeer release logic.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4670fd81
    • David S. Miller's avatar
      inet: Create and use rt{,6}_get_peer_create(). · fbfe95a4
      David S. Miller authored
      
      
      There's a lot of places that open-code rt{,6}_get_peer() only because
      they want to set 'create' to one.  So add an rt{,6}_get_peer_create()
      for their sake.
      
      There were also a few spots open-coding plain rt{,6}_get_peer() and
      those are transformed here as well.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fbfe95a4
    • Eric Dumazet's avatar
      af_unix: speedup /proc/net/unix · 7123aaa3
      Eric Dumazet authored
      
      
      /proc/net/unix has quadratic behavior, and can hold unix_table_lock for
      a while if high number of unix sockets are alive. (90 ms for 200k
      sockets...)
      
      We already have a hash table, so its quite easy to use it.
      
      Problem is unbound sockets are still hashed in a single hash slot
      (unix_socket_table[UNIX_HASH_TABLE])
      
      This patch also spreads unbound sockets to 256 hash slots, to speedup
      both /proc/net/unix and unix_diag.
      
      Time to read /proc/net/unix with 200k unix sockets :
      (time dd if=/proc/net/unix of=/dev/null bs=4k)
      
      before : 520 secs
      after : 2 secs
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7123aaa3
    • Gao feng's avatar
      inetpeer: add parameter net for inet_getpeer_v4,v6 · 54db0cc2
      Gao feng authored
      
      
      add struct net as a parameter of inet_getpeer_v[4,6],
      use net to replace &init_net.
      
      and modify some places to provide net for inet_getpeer_v[4,6]
      
      Signed-off-by: default avatarGao feng <gaofeng@cn.fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54db0cc2
    • Gao feng's avatar
      inetpeer: add namespace support for inetpeer · c8a627ed
      Gao feng authored
      
      
      now inetpeer doesn't support namespace,the information will
      be leaking across namespace.
      
      this patch move the global vars v4_peers and v6_peers to
      netns_ipv4 and netns_ipv6 as a field peers.
      
      add struct pernet_operations inetpeer_ops to initial pernet
      inetpeer data.
      
      and change family_to_base and inet_getpeer to support namespace.
      
      Signed-off-by: default avatarGao feng <gaofeng@cn.fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8a627ed
  4. Jun 08, 2012
  5. Jun 07, 2012