Commit Graph

14 Commits (c97415a72521071c235e0879f9a600014afd87b1)

Author SHA1 Message Date
Sven Eckelmann 1ee600ced3 Staging: batman-adv: Add hash recommendations to TODO
David Miller <davem@davemloft.net> recommended in
20100924.134334.28812338.davem@davemloft.net that we must make the hash
abstraction helper more efficient and may remove it completely.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-19 10:04:15 -07:00
Sven Eckelmann 399fb5b445 Staging: batman-adv: count batman_if list queries as reference
The return of get_batman_if_by_netdev and get_active_batman_if leaks a
pointer from the rcu protected list of interfaces. We must protect it to
prevent a too early release of the memory. Those functions must increase
the reference counter before rcu_read_unlock or it may be to late to
prevent a free.

hardif_add_interface must also increase the reference count for the
returned batman_if to make the behaviour consistent.

Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:50 -07:00
Sven Eckelmann 16f9530e99 Staging: batman-adv: Use synchronize_rcu instead of call_rcu
It is recommended [1] to use synchronize_rcu to simplify the code -
especially when otherwise extra locking is needed to protect other code
from picking stale elements. It also protects us for emitting to many
callbacks which may results in OOM conditions.

The only reason not to use it, would be in performance critical sections
or when we are not allowed to block.

[1] Documentation/RCU/checklist.txt

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:49 -07:00
Sven Eckelmann 93b3d9d578 Staging: batman-adv: Move mailing list address to .org
The official mailing list is run on lists.open-mesh.org and it should be
avoided to sent them to lists.open-mesh.net to reduce the number of
receipents and double posts.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20 16:29:48 -07:00
Sven Eckelmann 368b4f06c8 Staging: batman-adv: Add rcu TODO
Paul E. McKenney informed us that rcu is misused by leaking pointers to
rcu related elements outside read-side protected critical sections.

He also recommended that it should be checked against the rcu checklist.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-14 16:38:32 -07:00
Sven Eckelmann b411d498ee Staging: batman-adv: Prepare vis packets directly inside a skb
The vis information structure is used in a way that it can be transfered
directly as packet. It still had to be copied into a skb because of an
extra buffer used for the actual preparation of the data. This is
unnecessary and can be replaced by a simple clone instead of an full
copy before each send.

This makes also the send_raw_packet function obsolete.

Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-05 00:29:47 -07:00
Sven Eckelmann 8bb22a38d6 Staging: batman-adv: Calculate hamming weight using optimized kernel functions
The Kernighan algorithm is not able to calculate the number of set bits
in parallel and the compiler cannot replace it with optimized
instructions.

The kernel provides specialised functions for each cpu which can either
use a software implementation or hardware instruction depending on the
target cpu.

Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-05 00:29:43 -07:00
Sven Eckelmann 4cae2597f5 Staging: batman-adv: Update TODO with new points from review
David S. Miller provided some new ideas and found problems in his review
20100719.212625.255369607.davem@davemloft.net. These issues must be
resolved before it can be merged into net.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 14:29:33 -07:00
Andrew Lunn cee42f4993 Staging: batman-adv: Update TODO file to reflect current state.
Not much left to do on the TODO list :-)

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 13:42:40 -07:00
Simon Wunderlich abad544658 Staging: batman-adv: Remove compat.h
Since we are now part of mainline, we don't need compat.h to allow
building of the module with old versions of the kernel.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:36 -08:00
Andrew Lunn b9b27e4ef6 Staging: batman-adv: Use printk(%pM) for MAC addresses
printk() since kernel version 2.6.29 has supported printing MAC
addresses directly, as an extension to the %p processing. This patch
makes use of this for printk() and bat_dbg(). This will remove the
overhead of using addr_to_string() which is normally never actually
output.

Fixed a typo found by Gus Wirth.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:36 -08:00
Andrew Lunn b801fede6b Staging: batman-adv: moving vis output formats out of the kernel
The batman-adv kernel module is able to output visualization data using the
dot draw or JSON format. This patch transforms the output into a generic
format (called vis raw). User space tool may convert the raw data to support
a variety of formats without the need of modifying the kernel module.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:35 -08:00
Andrew Lunn 4ce21a7faf Staging: batman-adv: Replace KERN_DEBUG with bat_dbg
Ameya Palande requested we replace printk(KERN_DEBUG "") by pr_debug()
I decided it was better to use our debug macro.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:34 -08:00
Andrew Lunn 5beef3c9bf staging: batman-adv meshing protocol
B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is
a routing protocol for multi-hop ad-hoc mesh networks. The
networks may be wired or wireless. See
http://www.open-mesh.org/ for more information and user space
tools.

This is the first submission for inclusion in staging.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00