1. 21 Mar, 2016 1 commit
    • Michal Kubeček's avatar
      ipv6: prevent fib6_run_gc() contention · 5317d9af
      Michal Kubeček authored
      commit 2ac3ac8f
      
       upstream.
      
      On a high-traffic router with many processors and many IPv6 dst
      entries, soft lockup in fib6_run_gc() can occur when number of
      entries reaches gc_thresh.
      
      This happens because fib6_run_gc() uses fib6_gc_lock to allow
      only one thread to run the garbage collector but ip6_dst_gc()
      doesn't update net->ipv6.ip6_rt_last_gc until fib6_run_gc()
      returns. On a system with many entries, this can take some time
      so that in the meantime, other threads pass the tests in
      ip6_dst_gc() (ip6_rt_last_gc is still not updated) and wait for
      the lock. They then have to run the garbage collector one after
      another which blocks them for quite long.
      
      Resolve this by replacing special value ~0UL of expire parameter
      to fib6_run_gc() by explicit "force" parameter to choose between
      spin_lock_bh() and spin_trylock_bh() and call fib6_run_gc() with
      force=false if gc_thresh is reached but not max_size.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      [lizf: Backported to 3.4: adjust context]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      5317d9af
  2. 14 Sep, 2013 1 commit
  3. 17 Nov, 2012 1 commit
  4. 13 Apr, 2012 1 commit
    • Gao feng's avatar
      ipv6: fix problem with expired dst cache · 1716a961
      Gao feng authored
      
      If the ipv6 dst cache which copy from the dst generated by ICMPV6 RA packet.
      this dst cache will not check expire because it has no RTF_EXPIRES flag.
      So this dst cache will always be used until the dst gc run.
      
      Change the struct dst_entry,add a union contains new pointer from and expires.
      When rt6_info.rt6i_flags has no RTF_EXPIRES flag,the dst.expires has no use.
      we can use this field to point to where the dst cache copy from.
      The dst.from is only used in IPV6.
      
      rt6_check_expired check if rt6_info.dst.from is expired.
      
      ip6_rt_copy only set dst.from when the ort has flag RTF_ADDRCONF
      and RTF_DEFAULT.then hold the ort.
      
      ip6_dst_destroy release the ort.
      
      Add some functions to operate the RTF_EXPIRES flag and expires(from) together.
      and change the code to use these new adding functions.
      
      Changes from v5:
      modify ip6_route_add and ndisc_router_discovery to use new adding functions.
      
      Only set dst.from when the ort has flag RTF_ADDRCONF
      and RTF_DEFAULT.then hold the ort.
      Signed-off-by: default avatarGao feng <gaofeng@cn.fujitsu.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1716a961
  5. 22 Feb, 2012 1 commit
  6. 28 Jan, 2012 2 commits
  7. 04 Jan, 2012 1 commit
    • Neil Horman's avatar
      ipv6: Check RA for sllao when configuring optimistic ipv6 address (v2) · e6bff995
      Neil Horman authored
      Recently Dave noticed that a test we did in ipv6_add_addr to see if we next hop
      route for the interface we're adding an addres to was wrong (see commit
      7ffbcecb
      
      ).  for one, it never triggers, and two,
      it was completely wrong to begin with.  This test was meant to cover this
      section of RFC 4429:
      
      3.3 Modifications to RFC 2462 Stateless Address Autoconfiguration
      
         * (modifies section 5.5) A host MAY choose to configure a new address
              as an Optimistic Address.  A host that does not know the SLLAO
              of its router SHOULD NOT configure a new address as Optimistic.
              A router SHOULD NOT configure an Optimistic Address.
      
      This patch should bring us into proper compliance with the above clause.  Since
      we only add a SLAAC address after we've received a RA which may or may not
      contain a source link layer address option, we can pass a pointer to that option
      to addrconf_prefix_rcv (which may be null if the option is not present), and
      only set the optimistic flag if the option was found in the RA.
      
      Change notes:
      (v2) modified the new parameter to addrconf_prefix_rcv to be a bool rather than
      a pointer to make its use more clear as per request from davem.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6bff995
  8. 29 Dec, 2011 1 commit
  9. 28 Dec, 2011 1 commit
  10. 06 Dec, 2011 1 commit
  11. 05 Dec, 2011 1 commit
  12. 30 Nov, 2011 1 commit
  13. 23 Nov, 2011 1 commit
  14. 22 Nov, 2011 1 commit
  15. 18 Nov, 2011 1 commit
    • Herbert Xu's avatar
      ipv6: Remove all uses of LL_ALLOCATED_SPACE · a7ae1992
      Herbert Xu authored
      
      ipv6: Remove all uses of LL_ALLOCATED_SPACE
      
      The macro LL_ALLOCATED_SPACE was ill-conceived.  It applies the
      alignment to the sum of needed_headroom and needed_tailroom.  As
      the amount that is then reserved for head room is needed_headroom
      with alignment, this means that the tail room left may be too small.
      
      This patch replaces all uses of LL_ALLOCATED_SPACE in net/ipv6
      with the macro LL_RESERVED_SPACE and direct reference to
      needed_tailroom.
      
      This also fixes the problem with needed_headroom changing between
      allocating the skb and reserving the head room.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7ae1992
  16. 14 Nov, 2011 1 commit
    • Eric Dumazet's avatar
      neigh: new unresolved queue limits · 8b5c171b
      Eric Dumazet authored
      
      Le mercredi 09 novembre 2011 à 16:21 -0500, David Miller a écrit :
      > From: David Miller <davem@davemloft.net>
      > Date: Wed, 09 Nov 2011 16:16:44 -0500 (EST)
      >
      > > From: Eric Dumazet <eric.dumazet@gmail.com>
      > > Date: Wed, 09 Nov 2011 12:14:09 +0100
      > >
      > >> unres_qlen is the number of frames we are able to queue per unresolved
      > >> neighbour. Its default value (3) was never changed and is responsible
      > >> for strange drops, especially if IP fragments are used, or multiple
      > >> sessions start in parallel. Even a single tcp flow can hit this limit.
      > >  ...
      > >
      > > Ok, I've applied this, let's see what happens :-)
      >
      > Early answer, build fails.
      >
      > Please test build this patch with DECNET enabled and resubmit.  The
      > decnet neigh layer still refers to the removed ->queue_len member.
      >
      > Thanks.
      
      Ouch, this was fixed on one machine yesterday, but not the other one I
      used this morning, sorry.
      
      [PATCH V5 net-next] neigh: new unresolved queue limits
      
      unres_qlen is the number of frames we are able to queue per unresolved
      neighbour. Its default value (3) was never changed and is responsible
      for strange drops, especially if IP fragments are used, or multiple
      sessions start in parallel. Even a single tcp flow can hit this limit.
      
      $ arp -d 192.168.20.108 ; ping -c 2 -s 8000 192.168.20.108
      PING 192.168.20.108 (192.168.20.108) 8000(8028) bytes of data.
      8008 bytes from 192.168.20.108: icmp_seq=2 ttl=64 time=0.322 ms
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b5c171b
  17. 24 Oct, 2011 1 commit
    • Andreas Hofmeister's avatar
      ipv6: Do not use routes from locally generated RAs · 9f56220f
      Andreas Hofmeister authored
      
      When hybrid mode is enabled (accept_ra == 2), the kernel also sees RAs
      generated locally. This is useful since it allows the kernel to auto-configure
      its own interface addresses.
      
      However, if 'accept_ra_defrtr' and/or 'accept_ra_rtr_pref' are set and the
      locally generated RAs announce the default route and/or other route information,
      the kernel happily inserts bogus routes with its own address as gateway.
      
      With this patch, adding routes from an RA will be skiped when the RAs source
      address matches any local address, just as if 'accept_ra_defrtr' and
      'accept_ra_rtr_pref' were set to 0.
      Signed-off-by: default avatarAndreas Hofmeister <andi@collax.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f56220f
  18. 17 Oct, 2011 1 commit
  19. 01 Aug, 2011 1 commit
  20. 18 Jul, 2011 3 commits
  21. 17 Jul, 2011 2 commits
  22. 29 Apr, 2011 1 commit
    • Ben Hutchings's avatar
      ipv4, ipv6, bonding: Restore control over number of peer notifications · ad246c99
      Ben Hutchings authored
      
      For backward compatibility, we should retain the module parameters and
      sysfs attributes to control the number of peer notifications
      (gratuitous ARPs and unsolicited NAs) sent after bonding failover.
      Also, it is possible for failover to take place even though the new
      active slave does not have link up, and in that case the peer
      notification should be deferred until it does.
      
      Change ipv4 and ipv6 so they do not automatically send peer
      notifications on bonding failover.
      
      Change the bonding driver to send separate NETDEV_NOTIFY_PEERS
      notifications when the link is up, as many times as requested.  Since
      it does not directly control which protocols send notifications, make
      num_grat_arp and num_unsol_na aliases for a single parameter.  Bump
      the bonding version number and update its documentation.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
      Acked-by: default avatarBrian Haley <brian.haley@hp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad246c99
  23. 22 Apr, 2011 1 commit
  24. 18 Apr, 2011 2 commits
  25. 15 Apr, 2011 1 commit
  26. 30 Mar, 2011 1 commit
  27. 12 Mar, 2011 1 commit
  28. 02 Mar, 2011 1 commit
  29. 04 Feb, 2011 1 commit
  30. 09 Dec, 2010 1 commit
    • David S. Miller's avatar
      net: Abstract away all dst_entry metrics accesses. · defb3519
      David S. Miller authored
      
      Use helper functions to hide all direct accesses, especially writes,
      to dst_entry metrics values.
      
      This will allow us to:
      
      1) More easily change how the metrics are stored.
      
      2) Implement COW for metrics.
      
      In particular this will help us put metrics into the inetpeer
      cache if that is what we end up doing.  We can make the _metrics
      member a pointer instead of an array, initially have it point
      at the read-only metrics in the FIB, and then on the first set
      grab an inetpeer entry and point the _metrics member there.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      defb3519
  31. 02 Dec, 2010 1 commit
  32. 05 Oct, 2010 1 commit
    • Eric Dumazet's avatar
      net neigh: RCU conversion of neigh hash table · d6bf7817
      Eric Dumazet authored
      
      David
      
      This is the first step for RCU conversion of neigh code.
      
      Next patches will convert hash_buckets[] and "struct neighbour" to RCU
      protected objects.
      
      Thanks
      
      [PATCH net-next] net neigh: RCU conversion of neigh hash table
      
      Instead of storing hash_buckets, hash_mask and hash_rnd in "struct
      neigh_table", a new structure is defined :
      
      struct neigh_hash_table {
             struct neighbour        **hash_buckets;
             unsigned int            hash_mask;
             __u32                   hash_rnd;
             struct rcu_head         rcu;
      };
      
      And "struct neigh_table" has an RCU protected pointer to such a
      neigh_hash_table.
      
      This means the signature of (*hash)() function changed: We need to add a
      third parameter with the actual hash_rnd value, since this is not
      anymore a neigh_table field.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d6bf7817
  33. 23 Sep, 2010 1 commit
  34. 03 Sep, 2010 1 commit
    • Thomas Graf's avatar
      ipv6: add special mode accept_ra=2 to accept RA while configured as router · 65e9b62d
      Thomas Graf authored
      
      The current IPv6 behavior is to not accept router advertisements while
      forwarding, i.e. configured as router.
      
      This does make sense, a router is typically not supposed to be auto
      configured. However there are exceptions and we should allow the
      current behavior to be overwritten.
      
      Therefore this patch enables the user to overrule the "if forwarding
      enabled then don't listen to RAs" rule by setting accept_ra to the
      special value of 2.
      
      An alternative would be to ignore the forwarding switch alltogether
      and solely accept RAs based on the value of accept_ra. However, I
      found that if not intended, accepting RAs as a router can lead to
      strange unwanted behavior therefore we it seems wise to only do so
      if the user explicitely asks for this behavior.
      Signed-off-by: default avatarThomas Graf <tgraf@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      65e9b62d
  35. 26 Jun, 2010 1 commit