1. 24 3月, 2011 1 次提交
  2. 16 3月, 2011 1 次提交
  3. 14 3月, 2011 1 次提交
    • H
      ipv4: Fix PMTU update. · 46af3180
      Hiroaki SHIMODA 提交于
      On current net-next-2.6, when Linux receives ICMP Type: 3, Code: 4
      (Destination unreachable (Fragmentation needed)),
      
        icmp_unreach
          -> ip_rt_frag_needed
               (peer->pmtu_expires is set here)
          -> tcp_v4_err
               -> do_pmtu_discovery
                    -> ip_rt_update_pmtu
                         (peer->pmtu_expires is already set,
                          so check_peer_pmtu is skipped.)
                         -> check_peer_pmtu
      
      check_peer_pmtu is skipped and MTU is not updated.
      
      To fix this, let check_peer_pmtu execute unconditionally.
      And some minor fixes
      1) Avoid potential peer->pmtu_expires set to be zero.
      2) In check_peer_pmtu, argument of time_before is reversed.
      3) check_peer_pmtu expects peer->pmtu_orig is initialized as zero,
         but not initialized.
      Signed-off-by: NHiroaki SHIMODA <shimoda.hiroaki@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46af3180
  4. 13 3月, 2011 4 次提交
  5. 11 3月, 2011 3 次提交
  6. 10 3月, 2011 1 次提交
  7. 05 3月, 2011 4 次提交
  8. 03 3月, 2011 3 次提交
  9. 02 3月, 2011 4 次提交
  10. 19 2月, 2011 1 次提交
  11. 18 2月, 2011 5 次提交
  12. 15 2月, 2011 2 次提交
    • D
      ipv4: Cache learned redirect information in inetpeer. · f39925db
      David S. Miller 提交于
      Note that we do not generate the redirect netevent any longer,
      because we don't create a new cached route.
      
      Instead, once the new neighbour is bound to the cached route,
      we emit a neigh update event instead.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f39925db
    • D
      ipv4: Cache learned PMTU information in inetpeer. · 2c8cec5c
      David S. Miller 提交于
      The general idea is that if we learn new PMTU information, we
      bump the peer genid.
      
      This triggers the dst_ops->check() code to validate and if
      necessary propagate the new PMTU value into the metrics.
      
      Learned PMTU information self-expires.
      
      This means that it is not necessary to kill a cached route
      entry just because the PMTU information is too old.
      
      As a consequence:
      
      1) When the path appears unreachable (dst_ops->link_failure
         or dst_ops->negative_advice) we unwind the PMTU state if
         it is out of date, instead of killing the cached route.
      
         A redirected route will still be invalidated in these
         situations.
      
      2) rt_check_expire(), rt_worker_func(), et al. are no longer
         necessary at all.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c8cec5c
  13. 11 2月, 2011 1 次提交
    • D
      inet: Create a mechanism for upward inetpeer propagation into routes. · 6431cbc2
      David S. Miller 提交于
      If we didn't have a routing cache, we would not be able to properly
      propagate certain kinds of dynamic path attributes, for example
      PMTU information and redirects.
      
      The reason is that if we didn't have a routing cache, then there would
      be no way to lookup all of the active cached routes hanging off of
      sockets, tunnels, IPSEC bundles, etc.
      
      Consider the case where we created a cached route, but no inetpeer
      entry existed and also we were not asked to pre-COW the route metrics
      and therefore did not force the creation a new inetpeer entry.
      
      If we later get a PMTU message, or a redirect, and store this
      information in a new inetpeer entry, there is no way to teach that
      cached route about the newly existing inetpeer entry.
      
      The facilities implemented here handle this problem.
      
      First we create a generation ID.  When we create a cached route of any
      kind, we remember the generation ID at the time of attachment.  Any
      time we force-create an inetpeer entry in response to new path
      information, we bump that generation ID.
      
      The dst_ops->check() callback is where the knowledge of this event
      is propagated.  If the global generation ID does not equal the one
      stored in the cached route, and the cached route has not attached
      to an inetpeer yet, we look it up and attach if one is found.  Now
      that we've updated the cached route's information, we update the
      route's generation ID too.
      
      This clears the way for implementing PMTU and redirects directly in
      the inetpeer cache.  There is absolutely no need to consult cached
      route information in order to maintain this information.
      
      At this point nothing bumps the inetpeer genids, that comes in the
      later changes which handle PMTUs and redirects using inetpeers.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6431cbc2
  14. 09 2月, 2011 1 次提交
  15. 05 2月, 2011 2 次提交
  16. 01 2月, 2011 2 次提交
    • D
      ipv4: Consolidate all default route selection implementations. · 0c838ff1
      David S. Miller 提交于
      Both fib_trie and fib_hash have a local implementation of
      fib_table_select_default().  This is completely unnecessary
      code duplication.
      
      Since we now remember the fib_table and the head of the fib
      alias list of the default route, we can implement one single
      generic version of this routine.
      
      Looking at the fib_hash implementation you may get the impression
      that it's possible for there to be multiple top-level routes in
      the table for the default route.  The truth is, it isn't, the
      insert code will only allow one entry to exist in the zero
      prefix hash table, because all keys evaluate to zero and all
      keys in a hash table must be unique.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c838ff1
    • R
      net: Add default_mtu() methods to blackhole dst_ops · ec831ea7
      Roland Dreier 提交于
      When an IPSEC SA is still being set up, __xfrm_lookup() will return
      -EREMOTE and so ip_route_output_flow() will return a blackhole route.
      This can happen in a sndmsg call, and after d33e4553 ("net: Abstract
      default MTU metric calculation behind an accessor.") this leads to a
      crash in ip_append_data() because the blackhole dst_ops have no
      default_mtu() method and so dst_mtu() calls a NULL pointer.
      
      Fix this by adding default_mtu() methods (that simply return 0, matching
      the old behavior) to the blackhole dst_ops.
      
      The IPv4 part of this patch fixes a crash that I saw when using an IPSEC
      VPN; the IPv6 part is untested because I don't have an IPv6 VPN, but it
      looks to be needed as well.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec831ea7
  17. 29 1月, 2011 1 次提交
  18. 28 1月, 2011 2 次提交
  19. 27 1月, 2011 1 次提交
    • D
      net: Implement read-only protection and COW'ing of metrics. · 62fa8a84
      David S. Miller 提交于
      Routing metrics are now copy-on-write.
      
      Initially a route entry points it's metrics at a read-only location.
      If a routing table entry exists, it will point there.  Else it will
      point at the all zero metric place-holder called 'dst_default_metrics'.
      
      The writeability state of the metrics is stored in the low bits of the
      metrics pointer, we have two bits left to spare if we want to store
      more states.
      
      For the initial implementation, COW is implemented simply via kmalloc.
      However future enhancements will change this to place the writable
      metrics somewhere else, in order to increase sharing.  Very likely
      this "somewhere else" will be the inetpeer cache.
      
      Note also that this means that metrics updates may transiently fail
      if we cannot COW the metrics successfully.
      
      But even by itself, this patch should decrease memory usage and
      increase cache locality especially for routing workloads.  In those
      cases the read-only metric copies stay in place and never get written
      to.
      
      TCP workloads where metrics get updated, and those rare cases where
      PMTU triggers occur, will take a very slight performance hit.  But
      that hit will be alleviated when the long-term writable metrics
      move to a more sharable location.
      
      Since the metrics storage went from a u32 array of RTAX_MAX entries to
      what is essentially a pointer, some retooling of the dst_entry layout
      was necessary.
      
      Most importantly, we need to preserve the alignment of the reference
      count so that it doesn't share cache lines with the read-mostly state,
      as per Eric Dumazet's alignment assertion checks.
      
      The only non-trivial bit here is the move of the 'flags' member into
      the writeable cacheline.  This is OK since we are always accessing the
      flags around the same moment when we made a modification to the
      reference count.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62fa8a84