Hi,
I hope that the fever-induced dreams are over now. Otherwise I will try to
write my mails also as little tales. ;)
Nevertheless, I would like to send some patches for 2.6.37. That is not
100% true. We would also like to see the revert
'Revert: "Staging: batman-adv: Adding netfilter-bridge hooks"' too in 2.6.36.
It fixes a bug introduced by the commit we revert here.
The rest is more or less the usual stuff, but more feature patches this time.
All patches we depend on are already part of 2.6.36-rc3.
I will try to sent a patch again to David S. Miller.
thanks,
Sven
Andreas Langer (1):
Staging: batman-adv: layer2 unicast packet fragmentation
Marek Lindner (4):
Staging: batman-adv: refactoring unicast payload code
Staging: batman-adv: register the batman-adv packet type per interface
Staging: batman-adv: attach each hard-interface to a soft-interface
Staging: batman-adv: multiple mesh clouds
Simon Wunderlich (2):
Staging: batman-adv: Count Ethernet header for incoming packets
Staging: batman-adv: move queue counters into bat_priv
Sven Eckelmann (14):
Revert: "Staging: batman-adv: Adding netfilter-bridge hooks"
Staging: batman-adv: Remove CHANGELOG
Staging: batman-adv: Start new development cycle
Staging: batman-adv: Calculate hamming weight using optimized kernel functions
Staging: batman-adv: Directly prepare icmp packets in socket buffer
Staging: batman-adv: Keep header writable and unshared
Staging: batman-adv: Only clone skb data for multiple broadcasts
Staging: batman-adv: Aggregate batman packets directly in skb
Staging: batman-adv: Prepare vis packets directly inside a skb
Staging: batman-adv: Create copy of skb with pre-allocated headroom
Staging: batman-adv: Provide full headers and packets as linear skb
Staging: batman-adv: Remove duplicate of attached device name
Staging: batman-adv: Don't inform about dropped packets in nodebug
Staging: batman-adv: Update mtu of bat device by changing mtu of slave device
drivers/staging/batman-adv/CHANGELOG | 63 ---
drivers/staging/batman-adv/Makefile | 2 +-
drivers/staging/batman-adv/README | 45 +--
drivers/staging/batman-adv/TODO | 3 -
drivers/staging/batman-adv/aggregation.c | 57 ++--
drivers/staging/batman-adv/bat_sysfs.c | 106 ++++--
drivers/staging/batman-adv/bitarray.c | 22 +-
drivers/staging/batman-adv/bitarray.h | 7 +-
drivers/staging/batman-adv/hard-interface.c | 237 +++++++-----
drivers/staging/batman-adv/hard-interface.h | 6 +-
drivers/staging/batman-adv/hash.c | 6 +-
drivers/staging/batman-adv/hash.h | 4 +-
drivers/staging/batman-adv/icmp_socket.c | 70 ++--
drivers/staging/batman-adv/main.c | 138 ++-----
drivers/staging/batman-adv/main.h | 28 +-
drivers/staging/batman-adv/originator.c | 166 +++++----
drivers/staging/batman-adv/originator.h | 8 +-
drivers/staging/batman-adv/packet.h | 26 +-
drivers/staging/batman-adv/routing.c | 440 ++++++++++++---------
drivers/staging/batman-adv/routing.h | 16 +-
drivers/staging/batman-adv/send.c | 174 ++++-----
drivers/staging/batman-adv/send.h | 7 +-
drivers/staging/batman-adv/soft-interface.c | 238 +++++++-----
drivers/staging/batman-adv/soft-interface.h | 13 +-
drivers/staging/batman-adv/translation-table.c | 266 +++++++------
drivers/staging/batman-adv/translation-table.h | 30 +-
drivers/staging/batman-adv/types.h | 98 ++++-
drivers/staging/batman-adv/unicast.c | 265 +++++++++++++
drivers/staging/batman-adv/unicast.h | 39 ++
drivers/staging/batman-adv/vis.c | 500 ++++++++++++++----------
drivers/staging/batman-adv/vis.h | 27 +--
31 files changed, 1822 insertions(+), 1285 deletions(-)
The soft-interface transmission function expects that the unicast skb is
still available when a send failed. Otherwise we would try to free the
skb twice and create many different and hard to debug memory access
failures due to access on not (anymore) allocated memory.
Reported-by: Andreas Langer <an.langer(a)gmx.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
unicast.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/unicast.c b/unicast.c
index 84b204b..796d9c1 100644
--- a/unicast.c
+++ b/unicast.c
@@ -264,6 +264,5 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
unlock:
spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags);
dropped:
- kfree_skb(skb);
return 1;
}
--
1.7.1
soft_interface.c needs sysfs_add_meshif and sysfs_del_meshif after
"batman-adv: attach each hard-interface to a soft-interface". This
Include is provided indirectly using compat.h on standalone sources, but
missing on kernel builds.
We should add it directly as the compat.h include is only a side effect
we cannot rely on.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
batman-adv/soft-interface.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/batman-adv/soft-interface.c b/batman-adv/soft-interface.c
index 38134ae..28bd6a2 100644
--- a/batman-adv/soft-interface.c
+++ b/batman-adv/soft-interface.c
@@ -31,6 +31,7 @@
#include "gateway_common.h"
#include "gateway_client.h"
#include "send.h"
+#include "bat_sysfs.h"
#include <linux/slab.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
--
1.7.1
New versions of the batman-adv kernel module and batctl are released today
with the version number 2010.1.0. The B.A.T.M.A.N. team's main focus was on
new features, Linux kernel compliance and a bunch of bug fixes. As the kernel
module always depends on the Linux kernel it was compiled against, it does not
make sense to provide binaries on our website. As usual, you will find the
signed tarballs in our download section:
http://downloads.open-mesh.net/batman/releases/batman-adv-2010.1.0/
as well as prepackaged binaries in your distribution.
Important changes
----------------
As part of the ongoing kernel interface restructuring all remaining tables and
debug output was migrated from the proc filesystem to the debug filesystem.
Also, some tables which went into sysfs followed this example as well as the
layer 2 icmp socket which resided in /dev. All programs / scripts accessing
these files directly need to be adjusted. Scripts using batctl are not affected
by this transition as the batctl command line parameters are unchanged. More
details can be found below as well as in our documentation.
Thanks
----------------
Thanks to all people sending in patches:
* Antonio Quartulli <ordex(a)ritirata.org>
* Dan Carpenter <error27(a)gmail.com>
* Daniel Seither <post(a)tiwoc.de>
* Eric Dumazet <eric.dumazet(a)gmail.com>
* Jiri Pirko <jpirko(a)redhat.com>
* Joe Perches <joe(a)perches.com>
* Linus Lüssing <linus.luessing(a)web.de>
* Marek Lindner <lindner_marek(a)yahoo.de>
* Randy Dunlap <randy.dunlap(a)oracle.com>
* Simon Wunderlich <siwu(a)hrz.tu-chemnitz.de>
* Sven Eckelmann <sven.eckelmann(a)gmx.de>
* Tejun Heo <tj(a)kernel.org>
batman-adv
----------------
The first B.A.T.M.A.N. V features left the experimental stage and went into
this release: interface alternating (formerly known as incoming interface
based routing) & bonding mode. These are optimizations for scenarios in which
mesh nodes possess several WiFi cards to run the mesh on. In alternating mode
batman-adv will switch the WiFi interface to forward the traffic with each hop,
thereby avoiding store & forward (which would half the bandwidth with each
forwarding node). Bonding mode will use all available interfaces at the same
time to forward the traffic. Both modes do not require the whole network to have
the same hardware configuration - the available interfaces are automatically
detected and used if possible. Per default batman-adv operates in the
alternating mode, bonding mode can be activated.
To achieve Linux kernel compliance all tables and debug information have been
concentrated in the debug filesystem (all configuration options remain in
sysfs). Make sure your kernel has the debug filesystem compiled in if you want
to access those information. The user space API is now considered clean and
won't require significant changes in the future. The originator table outputs
the "last seen" field to allow observing originator outages in real time. The
batman-adv debug log returned with the debugfs changes, after it had been
removed in previous releases. The batman icmp socket left the /dev directory
to join the other debug facilities in debugfs (before it was not possible to
create a socket for each configured mesh). This release also contains numerous
bug fixes regarding stability, broadcast flood protection through 32Bit sequence
numbers, supporting newer kernel versions, multiple interface bugs, rounding
issues and more.
batctl
----------------
Batctl has been adapted to retrieve the tables and other information from the
debug filesystem. To provide a smooth user experience batctl automatically
mounts the debug filesystem whenever necessary. As the debug log output moved
from the standard kernel logging to the batman-adv log file, batctl re-
introduces the convenience features to retrieve the logs and replace mac
addresses with names. Batctl also followed the icmp socket move and is
prepared for the multiple mesh support. The ping utility received the "record
route" ability which allows to monitor route changes. The originator table
viewer gained some additional options to filter for "fresh" entries (using the
"last seen" field) and allows to specify a refresh interval to continuously
print the table.
Happy routing,
The B.A.T.M.A.N. team
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
batman-adv/CHANGELOG | 16 ++++++++++++++++
batman-adv/README | 47 +++++++++++++++++++++++------------------------
2 files changed, 39 insertions(+), 24 deletions(-)
diff --git a/batman-adv/CHANGELOG b/batman-adv/CHANGELOG
index 86450b4..67bfc6e 100644
--- a/batman-adv/CHANGELOG
+++ b/batman-adv/CHANGELOG
@@ -1,3 +1,19 @@
+batman-adv 2010.1.0:
+
+* support latest kernels (2.6.21 - 2.6.36)
+* further cleanup of coding style
+* recording of routes for batman icmp messages
+* move of complex sysfs files to debugfs
+* change output of all sysfs files to single-value-only
+* reintroduce virtual file for the debug log
+* bonding and alternating added
+* add ttl to broadcasts
+* change all sequence numbers to 32 bit
+* show last-seen in originator table
+* many bugs (rounding issues, locking, netdev event handler, ...) squashed
+
+ -- Sat, 04 Sep 2010 13:56:38 +0200
+
batman-adv 2010.0.0:
* support latest kernels (2.6.21 - 2.6.35)
diff --git a/batman-adv/README b/batman-adv/README
index 24b062b..ecef96d 100644
--- a/batman-adv/README
+++ b/batman-adv/README
@@ -1,4 +1,4 @@
-[state: 12-06-2010]
+[state: 04-09-2010]
BATMAN-ADV
----------
@@ -18,7 +18,7 @@ Batman advanced was implemented as a Linux kernel driver to re-
duce the overhead to a minimum. It does not depend on any (other)
network driver, and can be used on wifi as well as ethernet lan,
vpn, etc ... (anything with ethernet-style layer 2). It compiles
-against and should work with Linux 2.6.21 - 2.6.35. Supporting
+against and should work with Linux 2.6.21 - 2.6.36. Supporting
older versions is not planned, but it's probably easy to backport
it. If you work on a backport, feel free to contact us. :-)
@@ -83,15 +83,21 @@ All mesh wide settings can be found in batman's own interface
folder:
# ls /sys/class/net/bat0/mesh/
-# aggregate_ogm originators transtable_global vis_mode
-# orig_interval transtable_local vis_data
+# aggregated_ogms bonding orig_interval vis_mode
+
+
+There is a special folder for debugging informations:
+
+# ls /sys/kernel/debug/batman_adv/bat0/
+# originators socket transtable_global transtable_local
+# vis_data
Some of the files contain all sort of status information regard-
ing the mesh network. For example, you can view the table of
originators (mesh participants) with:
-# cat /sys/class/net/bat0/mesh/originators
+# cat /sys/kernel/debug/batman_adv/bat0/originators
Other files allow to change batman's behaviour to better fit your
requirements. For instance, you can check the current originator
@@ -99,7 +105,7 @@ interval (value in milliseconds which determines how often batman
sends its broadcast packets):
# cat /sys/class/net/bat0/mesh/orig_interval
-# status: 1000
+# 1000
and also change its value:
@@ -153,7 +159,7 @@ at least very similar) data.
When configured as server, you can get a topology snapshot of
your mesh:
-# cat /sys/class/net/bat0/mesh/vis_data
+# cat /sys/kernel/debug/batman_adv/bat0/vis_data
This raw output is intended to be easily parsable and convertable
with other tools. Have a look at the batctl README if you want a
@@ -201,32 +207,25 @@ uncomment the line
#EXTRA_CFLAGS += -DCONFIG_BATMAN_ADV_DEBUG
+Those additional debug messages can be accessed using a special
+file in debugfs
+
+# cat /sys/kernel/debug/batman_adv/bat0/log
+
The additional debug output is by default disabled. It can be en-
-abled either at kernel modules load time or during run time. To
-enable debug output at module load time, add the module parameter
-debug=<value>. <value> can take one of four values.
+abled during run time. Following log_levels are defined:
0 - All debug output disabled
1 - Enable messages related to routing / flooding / broadcasting
2 - Enable route or hna added / changed / deleted
3 - Enable all messages
-e.g.
-
-# modprobe batman-adv debug=2
-
-will load the module and enable debug messages for when routes or
-HNAs change.
-
-The debug output can also be changed at runtime using the file
-/sys/module/batman-adv/parameters/debug. e.g.
-
-# echo 2 > /sys/module/batman-adv/parameters/debug
+The debug output can be changed at runtime using the file
+/sys/class/net/bat0/mesh/log_level. e.g.
-enables debug messages for when routes or HNAs
+# echo 2 > /sys/class/net/bat0/mesh/log_level
-The debug output is sent to the kernel logs. So try dmesg, lo-
-gread, etc to see the debug messages.
+will enable debug messages for when routes or HNAs change.
BATCTL
--
1.7.1
The netfilter hook seems to be misused and may not filter everything as
expected. Also the ethernet bridge tables are not yet capable to
understand batman-adv packet correctly.
It was only added for testing purposes and can be removed again.
Reported-by: Vasiliy Kulikov <segooon(a)gmail.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
I got the information that Linus Luessing acked that change and will
provide that patch for testing purposes somewhere else.
I prefer to get it reverted because it also made the patch
"batman-adv: register the batman-adv packet type per interface"
useless.
batman-adv/hard-interface.c | 72 +++++++++++++++++++------------------------
batman-adv/send.c | 8 +---
2 files changed, 34 insertions(+), 46 deletions(-)
diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c
index 063d34d..edbfddf 100644
--- a/batman-adv/hard-interface.c
+++ b/batman-adv/hard-interface.c
@@ -30,7 +30,6 @@
#include "hash.h"
#include <linux/if_arp.h>
-#include <linux/netfilter_bridge.h>
#include "compat.h"
@@ -495,29 +494,46 @@ out:
return NOTIFY_DONE;
}
-static int batman_skb_recv_finish(struct sk_buff *skb)
+/* receive a packet with the batman ethertype coming on a hard
+ * interface */
+int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *ptype, struct net_device *orig_dev)
{
+ struct bat_priv *bat_priv;
struct batman_packet *batman_packet;
struct batman_if *batman_if;
- struct bat_priv *bat_priv;
int ret;
- batman_if = get_batman_if_by_netdev(skb->dev);
- if (!batman_if)
+ batman_if = container_of(ptype, struct batman_if, batman_adv_ptype);
+ skb = skb_share_check(skb, GFP_ATOMIC);
+
+ /* skb was released by skb_share_check() */
+ if (!skb)
+ goto err_out;
+
+ /* packet should hold at least type and version */
+ if (unlikely(!pskb_may_pull(skb, 2)))
+ goto err_free;
+
+ /* expect a valid ethernet header here. */
+ if (unlikely(skb->mac_len != sizeof(struct ethhdr)
+ || !skb_mac_header(skb)))
goto err_free;
if (!batman_if->soft_iface)
goto err_free;
+ bat_priv = netdev_priv(batman_if->soft_iface);
+
+ if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
+ goto err_free;
+
/* discard frames on not active interfaces */
if (batman_if->if_status != IF_ACTIVE)
goto err_free;
- bat_priv = netdev_priv(batman_if->soft_iface);
- if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
- goto err_free;
-
batman_packet = (struct batman_packet *)skb->data;
+
if (batman_packet->version != COMPAT_VERSION) {
bat_dbg(DBG_BATMAN, bat_priv,
"Drop packet: incompatible batman version (%i)\n",
@@ -563,42 +579,18 @@ static int batman_skb_recv_finish(struct sk_buff *skb)
}
if (ret == NET_RX_DROP)
- goto err_free;
+ kfree_skb(skb);
- return 0;
+ /* return NET_RX_SUCCESS in any case as we
+ * most probably dropped the packet for
+ * routing-logical reasons. */
-err_free:
- kfree_skb(skb);
- return 0;
-}
-
-/* receive a packet with the batman ethertype coming on a hard
- * interface */
-int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *ptype, struct net_device *orig_dev)
-{
- skb = skb_share_check(skb, GFP_ATOMIC);
-
- /* skb was released by skb_share_check() */
- if (!skb)
- return 0;
-
- /* packet should hold at least type and version */
- if (unlikely(!pskb_may_pull(skb, 2)))
- goto err_free;
-
- /* expect a valid ethernet header here. */
- if (unlikely(skb->mac_len != sizeof(struct ethhdr) ||
- !skb_mac_header(skb)))
- goto err_free;
+ return NET_RX_SUCCESS;
- /* if netfilter/ebtables wants to block incoming batman
- * packets then give them a chance to do so here */
- return NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, dev,
- NULL, batman_skb_recv_finish);
err_free:
kfree_skb(skb);
- return 0;
+err_out:
+ return NET_RX_DROP;
}
struct notifier_block hard_if_notifier = {
diff --git a/batman-adv/send.c b/batman-adv/send.c
index 283c6bb..92eb421 100644
--- a/batman-adv/send.c
+++ b/batman-adv/send.c
@@ -29,7 +29,6 @@
#include "vis.h"
#include "aggregation.h"
#include "gateway_common.h"
-#include <linux/netfilter_bridge.h>
#include "compat.h"
@@ -94,12 +93,9 @@ int send_skb_packet(struct sk_buff *skb,
/* dev_queue_xmit() returns a negative result on error. However on
* congestion and traffic shaping, it drops and returns NET_XMIT_DROP
- * (which is > 0). This will not be treated as an error.
- * Also, if netfilter/ebtables wants to block outgoing batman
- * packets then giving them a chance to do so here */
+ * (which is > 0). This will not be treated as an error. */
- return NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_OUT, skb, NULL, skb->dev,
- dev_queue_xmit);
+ return dev_queue_xmit(skb);
send_skb_err:
kfree_skb(skb);
return NET_XMIT_DROP;
--
1.7.1
Kazuki Shimada wrote:
> Hi, Sven.
>
> >> P.S.
> >> When activating network interfaces under bat0, What about forcing their
> >> mtu value to 1527?
> >
> > Why?
>
> Because batman-adv says
> "The MTU of interface wlan0 is too small 1500 to handle the transport of
> batman-adv packets. Packets going over this interface will be fragmented
> on layer2 which could impact the performance. Setting the MTU to 1527
> would solve the problem."
>
> I thought batman-adv need 1527 as mtu value.
> OK, I've understood.
You don't need it for unicast packets, but it is highly recommended due to
performance penalties. Do you think that we should change that warning to make
it more clear? Is there anything special which we should add/change?
Thanks,
Sven