1. 26 1月, 2017 1 次提交
  2. 09 11月, 2016 6 次提交
  3. 04 11月, 2016 1 次提交
  4. 30 10月, 2016 1 次提交
    • L
      batman-adv: Simple (re)broadcast avoidance · 3111beed
      Linus Lüssing 提交于
      With this patch, (re)broadcasting on a specific interfaces is avoided:
      
      * No neighbor: There is no need to broadcast on an interface if there
        is no node behind it.
      
      * Single neighbor is source: If there is just one neighbor on an
        interface and if this neighbor is the one we actually got this
        broadcast packet from, then we do not need to echo it back.
      
      * Single neighbor is originator: If there is just one neighbor on
        an interface and if this neighbor is the originator of this
        broadcast packet, then we do not need to echo it back.
      
      Goodies for BATMAN V:
      
      ("Upgrade your BATMAN IV network to V now to get these for free!")
      
      Thanks to the split of OGMv1 into two packet types, OGMv2 and ELP
      that is, we can now apply the same optimizations stated above to OGMv2
      packets, too.
      
      Furthermore, with BATMAN V, rebroadcasts can be reduced in certain
      multi interface cases, too, where BATMAN IV cannot. This is thanks to
      the removal of the "secondary interface originator" concept in BATMAN V.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      3111beed
  5. 21 10月, 2016 1 次提交
    • L
      batman-adv: fix splat on disabling an interface · 9799c503
      Linus Lüssing 提交于
      As long as there is still a reference for a hard interface held, there might
      still be a forwarding packet relying on its attributes.
      
      Therefore avoid setting hard_iface->soft_iface to NULL when disabling a hard
      interface.
      
      This fixes the following, potential splat:
      
          batman_adv: bat0: Interface deactivated: eth1
          batman_adv: bat0: Removing interface: eth1
          cgroup: new mount options do not match the existing superblock, will be ignored
          batman_adv: bat0: Interface deactivated: eth3
          batman_adv: bat0: Removing interface: eth3
          ------------[ cut here ]------------
          WARNING: CPU: 3 PID: 1986 at ./net/batman-adv/bat_iv_ogm.c:549 batadv_iv_send_outstanding_bat_ogm_packet+0x145/0x643 [batman_adv]
          Modules linked in: batman_adv(O-) <...>
          CPU: 3 PID: 1986 Comm: kworker/u8:2 Tainted: G        W  O    4.6.0-rc6+ #1
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
          Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet [batman_adv]
           0000000000000000 ffff88001d93bca0 ffffffff8126c26b 0000000000000000
           0000000000000000 ffff88001d93bcf0 ffffffff81051615 ffff88001f19f818
           000002251d93bd68 0000000000000046 ffff88001dc04a00 ffff88001becbe48
          Call Trace:
           [<ffffffff8126c26b>] dump_stack+0x67/0x90
           [<ffffffff81051615>] __warn+0xc7/0xe5
           [<ffffffff8105164b>] warn_slowpath_null+0x18/0x1a
           [<ffffffffa0356f24>] batadv_iv_send_outstanding_bat_ogm_packet+0x145/0x643 [batman_adv]
           [<ffffffff8108b01f>] ? __lock_is_held+0x32/0x54
           [<ffffffff810689a2>] process_one_work+0x2a8/0x4f5
           [<ffffffff81068856>] ? process_one_work+0x15c/0x4f5
           [<ffffffff81068df2>] worker_thread+0x1d5/0x2c0
           [<ffffffff81068c1d>] ? process_scheduled_works+0x2e/0x2e
           [<ffffffff81068c1d>] ? process_scheduled_works+0x2e/0x2e
           [<ffffffff8106dd90>] kthread+0xc0/0xc8
           [<ffffffff8144de82>] ret_from_fork+0x22/0x40
           [<ffffffff8106dcd0>] ? __init_kthread_worker+0x55/0x55
          ---[ end trace 647f9f325123dc05 ]---
      
      What happened here is, that there was still a forw_packet (here: a BATMAN IV
      OGM) in the queue of eth3 with the forw_packet->if_incoming set to eth1 and the
      forw_packet->if_outgoing set to eth3.
      
      When eth3 is to be deactivated and removed, then this thread waits for the
      forw_packet queued on eth3 to finish. Because eth1 was deactivated and removed
      earlier and by that had forw_packet->if_incoming->soft_iface, set to NULL, the
      splat when trying to send/flush the OGM on eth3 occures.
      
      Fixes: c6c8fea2 ("net: Add batman-adv meshing protocol")
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      [sven@narfation.org: Reduced size of Oops message]
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      9799c503
  6. 09 8月, 2016 4 次提交
  7. 04 7月, 2016 1 次提交
  8. 30 6月, 2016 5 次提交
  9. 10 5月, 2016 4 次提交
  10. 29 4月, 2016 1 次提交
    • A
      batman-adv: B.A.T.M.A.N V - make sure iface is reactivated upon NETDEV_UP event · b6cf5d49
      Antonio Quartulli 提交于
      At the moment there is no explicit reactivation of an hard-interface
      upon NETDEV_UP event. In case of B.A.T.M.A.N. IV the interface is
      reactivated as soon as the next OGM is scheduled for sending, but this
      mechanism does not work with B.A.T.M.A.N. V. The latter does not rely
      on the same scheduling mechanism as its predecessor and for this reason
      the hard-interface remains deactivated forever after being brought down
      once.
      
      This patch fixes the reactivation mechanism by adding a new routing API
      which explicitly allows each algorithm to perform any needed operation
      upon interface re-activation.
      
      Such API is optional and is implemented by B.A.T.M.A.N. V only and it
      just takes care of setting the iface status to ACTIVE
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      b6cf5d49
  11. 24 4月, 2016 1 次提交
  12. 23 2月, 2016 1 次提交
  13. 16 2月, 2016 1 次提交
    • A
      batman-adv: Avoid endless loop in bat-on-bat netdevice check · 1bc4e2b0
      Andrew Lunn 提交于
      batman-adv checks in different situation if a new device is already on top
      of a different batman-adv device. This is done by getting the iflink of a
      device and all its parent. It assumes that this iflink is always a parent
      device in an acyclic graph. But this assumption is broken by devices like
      veth which are actually a pair of two devices linked to each other. The
      recursive check would therefore get veth0 when calling dev_get_iflink on
      veth1. And it gets veth0 when calling dev_get_iflink with veth1.
      
      Creating a veth pair and loading batman-adv freezes parts of the system
      
          ip link add veth0 type veth peer name veth1
          modprobe batman-adv
      
      An RCU stall will be detected on the system which cannot be fixed.
      
          INFO: rcu_sched self-detected stall on CPU
                  1: (5264 ticks this GP) idle=3e9/140000000000001/0
          softirq=144683/144686 fqs=5249
                   (t=5250 jiffies g=46 c=45 q=43)
          Task dump for CPU 1:
          insmod          R  running task        0   247    245 0x00000008
           ffffffff8151f140 ffffffff8107888e ffff88000fd141c0 ffffffff8151f140
           0000000000000000 ffffffff81552df0 ffffffff8107b420 0000000000000001
           ffff88000e3fa700 ffffffff81540b00 ffffffff8107d667 0000000000000001
          Call Trace:
           <IRQ>  [<ffffffff8107888e>] ? rcu_dump_cpu_stacks+0x7e/0xd0
           [<ffffffff8107b420>] ? rcu_check_callbacks+0x3f0/0x6b0
           [<ffffffff8107d667>] ? hrtimer_run_queues+0x47/0x180
           [<ffffffff8107cf9d>] ? update_process_times+0x2d/0x50
           [<ffffffff810873fb>] ? tick_handle_periodic+0x1b/0x60
           [<ffffffff810290ae>] ? smp_trace_apic_timer_interrupt+0x5e/0x90
           [<ffffffff813bbae2>] ? apic_timer_interrupt+0x82/0x90
           <EOI>  [<ffffffff812c3fd7>] ? __dev_get_by_index+0x37/0x40
           [<ffffffffa0031f3e>] ? batadv_hard_if_event+0xee/0x3a0 [batman_adv]
           [<ffffffff812c5801>] ? register_netdevice_notifier+0x81/0x1a0
          [...]
      
      This can be avoided by checking if two devices are each others parent and
      stopping the check in this situation.
      
      Fixes: b7eddd0b ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface")
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      [sven@narfation.org: rewritten description, extracted fix]
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      1bc4e2b0
  14. 10 2月, 2016 2 次提交
  15. 02 2月, 2016 2 次提交
  16. 16 12月, 2015 1 次提交
  17. 06 12月, 2015 1 次提交
  18. 04 12月, 2015 2 次提交
  19. 28 8月, 2015 2 次提交
  20. 07 6月, 2015 1 次提交
    • S
      batman-adv: Add required includes to all files · 1e2c2a4f
      Sven Eckelmann 提交于
      The header files could not be build indepdent from each other. This is
      happened because headers didn't include the files for things they've used.
      This was problematic because the success of a build depended on the
      knowledge about the right order of local includes.
      
      Also source files were not including everything they've used explicitly.
      Instead they required that transitive includes are always stable. This is
      problematic because some transitive includes are not obvious, depend on
      config settings and may not be stable in the future.
      
      The order for include blocks are:
      
       * primary headers (main.h and the *.h file of a *.c file)
       * global linux headers
       * required local headers
       * extra forward declarations for pointers in function/struct declarations
      
      The only exceptions are linux/bitops.h and linux/if_ether.h in packet.h.
      This header file is shared with userspace applications like batctl and must
      therefore build together with userspace applications. The header
      linux/bitops.h is not part of the uapi headers and linux/if_ether.h
      conflicts with the musl implementation of netinet/if_ether.h. The
      maintainers rejected the use of __KERNEL__ preprocessor checks and thus
      these two headers are only in main.h. All files using packet.h first have
      to include main.h to work correctly.
      Reported-by: NMarkus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      1e2c2a4f
  21. 29 5月, 2015 1 次提交