1. 31 1月, 2011 2 次提交
  2. 16 1月, 2011 1 次提交
    • S
      batman-adv: Use "__attribute__" shortcut macros · aa0adb1a
      Sven Eckelmann 提交于
      Linux 2.6.21 defines different macros for __attribute__ which are also
      used inside batman-adv. The next version of checkpatch.pl warns about
      the usage of __attribute__((packed))).
      
      Linux 2.6.33 defines an extra macro __always_unused which is used to
      assist source code analyzers and can be used to removed the last
      existing __attribute__ inside the source code.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      aa0adb1a
  3. 17 12月, 2010 1 次提交
  4. 30 11月, 2010 5 次提交
    • S
      Staging: batman-adv: Use kernel functions to identify broadcasts · 951c44e0
      Sven Eckelmann 提交于
      linux/etherdevice.h already provides functions to classify different
      ethernet addresses. These inlineable functions should be used instead of
      custom functions.
      
      The check for multicast together with multicast can also be replaced
      with a single test for multicast because for every ethernet address x
      following is always true:
      
      is_broadcast_ether_addr(x) => is_multicast_ether_addr(x)
      
      or when looking more at the implementation:
      
      (FF:FF:FF:FF:FF:FF == x) => [(01:00:00:00:00:00 & x) != 00:00:00:00:00:00]
      Reported-by: NTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      951c44e0
    • S
      Staging: batman-adv: Remove hashdata_choose_cb from hash · 6d5e6542
      Sven Eckelmann 提交于
      Function pointers cannot be inlined by a compiler and thus always has
      the overhead of an call. hashdata_choose_cb's are one of the most often
      called function pointers and its overhead must kept relative low.
      
      As first step, every function which uses this function pointer takes it
      as parameter instead of storing it inside the hash abstraction
      structure.
      
      This not generate any performance gain right now. The called functions
      must also be able to be inlined by the calling functions to enable
      inlining of the function pointer.
      Reported-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6d5e6542
    • S
      Staging: batman-adv: Remove hashdata_compare_cb from hash · 51f3d8a2
      Sven Eckelmann 提交于
      Function pointers cannot be inlined by a compiler and thus always has
      the overhead of an call. hashdata_compare_cb's are one of the most often
      called function pointers and its overhead must kept relative low.
      
      As first step, every function which uses this function pointer takes it
      as parameter instead of storing it inside the hash abstraction
      structure.
      
      This not generate any performance gain right now. The called functions
      must also be able to be inlined by the calling functions to enable
      inlining of the function pointer.
      Reported-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      51f3d8a2
    • L
      Staging: batman-adv: Make hop_penalty configurable via sysfs · 1341a00a
      Linus Lüssing 提交于
      When having a mixed topology of both very mobile and rather static
      nodes, you are usually best advised to set the originator interval on
      all nodes to a level best suited for the most mobile node.
      
      However, if most of the nodes are rather static, this can create a lot
      of undesired overhead as a trade-off then. If setting the interval too
      low on the static nodes, a mobile node might be chosen as a router for
      too long, not switching away from it fast enough because of its
      mobility and the low frequency of ogms of static nodes.
      
      Exposing the hop_penalty is especially useful for the stated scenario: A
      static node can keep the default originator interval, a mobile node can
      select a quicker one resulting in faster route updates towards this
      mobile node. Additionally, such a mobile node could select a higher hop
      penalty (or even set it to 255 to disable acting as a router for other
      nodes) to make it less desirable, letting other nodes avoid selecting
      this mobile node as a router.
      Signed-off-by: NLinus Lüssing <linus.luessing@ascom.ch>
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1341a00a
    • M
      Staging: batman-adv: softif bridge loop avoidance · 42019357
      Marek Lindner 提交于
      By connecting multiple batman-adv mesh nodes to the same ethernet
      segment a loop can be created when the soft-interface is bridged
      into that ethernet segment. A simple visualization of the loop
      involving the most common case - a LAN as ethernet segment:
      
      node1  <-- LAN  -->  node2
         |                   |
       wifi  <-- mesh -->  wifi
      
      Packets from the LAN (e.g. ARP broadcasts) will circle forever from
      node1 or node2 over the mesh back into the LAN.
      
      This patch adds the functionality to detect other batman-adv nodes
      connected to the LAN and select a 'gateway' to talk to the
      non-batman-adv devices on this LAN. All traffic from and to the mesh
      will be handled by this gateway to avoid the loop. OGMs received via
      the soft-interface are interpreted as 'port announcements' to locate
      potential batman-adv nodes. The patch can also deal with vlans on
      top of batX and offers a list of LAN neighbors via debugfs.
      Signed-off-by: NMarek Lindner <lindner_marek@yahoo.de>
      [sven.eckelmann@gmx.de: Rework on top of current version]
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      42019357
  5. 11 11月, 2010 1 次提交
  6. 10 11月, 2010 1 次提交
  7. 21 10月, 2010 1 次提交
  8. 05 9月, 2010 4 次提交
  9. 09 7月, 2010 6 次提交
  10. 23 6月, 2010 4 次提交
  11. 19 6月, 2010 1 次提交
  12. 12 5月, 2010 12 次提交
  13. 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