<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/net/batman-adv/network-coding.c, branch v4.4.30</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v4.4.30</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v4.4.30'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2016-01-31T19:29:02+00:00</updated>
<entry>
<title>batman-adv: Avoid recursive call_rcu for batadv_nc_node</title>
<updated>2016-01-31T19:29:02+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2016-01-05T11:06:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=d3a4a363d8d3a6c8c9e7419e168b409ff3f31dd2'/>
<id>urn:sha1:d3a4a363d8d3a6c8c9e7419e168b409ff3f31dd2</id>
<content type='text'>
[ Upstream commit 44e8e7e91d6c7c7ab19688750f7257292640d1a0 ]

The batadv_nc_node_free_ref function uses call_rcu to delay the free of the
batadv_nc_node object until no (already started) rcu_read_lock is enabled
anymore. This makes sure that no context is still trying to access the
object which should be removed. But batadv_nc_node also contains a
reference to orig_node which must be removed.

The reference drop of orig_node was done in the call_rcu function
batadv_nc_node_free_rcu but should actually be done in the
batadv_nc_node_release function to avoid nested call_rcus. This is
important because rcu_barrier (e.g. batadv_softif_free or batadv_exit) will
not detect the inner call_rcu as relevant for its execution. Otherwise this
barrier will most likely be inserted in the queue before the callback of
the first call_rcu was executed. The caller of rcu_barrier will therefore
continue to run before the inner call_rcu callback finished.

Fixes: d56b1705e28c ("batman-adv: network coding - detect coding nodes and remove these after timeout")
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
Signed-off-by: Antonio Quartulli &lt;a@unstable.cc&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>batman-adv: Annotate deleting functions with external lock via lockdep</title>
<updated>2015-08-24T22:12:23+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-06-21T12:45:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2c72d655b04450056566bcbfe89c2427376b60b4'/>
<id>urn:sha1:2c72d655b04450056566bcbfe89c2427376b60b4</id>
<content type='text'>
Functions which use (h)list_del* are requiring correct locking when they
operate on global lists. Most of the time the search in the list and the
delete are done in the same function. All other cases should have it
visible that they require a special lock to avoid race conditions.

Lockdep asserts can be used to check these problem during runtime when the
lockdep functionality is enabled.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
Signed-off-by: Antonio Quartulli &lt;antonio@meshcoding.com&gt;
</content>
</entry>
<entry>
<title>batman-adv: Remove multiple assignment per line</title>
<updated>2015-08-24T22:12:18+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-06-09T18:50:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4f248cff9e21720bd5f057661f752fba067f3779'/>
<id>urn:sha1:4f248cff9e21720bd5f057661f752fba067f3779</id>
<content type='text'>
The Linux CodingStyle disallows multiple assignments in a single line.
(see chapter 1)

Reported-by: Markus Pargmann &lt;mpa@pengutronix.de&gt;
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
Signed-off-by: Antonio Quartulli &lt;antonio@meshcoding.com&gt;
</content>
</entry>
<entry>
<title>batman-adv: Fix kerneldoc over 80 column lines</title>
<updated>2015-08-24T22:12:18+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-05-31T08:10:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=34473822da06510d708087bb76d9ad757ac09567'/>
<id>urn:sha1:34473822da06510d708087bb76d9ad757ac09567</id>
<content type='text'>
Kerneldoc required single line documentation in the past (before 2009).
Therefore, the 80 columns limit per line check of checkpatch was disabled
for kerneldoc. But kerneldoc is not excluded anymore from it and checkpatch
now enabled the check again.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
Signed-off-by: Antonio Quartulli &lt;antonio@meshcoding.com&gt;
</content>
</entry>
<entry>
<title>batman-adv: Replace C99 int types with kernel type</title>
<updated>2015-08-24T22:12:17+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-05-26T16:34:26+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=6b5e971a282c0e7b18b47823103d695352b5a3c2'/>
<id>urn:sha1:6b5e971a282c0e7b18b47823103d695352b5a3c2</id>
<content type='text'>
(s|u)(8|16|32|64) are the preferred types in the kernel. The use of the
standard C99 types u?int(8|16|32|64)_t are objected by some people and even
checkpatch now warns about using them.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
Signed-off-by: Antonio Quartulli &lt;antonio@meshcoding.com&gt;
</content>
</entry>
<entry>
<title>batman-adv: Make NC capability changes atomic</title>
<updated>2015-08-14T20:50:43+00:00</updated>
<author>
<name>Linus Lüssing</name>
<email>linus.luessing@c0d3.blue</email>
</author>
<published>2015-06-16T15:10:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4635469f5c617282f18c69643af36cd8c0acf707'/>
<id>urn:sha1:4635469f5c617282f18c69643af36cd8c0acf707</id>
<content type='text'>
Bitwise OR/AND assignments in C aren't guaranteed to be atomic. One
OGM handler might undo the set/clear of a specific bit from another
handler run in between.

Fix this by using the atomic set_bit()/clear_bit()/test_bit() functions.

Fixes: 3f4841ffb336 ("batman-adv: tvlv - add network coding container")
Signed-off-by: Linus Lüssing &lt;linus.luessing@c0d3.blue&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
Signed-off-by: Antonio Quartulli &lt;antonio@meshcoding.com&gt;
</content>
</entry>
<entry>
<title>batman-adv: Add required includes to all files</title>
<updated>2015-06-07T15:07:19+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-04-17T17:40:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1e2c2a4fe4a52cc55a78727778119f9a74283b8a'/>
<id>urn:sha1:1e2c2a4fe4a52cc55a78727778119f9a74283b8a</id>
<content type='text'>
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 &lt;mpa@pengutronix.de&gt;
Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
</content>
</entry>
<entry>
<title>batman-adv: Use common Jenkins Hash implementation</title>
<updated>2015-06-07T15:07:17+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-03-01T08:46:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=36fd61cb80fcf07c20230face1a0f6e1505c8322'/>
<id>urn:sha1:36fd61cb80fcf07c20230face1a0f6e1505c8322</id>
<content type='text'>
An unoptimized version of the Jenkins one-at-a-time hash function is used
and partially copied all over the code wherever an hashtable is used.
Instead the optimized version shared between the whole kernel should be
used to reduce code duplication and use better optimized code.

Only the DAT code must use the old implementation because it is used as
distributed hash function which has to be common for all nodes.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
</content>
</entry>
<entry>
<title>batman-adv: checkpatch - spaces preferred around that '*'</title>
<updated>2015-05-29T08:13:37+00:00</updated>
<author>
<name>Marek Lindner</name>
<email>mareklindner@neomailbox.ch</email>
</author>
<published>2015-02-18T14:19:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=fc1f86936651191ca51e532083206efb351ccd9c'/>
<id>urn:sha1:fc1f86936651191ca51e532083206efb351ccd9c</id>
<content type='text'>
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
</content>
</entry>
<entry>
<title>batman-adv: Use safer default config for optional features</title>
<updated>2015-05-29T08:13:36+00:00</updated>
<author>
<name>Sven Eckelmann</name>
<email>sven@narfation.org</email>
</author>
<published>2015-02-18T17:20:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=dab7b62190c5abbe90eef4e9f9e7c28492e77eba'/>
<id>urn:sha1:dab7b62190c5abbe90eef4e9f9e7c28492e77eba</id>
<content type='text'>
The current default settings for optional features in batman-adv seems to
be based around the idea that the user only compiles what he requires. They
will automatically enabled when they are compiled in. For example the
network coding part of batman-adv is by default disabled in the out-of-tree
module but will be enabled when the code is compiled during the module
build.

But distributions like Debian just enable all features of the batman-adv
kernel module and hope that more experimental features or features with
possible negative effects have to be enabled using some runtime
configuration interface.

The network_coding feature can help in specific setups but also has
drawbacks and is not disabled by default in the out-of-tree module.
Disabling by default in the runtime config seems to be also quite sane.

The bridge_loop_avoidance is the only feature which is disabled by default
but may be necessary even in simple setups. Packet loops may even be
created during the initial node setup when this is not enabled. This is
different than STP on bridges because mesh is usually used on Adhoc WiFi.
Having two nodes (by accident) in the same LAN segment and in the same mesh
network is rather common in this situation.

Signed-off-by: Sven Eckelmann &lt;sven@narfation.org&gt;
Acked-by: Martin Hundebøll &lt;martin@hundeboll.net&gt;
Signed-off-by: Marek Lindner &lt;mareklindner@neomailbox.ch&gt;
</content>
</entry>
</feed>
