19 Aug, 2020

1 commit

  • The function batadv_hardif_remove_interfaces was meant to remove all
    interfaces which are currently in the list of known (compatible) hardifs
    during module unload. But the function unregister_netdevice_notifier is
    called in batadv_exit before batadv_hardif_remove_interfaces. This will
    trigger NETDEV_UNREGISTER events for all available interfaces and in this
    process remove all interfaces from batadv_hardif_list. And
    batadv_hardif_remove_interfaces only operated on this (empty) list.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     

01 Jan, 2020

1 commit


25 May, 2019

1 commit

  • While it can be slightly beneficial for the build performance to use
    forward declarations instead of includes, the handling of them together
    with changes in the included headers makes it unnecessary complicated and
    fragile. Just replace them with actual includes since some parts (hwmon,
    ..) of the kernel even request avoidance of forward declarations and net/
    is mostly not using them in *.c file.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     

25 Mar, 2019

1 commit

  • All files got a SPDX-License-Identifier with commit 7db7d9f369a4
    ("batman-adv: Add SPDX license identifier above copyright header"). All the
    required information about the license conditions can be found in
    LICENSES/.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     

04 Jan, 2019

1 commit


27 Feb, 2018

1 commit


16 Dec, 2017

5 commits

  • Externally visible functions should be documented with kernel-doc. This
    usually refers to non-static functions but also static inline files in
    headers are visible in other files and should therefore be documented.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     
  • All enums in types.h are already documented. But some other headers
    still have private enums which also should be documented.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     
  • The inline kernel-doc comments make it easier to keep changes to the
    struct/enum synchronized with the documentation of the it. And it makes it
    easier for larger structures like struct batadv_priv to read the
    documentation inside the code.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     
  • The documentation describing kernel-doc comments for functions ("How to
    format kernel-doc comments") uses parentheses at the end of the function
    name. Using this format allows to use a consistent style when adding
    documentation to a function and when referencing this function in a
    different kernel-doc section.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     
  • The "Linux kernel licensing rules" require that each file has a SPDX
    license identifier as first line (and sometimes as second line).

    The FSFE REUSE practices [1] would also require the same tags but have no
    restrictions on the placement in the source file. Using the "Linux kernel
    licensing rules" is therefore also fulfilling the FSFE REUSE practices
    requirements at the same time.

    [1] https://reuse.software/practices/

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     

26 Jan, 2017

1 commit


09 Nov, 2016

3 commits

  • Signed-off-by: Marek Lindner
    [sven.eckelmann@open-mesh.com: re-add batadv_get_real_netdev to take rtnl
    semaphore for batadv_get_real_netdevice]
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Marek Lindner
     
  • batman-adv is requiring the type of wifi device in different contexts. Some
    of them can take the rtnl semaphore and some of them already have the
    semaphore taken. But even others don't allow that the semaphore will be
    taken.

    The data has to be retrieved when the hardif is added to batman-adv because
    some of the wifi information for an hardif will only be available with rtnl
    lock. It can then be cached in the batadv_hard_iface and the functions
    is_wifi_netdev and is_cfg80211_netdev can just compare the correct bits
    without imposing extra locking requirements.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Sven Eckelmann
     
  • The ELP protocol requires cfg80211 to auto-detect the WiFi througput
    to a given neighbor. Use batadv_is_cfg80211_netdev() to determine
    whether or not an interface is eligible.

    Signed-off-by: Marek Lindner
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Marek Lindner
     

30 Oct, 2016

1 commit

  • 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: Linus Lüssing
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Simon Wunderlich

    Linus Lüssing
     

10 May, 2016

1 commit

  • When creating a soft interface, create it in the same netns as the
    hard interface. Replace all references to init_net with the correct
    name space for the interface being manipulated.

    Suggested-by: Daniel Ehlers
    Signed-off-by: Andrew Lunn
    Acked-by: Antonio Quartulli
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Andrew Lunn
     

23 Feb, 2016

1 commit


10 Feb, 2016

2 commits


02 Feb, 2016

1 commit


16 Jan, 2016

1 commit

  • It is not allowed to free the memory of an object which is part of a list
    which is protected by rcu-read-side-critical sections without making sure
    that no other context is accessing the object anymore. This usually happens
    by removing the references to this object and then waiting until the rcu
    grace period is over and no one (allowedly) accesses it anymore.

    But the _now functions ignore this completely. They free the object
    directly even when a different context still tries to access it. This has
    to be avoided and thus these functions must be removed and all functions
    have to use batadv_hardif_free_ref.

    Fixes: 89652331c00f ("batman-adv: split tq information in neigh_node struct")
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     

07 Jun, 2015

1 commit

  • 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: Markus Pargmann
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner

    Sven Eckelmann
     

29 May, 2015

1 commit


12 Jan, 2014

3 commits

  • Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • If the same interface is used for sending and receiving, there might be
    throughput degradation on half-duplex interfaces such as WiFi. Add a
    penalty if the same interface is used to reflect this problem in the
    metric. At the same time, change the hop penalty from 30 to 15 so there
    will be no change for single wifi mesh network. the effective hop
    penalty will stay at 30 due to the new wifi penalty for these networks.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • For the network wide multi interface optimization it is required to save
    metrics per outgoing interface in one neighbor. Therefore a new type is
    introduced to keep interface-specific information. This also requires
    some changes in access and list management.

    The compare and equiv_or_better API calls are changed to take the
    outgoing interface into consideration.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     

09 Jan, 2014

1 commit


23 Oct, 2013

1 commit


27 Mar, 2013

1 commit

  • batman-adv has an unusual way to manage softinterfaces. These will be created
    automatically when a user writes to the batman-adv/mesh_iface file in sysfs and
    removed when no slave device exists anymore.

    This behaviour cannot be changed without breaking compatibility with existing
    code. Instead other interfaces should be able to slightly reduce this behaviour
    and provide a more common reaction to a removal of a slave interface.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Acked-by: Antonio Quartulli
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     

19 Jan, 2013

1 commit


02 Jul, 2012

2 commits


25 Jun, 2012

1 commit


21 Jun, 2012

2 commits


17 Feb, 2012

1 commit


22 Aug, 2011

1 commit


10 Jun, 2011

1 commit

  • CodingStyle "Chapter 12: Macros, Enums and RTL" recommends to use enums
    for several related constants. Internal states can be used without
    defining the actual value, but all values which are visible to the
    outside must be defined as before. Normal values are assigned as usual
    and flags are defined by shifts of a bit.

    Signed-off-by: Sven Eckelmann

    Sven Eckelmann
     

30 May, 2011

1 commit