Skip to content

Commit ede1fd1

Browse files
committed
Merge tag 'batadv-next-for-davem-20190328' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This feature/cleanup patchset includes the following patches: - Drop license boilerplate (obsoleted by SPDX license IDs), by Sven Eckelmann - Drop documentation for sysfs and debugfs Documentation, by Sven Eckelmann (2 patches) - Mark sysfs as optional and deprecated, by Sven Eckelmann (3 patches) - Update MAINTAINERS Tree, Chat and Bugtracker, by Sven Eckelmann (3 patches) - Rename batadv_dat_send_data, by Sven Eckelmann - update DAT entries with incoming ARP replies, by Linus Luessing - add multicast-to-unicast support for limited destinations, by Linus Luessing ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 356d71e + 32e7274 commit ede1fd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+476
-939
lines changed

Documentation/ABI/testing/sysfs-class-net-batman-adv renamed to Documentation/ABI/obsolete/sysfs-class-net-batman-adv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This ABI is deprecated and will be removed after 2021. It is
2+
replaced with the batadv generic netlink family.
13

24
What: /sys/class/net/<iface>/batman-adv/elp_interval
35
Date: Feb 2014

Documentation/ABI/testing/sysfs-class-net-mesh renamed to Documentation/ABI/obsolete/sysfs-class-net-mesh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This ABI is deprecated and will be removed after 2021. It is
2+
replaced with the batadv generic netlink family.
13

24
What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
35
Date: May 2010

Documentation/networking/batman-adv.rst

Lines changed: 28 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -27,82 +27,55 @@ Load the batman-adv module into your kernel::
2727
$ insmod batman-adv.ko
2828

2929
The module is now waiting for activation. You must add some interfaces on which
30-
batman can operate. After loading the module batman advanced will scan your
31-
systems interfaces to search for compatible interfaces. Once found, it will
32-
create subfolders in the ``/sys`` directories of each supported interface,
33-
e.g.::
34-
35-
$ ls /sys/class/net/eth0/batman_adv/
36-
elp_interval iface_status mesh_iface throughput_override
37-
38-
If an interface does not have the ``batman_adv`` subfolder, it probably is not
39-
supported. Not supported interfaces are: loopback, non-ethernet and batman's
40-
own interfaces.
41-
42-
Note: After the module was loaded it will continuously watch for new
43-
interfaces to verify the compatibility. There is no need to reload the module
44-
if you plug your USB wifi adapter into your machine after batman advanced was
45-
initially loaded.
46-
47-
The batman-adv soft-interface can be created using the iproute2 tool ``ip``::
30+
batman-adv can operate. The batman-adv soft-interface can be created using the
31+
iproute2 tool ``ip``::
4832

4933
$ ip link add name bat0 type batadv
5034

5135
To activate a given interface simply attach it to the ``bat0`` interface::
5236

5337
$ ip link set dev eth0 master bat0
5438

55-
Repeat this step for all interfaces you wish to add. Now batman starts
39+
Repeat this step for all interfaces you wish to add. Now batman-adv starts
5640
using/broadcasting on this/these interface(s).
5741

58-
By reading the "iface_status" file you can check its status::
59-
60-
$ cat /sys/class/net/eth0/batman_adv/iface_status
61-
active
62-
6342
To deactivate an interface you have to detach it from the "bat0" interface::
6443

6544
$ ip link set dev eth0 nomaster
6645

46+
The same can also be done using the batctl interface subcommand::
6747

68-
All mesh wide settings can be found in batman's own interface folder::
48+
batctl -m bat0 interface create
49+
batctl -m bat0 interface add -M eth0
6950

70-
$ ls /sys/class/net/bat0/mesh/
71-
aggregated_ogms fragmentation isolation_mark routing_algo
72-
ap_isolation gw_bandwidth log_level vlan0
73-
bonding gw_mode multicast_mode
74-
bridge_loop_avoidance gw_sel_class network_coding
75-
distributed_arp_table hop_penalty orig_interval
51+
To detach eth0 and destroy bat0::
7652

77-
There is a special folder for debugging information::
53+
batctl -m bat0 interface del -M eth0
54+
batctl -m bat0 interface destroy
7855

79-
$ ls /sys/kernel/debug/batman_adv/bat0/
80-
bla_backbone_table log neighbors transtable_local
81-
bla_claim_table mcast_flags originators
82-
dat_cache nc socket
83-
gateways nc_nodes transtable_global
56+
There are additional settings for each batadv mesh interface, vlan and hardif
57+
which can be modified using batctl. Detailed information about this can be found
58+
in its manual.
8459

85-
Some of the files contain all sort of status information regarding the mesh
86-
network. For example, you can view the table of originators (mesh
87-
participants) with::
60+
For instance, you can check the current originator interval (value
61+
in milliseconds which determines how often batman-adv sends its broadcast
62+
packets)::
8863

89-
$ cat /sys/kernel/debug/batman_adv/bat0/originators
90-
91-
Other files allow to change batman's behaviour to better fit your requirements.
92-
For instance, you can check the current originator interval (value in
93-
milliseconds which determines how often batman sends its broadcast packets)::
94-
95-
$ cat /sys/class/net/bat0/mesh/orig_interval
64+
$ batctl -M bat0 orig_interval
9665
1000
9766

9867
and also change its value::
9968

100-
$ echo 3000 > /sys/class/net/bat0/mesh/orig_interval
69+
$ batctl -M bat0 orig_interval 3000
10170

10271
In very mobile scenarios, you might want to adjust the originator interval to a
10372
lower value. This will make the mesh more responsive to topology changes, but
10473
will also increase the overhead.
10574

75+
Information about the current state can be accessed via the batadv generic
76+
netlink family. batctl provides human readable version via its debug tables
77+
subcommands.
78+
10679

10780
Usage
10881
=====
@@ -147,43 +120,16 @@ batman-adv module. When building batman-adv as part of kernel, use "make
147120
menuconfig" and enable the option ``B.A.T.M.A.N. debugging``
148121
(``CONFIG_BATMAN_ADV_DEBUG=y``).
149122

150-
Those additional debug messages can be accessed using a special file in
151-
debugfs::
123+
Those additional debug messages can be accessed using the perf infrastructure::
152124

153-
$ cat /sys/kernel/debug/batman_adv/bat0/log
125+
$ trace-cmd stream -e batadv:batadv_dbg
154126

155127
The additional debug output is by default disabled. It can be enabled during
156-
run time. Following log_levels are defined:
157-
158-
.. flat-table::
159-
160-
* - 0
161-
- All debug output disabled
162-
* - 1
163-
- Enable messages related to routing / flooding / broadcasting
164-
* - 2
165-
- Enable messages related to route added / changed / deleted
166-
* - 4
167-
- Enable messages related to translation table operations
168-
* - 8
169-
- Enable messages related to bridge loop avoidance
170-
* - 16
171-
- Enable messages related to DAT, ARP snooping and parsing
172-
* - 32
173-
- Enable messages related to network coding
174-
* - 64
175-
- Enable messages related to multicast
176-
* - 128
177-
- Enable messages related to throughput meter
178-
* - 255
179-
- Enable all messages
180-
181-
The debug output can be changed at runtime using the file
182-
``/sys/class/net/bat0/mesh/log_level``. e.g.::
183-
184-
$ echo 6 > /sys/class/net/bat0/mesh/log_level
185-
186-
will enable debug messages for when routes change.
128+
run time::
129+
130+
$ batctl -m bat0 loglevel routes tt
131+
132+
will enable debug messages for when routes and translation table entries change.
187133

188134
Counters for different types of packets entering and leaving the batman-adv
189135
module are available through ethtool::

MAINTAINERS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,10 +2793,13 @@ M: Simon Wunderlich <[email protected]>
27932793
M: Antonio Quartulli <[email protected]>
27942794
L: [email protected] (moderated for non-subscribers)
27952795
W: https://www.open-mesh.org/
2796+
B: https://www.open-mesh.org/projects/batman-adv/issues
2797+
C: irc://chat.freenode.net/batman
27962798
Q: https://patchwork.open-mesh.org/project/batman/list/
2799+
T: git https://git.open-mesh.org/linux-merge.git
27972800
S: Maintained
2798-
F: Documentation/ABI/testing/sysfs-class-net-batman-adv
2799-
F: Documentation/ABI/testing/sysfs-class-net-mesh
2801+
F: Documentation/ABI/obsolete/sysfs-class-net-batman-adv
2802+
F: Documentation/ABI/obsolete/sysfs-class-net-mesh
28002803
F: Documentation/networking/batman-adv.rst
28012804
F: include/uapi/linux/batadv_packet.h
28022805
F: include/uapi/linux/batman_adv.h

include/uapi/linux/batadv_packet.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
33
*
44
* Marek Lindner, Simon Wunderlich
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of version 2 of the GNU General Public
8-
* License as published by the Free Software Foundation.
9-
*
10-
* This program is distributed in the hope that it will be useful, but
11-
* WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
* General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
175
*/
186

197
#ifndef _UAPI_LINUX_BATADV_PACKET_H_

include/uapi/linux/batman_adv.h

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,6 @@
22
/* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors:
33
*
44
* Matthias Schiffer
5-
*
6-
* Permission is hereby granted, free of charge, to any person obtaining a
7-
* copy of this software and associated documentation files (the "Software"),
8-
* to deal in the Software without restriction, including without limitation
9-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
10-
* and/or sell copies of the Software, and to permit persons to whom the
11-
* Software is furnished to do so, subject to the following conditions:
12-
*
13-
* The above copyright notice and this permission notice shall be included in
14-
* all copies or substantial portions of the Software.
15-
*
16-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22-
* DEALINGS IN THE SOFTWARE.
235
*/
246

257
#ifndef _UAPI_LINUX_BATMAN_ADV_H_
@@ -491,6 +473,13 @@ enum batadv_nl_attrs {
491473
*/
492474
BATADV_ATTR_THROUGHPUT_OVERRIDE,
493475

476+
/**
477+
* @BATADV_ATTR_MULTICAST_FANOUT: defines the maximum number of packet
478+
* copies that may be generated for a multicast-to-unicast conversion.
479+
* Once this limit is exceeded distribution will fall back to broadcast.
480+
*/
481+
BATADV_ATTR_MULTICAST_FANOUT,
482+
494483
/* add attributes above here, update the policy in netlink.c */
495484

496485
/**

net/batman-adv/Kconfig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
33
#
44
# Marek Lindner, Simon Wunderlich
5-
#
6-
# This program is free software; you can redistribute it and/or
7-
# modify it under the terms of version 2 of the GNU General Public
8-
# License as published by the Free Software Foundation.
9-
#
10-
# This program is distributed in the hope that it will be useful, but
11-
# WITHOUT ANY WARRANTY; without even the implied warranty of
12-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
# General Public License for more details.
14-
#
15-
# You should have received a copy of the GNU General Public License
16-
# along with this program; if not, see <http://www.gnu.org/licenses/>.
175

186
#
197
# B.A.T.M.A.N meshing protocol
@@ -109,6 +97,18 @@ config BATMAN_ADV_DEBUG
10997
buffer. The output is controlled via the batadv netdev specific
11098
log_level setting.
11199

100+
config BATMAN_ADV_SYSFS
101+
bool "batman-adv sysfs entries"
102+
depends on BATMAN_ADV
103+
default y
104+
help
105+
Say Y here if you want to enable batman-adv device configuration and
106+
status interface through sysfs attributes. It is replaced by the
107+
batadv generic netlink family but still used by various userspace
108+
tools and scripts.
109+
110+
If unsure, say Y.
111+
112112
config BATMAN_ADV_TRACING
113113
bool "B.A.T.M.A.N. tracing support"
114114
depends on BATMAN_ADV

net/batman-adv/Makefile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22
# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
33
#
44
# Marek Lindner, Simon Wunderlich
5-
#
6-
# This program is free software; you can redistribute it and/or
7-
# modify it under the terms of version 2 of the GNU General Public
8-
# License as published by the Free Software Foundation.
9-
#
10-
# This program is distributed in the hope that it will be useful, but
11-
# WITHOUT ANY WARRANTY; without even the implied warranty of
12-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
# General Public License for more details.
14-
#
15-
# You should have received a copy of the GNU General Public License
16-
# along with this program; if not, see <http://www.gnu.org/licenses/>.
17-
#
185

196
obj-$(CONFIG_BATMAN_ADV) += batman-adv.o
207
batman-adv-y += bat_algo.o
@@ -41,7 +28,7 @@ batman-adv-y += originator.o
4128
batman-adv-y += routing.o
4229
batman-adv-y += send.o
4330
batman-adv-y += soft-interface.o
44-
batman-adv-y += sysfs.o
31+
batman-adv-$(CONFIG_BATMAN_ADV_SYSFS) += sysfs.o
4532
batman-adv-$(CONFIG_BATMAN_ADV_TRACING) += trace.o
4633
batman-adv-y += tp_meter.o
4734
batman-adv-y += translation-table.o

net/batman-adv/bat_algo.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
33
*
44
* Marek Lindner, Simon Wunderlich
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of version 2 of the GNU General Public
8-
* License as published by the Free Software Foundation.
9-
*
10-
* This program is distributed in the hope that it will be useful, but
11-
* WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
* General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
175
*/
186

197
#include "main.h"

net/batman-adv/bat_algo.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
/* Copyright (C) 2011-2019 B.A.T.M.A.N. contributors:
33
*
44
* Marek Lindner, Linus Lüssing
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of version 2 of the GNU General Public
8-
* License as published by the Free Software Foundation.
9-
*
10-
* This program is distributed in the hope that it will be useful, but
11-
* WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
* General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
175
*/
186

197
#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_

net/batman-adv/bat_iv_ogm.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
33
*
44
* Marek Lindner, Simon Wunderlich
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of version 2 of the GNU General Public
8-
* License as published by the Free Software Foundation.
9-
*
10-
* This program is distributed in the hope that it will be useful, but
11-
* WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
* General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
175
*/
186

197
#include "bat_iv_ogm.h"

net/batman-adv/bat_iv_ogm.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,6 @@
22
/* Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
33
*
44
* Marek Lindner, Simon Wunderlich
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of version 2 of the GNU General Public
8-
* License as published by the Free Software Foundation.
9-
*
10-
* This program is distributed in the hope that it will be useful, but
11-
* WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13-
* General Public License for more details.
14-
*
15-
* You should have received a copy of the GNU General Public License
16-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
175
*/
186

197
#ifndef _NET_BATMAN_ADV_BAT_IV_OGM_H_

0 commit comments

Comments
 (0)