1. 02 Mar, 2011 1 commit
  2. 11 Dec, 2010 1 commit
  3. 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>
  4. 17 Nov, 2010 1 commit
  5. 15 Nov, 2010 1 commit
  6. 21 Oct, 2010 2 commits
  7. 11 Oct, 2010 1 commit
    • Eric Dumazet's avatar
      net dst: use a percpu_counter to track entries · fc66f95c
      Eric Dumazet authored
      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)
      real    0m51.179s
      user    0m15.329s
      sys     10m15.942s
      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: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  8. 19 Sep, 2010 1 commit
  9. 02 Sep, 2010 1 commit
  10. 24 Aug, 2010 1 commit
  11. 07 Jul, 2010 1 commit
  12. 02 Jul, 2010 1 commit
  13. 15 Jun, 2010 1 commit
  14. 11 Jun, 2010 1 commit
  15. 01 Jun, 2010 1 commit
  16. 13 May, 2010 1 commit
    • Bart De Schuymer's avatar
      netfilter: bridge-netfilter: fix crash in br_nf_forward_finish() · e94c6743
      Bart De Schuymer authored
      [ 4593.956206] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      [ 4593.956219] IP: [<ffffffffa03357a4>] br_nf_forward_finish+0x154/0x170 [bridge]
      [ 4593.956232] PGD 195ece067 PUD 1ba005067 PMD 0
      [ 4593.956241] Oops: 0000 [#1] SMP
      [ 4593.956248] last sysfs file:
      [ 4593.956253] CPU 3
      [ 4593.956380] Pid: 29512, comm: kvm Not tainted 2.6.34-rc7-net #195 P6T DELUXE/System Product Name
      [ 4593.956384] RIP: 0010:[<ffffffffa03357a4>]  [<ffffffffa03357a4>] br_nf_forward_finish+0x154/0x170 [bridge]
      [ 4593.956395] RSP: 0018:ffff880001e63b78  EFLAGS: 00010246
      [ 4593.956399] RAX: 0000000000000608 RBX: ffff880057181700 RCX: ffff8801b813d000
      [ 4593.956402] RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff880057181700
      [ 4593.956406] RBP: ffff880001e63ba8 R08: ffff8801b9d97000 R09: ffffffffa0335650
      [ 4593.956410] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801b813d000
      [ 4593.956413] R13: ffffffff81ab3940 R14: ffff880057181700 R15: 0000000000000002
      [ 4593.956418] FS:  00007fc40d380710(0000) GS:ffff880001e60000(0000) knlGS:0000000000000000
      [ 4593.956422] CS:  0010 DS: 002b ES: 002b CR0: 000000008005003b
      [ 4593.956426] CR2: 0000000000000018 CR3: 00000001ba1d7000 CR4: 00000000000026e0
      [ 4593.956429] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 4593.956433] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [ 4593.956437] Process kvm (pid: 29512, threadinfo ffff8801ba566000, task ffff8801b8003870)
      [ 4593.956441] Stack:
      [ 4593.956443]  0000000100000020 ffff880001e63ba0 ffff880001e63ba0 ffff880057181700
      [ 4593.956451] <0> ffffffffa0335650 ffffffff81ab3940 ffff880001e63bd8 ffffffffa03350e6
      [ 4593.956462] <0> ffff880001e63c40 000000000000024d ffff880057181700 0000000080000000
      [ 4593.956474] Call Trace:
      [ 4593.956478]  <IRQ>
      [ 4593.956488]  [<ffffffffa0335650>] ? br_nf_forward_finish+0x0/0x170 [bridge]
      [ 4593.956496]  [<ffffffffa03350e6>] NF_HOOK_THRESH+0x56/0x60 [bridge]
      [ 4593.956504]  [<ffffffffa0335282>] br_nf_forward_arp+0x112/0x120 [bridge]
      [ 4593.956511]  [<ffffffff813f7184>] nf_iterate+0x64/0xa0
      [ 4593.956519]  [<ffffffffa032f920>] ? br_forward_finish+0x0/0x60 [bridge]
      [ 4593.956524]  [<ffffffff813f722c>] nf_hook_slow+0x6c/0x100
      [ 4593.956531]  [<ffffffffa032f920>] ? br_forward_finish+0x0/0x60 [bridge]
      [ 4593.956538]  [<ffffffffa032f800>] ? __br_forward+0x0/0xc0 [bridge]
      [ 4593.956545]  [<ffffffffa032f86d>] __br_forward+0x6d/0xc0 [bridge]
      [ 4593.956550]  [<ffffffff813c5d8e>] ? skb_clone+0x3e/0x70
      [ 4593.956557]  [<ffffffffa032f462>] deliver_clone+0x32/0x60 [bridge]
      [ 4593.956564]  [<ffffffffa032f6b6>] br_flood+0xa6/0xe0 [bridge]
      [ 4593.956571]  [<ffffffffa032f800>] ? __br_forward+0x0/0xc0 [bridge]
      Don't call nf_bridge_update_protocol() for ARP traffic as skb->nf_bridge isn't
      used in the ARP case.
      Reported-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarBart De Schuymer <bdschuym@pandora.be>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
  17. 20 Apr, 2010 1 commit
  18. 15 Apr, 2010 2 commits
    • Bart De Schuymer's avatar
      netfilter: bridge-netfilter: Fix MAC header handling with IP DNAT · e179e632
      Bart De Schuymer authored
      - fix IP DNAT on vlan- or pppoe-encapsulated traffic: The functions
      neigh_hh_output() or dst->neighbour->output() overwrite the complete
      Ethernet header, although we only need the destination MAC address.
      For encapsulated packets, they ended up overwriting the encapsulating
      header. The new code copies the Ethernet source MAC address and
      protocol number before calling dst->neighbour->output(). The Ethernet
      source MAC and protocol number are copied back in place in
      br_nf_pre_routing_finish_bridge_slow(). This also makes the IP DNAT
      more transparent because in the old scheme the source MAC of the
      bridge was copied into the source address in the Ethernet header. We
      also let skb->protocol equal ETH_P_IP resp. ETH_P_IPV6 during the
      execution of the PF_INET resp. PF_INET6 hooks.
      - Speed up IP DNAT by calling neigh_hh_bridge() instead of
      neigh_hh_output(): if dst->hh is available, we already know the MAC
      address so we can just copy it.
      Signed-off-by: default avatarBart De Schuymer <bdschuym@pandora.be>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
    • Bart De Schuymer's avatar
      netfilter: bridge-netfilter: simplify IP DNAT · ea2d9b41
      Bart De Schuymer authored
      Remove br_netfilter.c::br_nf_local_out(). The function
      br_nf_local_out() was needed because the PF_BRIDGE::LOCAL_OUT hook
      could be called when IP DNAT happens on to-be-bridged traffic. The
      new scheme eliminates this mess.
      Signed-off-by: default avatarBart De Schuymer <bdschuym@pandora.be>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
  19. 13 Apr, 2010 1 commit
  20. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      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.
      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
      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
      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
      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: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  21. 25 Mar, 2010 1 commit
    • Jan Engelhardt's avatar
      netfilter: bridge: use NFPROTO values for NF_HOOK invocation · 713aefa3
      Jan Engelhardt authored
      The first argument to NF_HOOK* is an nfproto since quite some time.
      Commit v2.6.27-2457-gfdc9314c
       was the first to practically start using
      the new names. Do that now for the remaining NF_HOOK calls.
      The semantic patch used was:
      // <smpl>
      // </smpl>
      Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
  22. 12 Nov, 2009 1 commit
    • Eric W. Biederman's avatar
      sysctl net: Remove unused binary sysctl code · f8572d8f
      Eric W. Biederman authored
      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
      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: default avatarEric W. Biederman <ebiederm@xmission.com>
  23. 24 Sep, 2009 1 commit
  24. 24 Aug, 2009 1 commit
  25. 06 Jul, 2009 1 commit
  26. 03 Jun, 2009 2 commits
  27. 20 Apr, 2009 1 commit
  28. 01 Feb, 2009 1 commit
  29. 13 Jan, 2009 2 commits
  30. 25 Nov, 2008 1 commit
  31. 04 Nov, 2008 2 commits
  32. 20 Oct, 2008 1 commit
  33. 08 Oct, 2008 1 commit
  34. 05 Aug, 2008 1 commit
  35. 30 Jul, 2008 1 commit
    • Simon Wunderlich's avatar
      bridge: send correct MTU value in PMTU (revised) · 4adf0af6
      Simon Wunderlich authored
      When bridging interfaces with different MTUs, the bridge correctly chooses
      the minimum of the MTUs of the physical devices as the bridges MTU.  But
      when a frame is passed which fits through the incoming, but not through
      the outgoing interface, a "Fragmentation Needed" packet is generated.
      However, the propagated MTU is hardcoded to 1500, which is wrong in this
      situation.  The sender will repeat the packet again with the same frame
      size, and the same problem will occur again.
      Instead of sending 1500, the (correct) MTU value of the bridge is now sent
      via PMTU.  To achieve this, the corresponding rtable structure is stored
      in its net_bridge structure.
      Modified to get rid of fake_net_device as well.
      Signed-off-by: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
      Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>