1. 29 2月, 2016 5 次提交
    • A
      batman-adv: OGMv2 - add basic infrastructure · 0da00359
      Antonio Quartulli 提交于
      This is the initial implementation of the new OGM protocol
      (version 2). It has been designed to work on top of the
      newly added ELP.
      
      In the previous version the OGM protocol was used to both
      measure link qualities and flood the network with the metric
      information. In this version the protocol is in charge of
      the latter task only, leaving the former to ELP.
      
      This means being able to decouple the interval used by the
      neighbor discovery from the OGM broadcasting, which revealed
      to be costly in dense networks and needed to be relaxed so
      leading to a less responsive routing protocol.
      Signed-off-by: NAntonio Quartulli <antonio@open-mesh.com>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      0da00359
    • L
      batman-adv: ELP - adding sysfs parameter for elp interval · 7f136cd4
      Linus Luessing 提交于
      This parameter can be set individually on each interface and
      allows the configuration of the elp interval for the link
      quality measurements during runtime. Usually it is desirable
      to set it to a higher (= slower) value on interfaces which
      have a more static characteristic (e.g. wired interfaces)
      or very dense neighbourhoods to reduce overhead.
      
      Developed by Linus during a 6 months trainee study period in
      Ascom (Switzerland) AG.
      Signed-off-by: NLinus Luessing <linus.luessing@web.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      [antonio@open-mesh.com: respin on top of the latest master]
      Signed-off-by: NAntonio Quartulli <antonio@open-mesh.com>
      7f136cd4
    • L
      batman-adv: ELP - creating neighbor structures · 162bd64c
      Linus Luessing 提交于
      Initially developed by Linus during a 6 months trainee study
      period in Ascom (Switzerland) AG.
      Signed-off-by: NLinus Luessing <linus.luessing@web.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@open-mesh.com>
      162bd64c
    • L
      batman-adv: ELP - adding basic infrastructure · d6f94d91
      Linus Luessing 提交于
      The B.A.T.M.A.N. protocol originally only used a single
      message type (called OGM) to determine the link qualities to
      the direct neighbors and spreading these link quality
      information through the whole mesh. This procedure is
      summarized on the BATMAN concept page and explained in
      details in the RFC draft published in 2008.
      
      This approach was chosen for its simplicity during the
      protocol design phase and the implementation. However, it
      also bears some drawbacks:
      
       *  Wireless interfaces usually come with some packet loss,
          therefore a higher broadcast rate is desirable to allow
          a fast reaction on flaky connections.
          Other interfaces of the same host might be connected to
          Ethernet LANs / VPNs / etc which rarely exhibit packet
          loss would benefit from a lower broadcast rate to reduce
          overhead.
       *  It generally is more desirable to detect local link
          quality changes at a faster rate than propagating all
          these changes through the entire mesh (the far end of
          the mesh does not need to care about local link quality
          changes that much). Other optimizations strategies, like
          reducing overhead, might be possible if OGMs weren't
          used for all tasks in the mesh at the same time.
      
      As a result detecting local link qualities shall be handled
      by an independent message type, ELP, whereas the OGM message
      type remains responsible for flooding the mesh with these
      link quality information and determining the overall path
      transmit qualities.
      
      Developed by Linus during a 6 months trainee study period in
      Ascom (Switzerland) AG.
      Signed-off-by: NLinus Luessing <linus.luessing@web.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@open-mesh.com>
      d6f94d91
    • L
      batman-adv: Add hard_iface specific sysfs wrapper macros for UINT · 0744ff8f
      Linus Luessing 提交于
      This allows us to easily add a sysfs parameter for an
      unsigned int later, which is not for a batman mesh interface
      (e.g. bat0), but for a common interface instead. It allows
      reading and writing an atomic_t in hard_iface (instead of
      bat_priv compared to the mesh variant).
      
      Developed by Linus during a 6 months trainee study period in
      Ascom (Switzerland) AG.
      Signed-off-by: NLinus Luessing <linus.luessing@web.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      [antonio@open-mesh.com: rename functions and move macros]
      Signed-off-by: NAntonio Quartulli <antonio@open-mesh.com>
      0744ff8f
  2. 23 2月, 2016 20 次提交
  3. 16 2月, 2016 3 次提交
    • 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
    • S
      batman-adv: Only put orig_node_vlan list reference when removed · 3db15209
      Sven Eckelmann 提交于
      The batadv_orig_node_vlan reference counter in batadv_tt_global_size_mod
      can only be reduced when the list entry was actually removed. Otherwise the
      reference counter may reach zero when batadv_tt_global_size_mod is called
      from two different contexts for the same orig_node_vlan but only one
      context is actually removing the entry from the list.
      
      The release function for this orig_node_vlan is not called inside the
      vlan_list_lock spinlock protected region because the function
      batadv_tt_global_size_mod still holds a orig_node_vlan reference for the
      object pointer on the stack. Thus the actual release function (when
      required) will be called only at the end of the function.
      
      Fixes: 7ea7b4a1 ("batman-adv: make the TT CRC logic VLAN specific")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      3db15209
    • S
      batman-adv: Only put gw_node list reference when removed · c18bdd01
      Sven Eckelmann 提交于
      The batadv_gw_node reference counter in batadv_gw_node_update can only be
      reduced when the list entry was actually removed. Otherwise the reference
      counter may reach zero when batadv_gw_node_update is called from two
      different contexts for the same gw_node but only one context is actually
      removing the entry from the list.
      
      The release function for this gw_node is not called inside the list_lock
      spinlock protected region because the function batadv_gw_node_update still
      holds a gw_node reference for the object pointer on the stack. Thus the
      actual release function (when required) will be called only at the end of
      the function.
      
      Fixes: bd3524c1 ("batman-adv: remove obsolete deleted attribute for gateway node")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      c18bdd01
  4. 10 2月, 2016 12 次提交