1. 29 11月, 2010 1 次提交
  2. 18 11月, 2010 1 次提交
  3. 13 11月, 2010 1 次提交
  4. 04 11月, 2010 1 次提交
    • X
      net dst: fix percpu_counter list corruption and poison overwritten · 41bb78b4
      Xiaotian Feng 提交于
      There're some percpu_counter list corruption and poison overwritten warnings
      in recent kernel, which is resulted by fc66f95c.
      
      commit fc66f95c switches to use percpu_counter, in ip6_route_net_init, kernel
      init the percpu_counter for dst entries, but, the percpu_counter is never destroyed
      in ip6_route_net_exit. So if the related data is freed by kernel, the freed percpu_counter
      is still on the list, then if we insert/remove other percpu_counter, list corruption
      resulted. Also, if the insert/remove option modifies the ->prev,->next pointer of
      the freed value, the poison overwritten is resulted then.
      
      With the following patch, the percpu_counter list corruption and poison overwritten
      warnings disappeared.
      Signed-off-by: NXiaotian Feng <dfeng@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41bb78b4
  5. 12 10月, 2010 1 次提交
    • E
      net dst: use a percpu_counter to track entries · fc66f95c
      Eric Dumazet 提交于
      struct dst_ops tracks number of allocated dst in an atomic_t field,
      subject to high cache line contention in stress workload.
      
      Switch to a percpu_counter, to reduce number of time we need to dirty a
      central location. Place it on a separate cache line to avoid dirtying
      read only fields.
      
      Stress test :
      
      (Sending 160.000.000 UDP frames,
      IP route cache disabled, dual E5540 @2.53GHz,
      32bit kernel, FIB_TRIE, SLUB/NUMA)
      
      Before:
      
      real    0m51.179s
      user    0m15.329s
      sys     10m15.942s
      
      After:
      
      real	0m45.570s
      user	0m15.525s
      sys	9m56.669s
      
      With a small reordering of struct neighbour fields, subject of a
      following patch, (to separate refcnt from other read mostly fields)
      
      real	0m41.841s
      user	0m15.261s
      sys	8m45.949s
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc66f95c
  6. 04 10月, 2010 1 次提交
  7. 29 9月, 2010 1 次提交
    • M
      ipv6: Implement Any-IP support for IPv6. · ab79ad14
      Maciej Żenczykowski 提交于
      AnyIP is the capability to receive packets and establish incoming
      connections on IPs we have not explicitly configured on the machine.
      
      An example use case is to configure a machine to accept all incoming
      traffic on eth0, and leave the policy of whether traffic for a given IP
      should be delivered to the machine up to the load balancer.
      
      Can be setup as follows:
        ip -6 rule from all iif eth0 lookup 200
        ip -6 route add local default dev lo table 200
      (in this case for all IPv6 addresses)
      Signed-off-by: NMaciej Żenczykowski <maze@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab79ad14
  8. 28 9月, 2010 1 次提交
  9. 24 9月, 2010 1 次提交
  10. 15 8月, 2010 1 次提交
  11. 15 6月, 2010 1 次提交
  12. 11 6月, 2010 1 次提交
  13. 29 5月, 2010 1 次提交
  14. 18 5月, 2010 1 次提交
  15. 22 4月, 2010 1 次提交
    • J
      net: ipv6 bind to device issue · f4f914b5
      Jiri Olsa 提交于
      The issue raises when having 2 NICs both assigned the same
      IPv6 global address.
      
      If a sender binds to a particular NIC (SO_BINDTODEVICE),
      the outgoing traffic is being sent via the first found.
      The bonded device is thus not taken into an account during the
      routing.
      
      From the ip6_route_output function:
      
      If the binding address is multicast, linklocal or loopback,
      the RT6_LOOKUP_F_IFACE bit is set, but not for global address.
      
      So binding global address will neglect SO_BINDTODEVICE-binded device,
      because the fib6_rule_lookup function path won't check for the
      flowi::oif field and take first route that fits.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NScott Otto <scott.otto@alcatel-lucent.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4f914b5
  16. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  17. 29 3月, 2010 1 次提交
  18. 20 3月, 2010 1 次提交
  19. 08 3月, 2010 1 次提交
  20. 26 2月, 2010 1 次提交
  21. 19 2月, 2010 1 次提交
  22. 18 1月, 2010 1 次提交
  23. 19 12月, 2009 1 次提交
  24. 12 11月, 2009 1 次提交
    • E
      sysctl net: Remove unused binary sysctl code · f8572d8f
      Eric W. Biederman 提交于
      Now that sys_sysctl is a compatiblity wrapper around /proc/sys
      all sysctl strategy routines, and all ctl_name and strategy
      entries in the sysctl tables are unused, and can be
      revmoed.
      
      In addition neigh_sysctl_register has been modified to no longer
      take a strategy argument and it's callers have been modified not
      to pass one.
      
      Cc: "David Miller" <davem@davemloft.net>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      f8572d8f
  25. 08 10月, 2009 1 次提交
  26. 24 9月, 2009 1 次提交
  27. 17 9月, 2009 1 次提交
  28. 02 9月, 2009 1 次提交
    • A
      netns: embed ip6_dst_ops directly · 86393e52
      Alexey Dobriyan 提交于
      struct net::ipv6.ip6_dst_ops is separatedly dynamically allocated,
      but there is no fundamental reason for it. Embed it directly into
      struct netns_ipv6.
      
      For that:
      * move struct dst_ops into separate header to fix circular dependencies
      	I honestly tried not to, it's pretty impossible to do other way
      * drop dynamical allocation, allocate together with netns
      
      For a change, remove struct dst_ops::dst_net, it's deducible
      by using container_of() given dst_ops pointer.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86393e52
  29. 23 6月, 2009 1 次提交
  30. 03 6月, 2009 1 次提交
  31. 21 5月, 2009 1 次提交
    • J
      IPv6: set RTPROT_KERNEL to initial route · 4f724279
      Jean-Mickael Guerin 提交于
      The use of unspecified protocol in IPv6 initial route prevents quagga to
      install IPv6 default route:
      # show ipv6 route
      S   ::/0 [1/0] via fe80::1, eth1_0
      K>* ::/0 is directly connected, lo, rej
      C>* ::1/128 is directly connected, lo
      C>* fe80::/64 is directly connected, eth1_0
      
      # ip -6 route
      fe80::/64 dev eth1_0  proto kernel  metric 256  mtu 1500 advmss 1440
      hoplimit -1
      ff00::/8 dev eth1_0  metric 256  mtu 1500 advmss 1440 hoplimit -1
      unreachable default dev lo  proto none  metric -1  error -101 hoplimit 255
      
      The attached patch ensures RTPROT_KERNEL to the default initial route
      and fixes the problem for quagga.
      This is similar to "ipv6: protocol for address routes"
      f410a1fb.
      
      # show ipv6 route
      S>* ::/0 [1/0] via fe80::1, eth1_0
      C>* ::1/128 is directly connected, lo
      C>* fe80::/64 is directly connected, eth1_0
      
      # ip -6 route
      fe80::/64 dev eth1_0  proto kernel  metric 256  mtu 1500 advmss 1440
      hoplimit -1
      fe80::/64 dev eth1_0  proto kernel  metric 256  mtu 1500 advmss 1440
      hoplimit -1
      ff00::/8 dev eth1_0  metric 256  mtu 1500 advmss 1440 hoplimit -1
      default via fe80::1 dev eth1_0  proto zebra  metric 1024  mtu 1500
      advmss 1440 hoplimit -1
      unreachable default dev lo  proto kernel  metric -1  error -101 hoplimit 255
      Signed-off-by: NJean-Mickael Guerin <jean-mickael.guerin@6wind.com>
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f724279
  32. 25 2月, 2009 1 次提交
    • P
      netlink: change nlmsg_notify() return value logic · 1ce85fe4
      Pablo Neira Ayuso 提交于
      This patch changes the return value of nlmsg_notify() as follows:
      
      If NETLINK_BROADCAST_ERROR is set by any of the listeners and
      an error in the delivery happened, return the broadcast error;
      else if there are no listeners apart from the socket that
      requested a change with the echo flag, return the result of the
      unicast notification. Thus, with this patch, the unicast
      notification is handled in the same way of a broadcast listener
      that has set the NETLINK_BROADCAST_ERROR socket flag.
      
      This patch is useful in case that the caller of nlmsg_notify()
      wants to know the result of the delivery of a netlink notification
      (including the broadcast delivery) and take any action in case
      that the delivery failed. For example, ctnetlink can drop packets
      if the event delivery failed to provide reliable logging and
      state-synchronization at the cost of dropping packets.
      
      This patch also modifies the rtnetlink code to ignore the return
      value of rtnl_notify() in all callers. The function rtnl_notify()
      (before this patch) returned the error of the unicast notification
      which makes rtnl_set_sk_err() reports errors to all listeners. This
      is not of any help since the origin of the change (the socket that
      requested the echoing) notices the ENOBUFS error if the notification
      fails and should resync itself.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ce85fe4
  33. 01 2月, 2009 1 次提交
  34. 28 1月, 2009 1 次提交
    • T
      IPv6: Fix multicast routing bugs. · 1d6e55f1
      Thomas Goff 提交于
      This patch addresses the IPv6 multicast routing issues described
      below.  It was tested with XORP 1.4/1.5 as the IPv6 PIM-SM routing
      daemon against FreeBSD peers.
      
      net/ipv6/ip6_input.c:
      
        - Don't try to forward link-local multicast packets.
      
        - Don't reset skb2->dev before calling ip6_mr_input() so packets can
          be identified as coming from the PIM register vif properly.
      
      net/ipv6/ip6mr.c:
      
        - Fix incoming PIM register messages processing:
      
          * The IPv6 pseudo-header should be included when checksumming PIM
            messages (RFC 4601 section 4.9; RFC 3973 section 4.7.1).
      
          * Packets decapsulated from PIM register messages should have
            skb->protocol ETH_P_IPV6.
      
        - Enable/disable IPv6 multicast forwarding on the corresponding
          interface when a routing daemon adds/removes a multicast virtual
          interface.
      
        - Remove incorrect skb_pull() to fix userspace signaling.
      
        - Enable/disable global IPv6 multicast forwarding when an IPv6
          multicast routing socket is opened/closed.
      
      net/ipv6/route.c:
      
        - Don't use strict routing logic for packets decapsulated from PIM
          register messages (similar to disabling rp_filter for the IPv4
          case).
      Signed-off-by: NThomas Goff <thomas.goff@boeing.com>
      Reviewed-by: NFred Templin <fred.l.templin@boeing.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d6e55f1
  35. 09 1月, 2009 1 次提交
  36. 05 1月, 2009 1 次提交
    • D
      ipv6: Fix sporadic sendmsg -EINVAL when sending to multicast groups. · 14deae41
      David S. Miller 提交于
      Thanks to excellent diagnosis by Eduard Guzovsky.
      
      The core problem is that on a network with lots of active
      multicast traffic, the neighbour cache can fill up.  If
      we try to allocate a new route and thus neighbour cache
      entry, the bog-standard GC attempt the neighbour layer does
      in ineffective because route entries hold a reference
      to the existing neighbour entries and GC can only liberate
      entries with no references.
      
      IPV4 already has a way to handle this, by doing a route cache
      GC in such situations (when neigh attach returns -ENOBUFS).
      
      So simply mimick this on the ipv6 side.
      Tested-by: NEduard Guzovsky <eguzovsky@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      14deae41
  37. 11 12月, 2008 1 次提交
    • B
      netns: ip6mr: enable namespace support in ipv6 multicast forwarding code · 8229efda
      Benjamin Thery 提交于
      This last patch makes the appropriate changes to use and propagate the
      network namespace where needed in IPv6 multicast forwarding code.
      
      This consists mainly in replacing all the remaining init_net occurences
      with current netns pointer retrieved from sockets, net devices or 
      mfc6_caches depending on the routines' contexts.
      
      Some routines receive a new 'struct net' parameter to propagate the current
      netns:
      * ip6mr_get_route
      * ip6mr_cache_report
      * ip6mr_cache_find
      * ip6mr_cache_unresolved
      * mif6_add/mif6_delete
      * ip6mr_mfc_add/ip6mr_mfc_delete
      * ip6mr_reg_vif
      
      All the IPv6 multicast forwarding variables moved to struct netns_ipv6 by
      the previous patches are now referenced in the correct namespace.
      
      Changelog:
      ==========
      * Take into account the net associated to mfc6_cache when matching entries in
        mfc_unres_queue list.
      * Call mroute_clean_tables() in ip6mr_net_exit() to free memory allocated
        per-namespace.
      * Call dev_net_set() in ip6mr_reg_vif() to initialize dev->nd_net 
        correctly.
      Signed-off-by: NBenjamin Thery <benjamin.thery@bull.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8229efda
  38. 12 11月, 2008 1 次提交
  39. 04 11月, 2008 1 次提交
    • A
      net: '&' redux · 6d9f239a
      Alexey Dobriyan 提交于
      I want to compile out proc_* and sysctl_* handlers totally and
      stub them to NULL depending on config options, however usage of &
      will prevent this, since taking adress of NULL pointer will break
      compilation.
      
      So, drop & in front of every ->proc_handler and every ->strategy
      handler, it was never needed in fact.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6d9f239a
  40. 30 10月, 2008 1 次提交