Hello,
i looked into the problem of fragmenting packets on layer2 to solve the mtu issue. I found a
unforeseen problem : oversized packets will be dropped by the bridge module ( if bat0 is in a
bridge ). I think the reason can be found here net/bridge/br_forward.c on line 44
43 /* drop mtu oversized packets except gso */
44 if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))
45 kfree_skb(skb);
Possible solution: make a patch for the bridge module
if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb) && !(skb->dev->priv_flags &
IFF_CAN_FRAG))
IFF_CAN_FRAG must be added to include/linux/if.h and batman-adv has to set this flag on bat0
I can make a patch for mainline inclusion, do you believe it is going to be accepted ?
regards,
andreas
Hi,
as we started to have different branches and repositories, everything became a
little bit more complex to track. I will try to summarize what and where is
something going on inside the batman-adv universe.
* http://downloads.open-mesh.org/svn/batman/trunk/batman-adv-kernelland/http://git.open-mesh.net/?p=batman-adv;a=shortlog;h=refs/heads/master
In trunk is always summer - so changes always(?) enter here and will
get moved to other branches unless they need some more time to get a fine
flavor - or at least more testing. Even if everything should hit trunk, it
is easier to describe changes in a different place.
This branch can be used together with
http://downloads.open-mesh.net/svn/batman/trunk/batctl/
* http://git.open-mesh.net/?p=batman-adv;a=shortlog;h=refs/heads/maint
This is were commits are gathered to be send later to the linux kernel
folks. Only tested features or features which are dependencies for the
in-kernel batman-adv should enter this branch. We have already created the
release v0.2.1 only from commits inside that branch while we developed new
stuff in parallel in trunk.
Since that release we received smaller patches which were merged into the
linux mainline first or which were send to us directly from people which
actually wanted to fix problems of the in-kernel batman-adv directly. We
had for example style changes or patches which will guarantee that
batman-adv still builds in upcoming kernel releases - things we otherwise
would have to analyse after that kernel was released. So instead of having
a user which notices that batman-adv doesn't build anymore, we got the
fix for the problem which will exist somewhere in the future directly from
the people which will create that problem. :)
As one of the bigger changes we started to port batman-adv from /proc to
sysfs and debugfs. batctl was also changed to work on top of the new
configuration and debugging infrastructure. Unfortunately this change is a
two step process. First we changed everything from /proc to sysfs and later
moved parts of the files in sysfs to debugfs because they were not single
value files. But later more about those changes in maint-0.2.2.
Beside smaller bugfixes, a bigger problem was found when receiving an
enormous amount of broadcast packets which must be rebroadcasted. It could
happen that those packets looped inside the mesh. It was tried to fix that
problem without changing the packet format. Even if that reduced the
problem, there are more changes coming later which needs changes to the
packet format.
Also a smaller new feature has entered maint - the ability to allow
netfilter/ebtables to filter incoming packets which are directly for
batman-adv.
This branch can be used together with
http://downloads.open-mesh.net/svn/batman/branches/batctl-0.2.x/
* linux-2.6.35
The merge window has opened over a week ago and all patches (patches we
send at least a week before it was opened) were accepted. Newer bugfixes
will probably accepted in some days. Unfortunately some patches like the
move of some files to debugfs weren't finished right in time and will only
be merged into linux-2.6.36 because they are more than just simple
bugfixes. That includes the removing of /dev/batman-adv in favor of
debugfs, moving of tables from sysfs to debugfs and the netfilter
integration.
* http://git.open-mesh.net/?p=batman-adv;a=shortlog;h=refs/heads/maint-0.2.2
As we weren't able to merge all patches inside maint in linux-2.6.35 and we
still want to be able to provide a release which behaves like the version
in 2.6.35, it was decided that we just use a version before the debugfs
patches and create a branch which will gather all bugfixes in maint. It
will be merged and removed after the release of batman-adv-kernelland-0.2.2
or plans are changed. So better don't start a friendship with this little
buddy.
If you want to try that branch or any snapshot of 2.6.35 then please try
revision r1664 of
http://downloads.open-mesh.net/svn/batman/branches/batctl-0.2.x/
* http://git.open-mesh.net/?p=batman-adv;a=shortlog;h=refs/heads/linux
The dirty place were all the linux integration happens. It is ugly,
misunderstood and uninteresting for most people.
The last synchronization point was GregKH-20100522. It is a merge of
v2.6.34 and v0.2.1-38-gbcde864 + a documentation of all files we create in
sysfs. So this synchronization point (a git tag) just says that we check at
least v2.6.34 for new patches not yet integrated in maint/trunk of
batman-adv and that we send our changes until that point to GregKH.
In reality the patches are modified a little bit.
* Files are moved from / to /drivers/staging/batman-adv
* compat.h, bat_printk.c, Makefile.kbuild are removed
* all references (#include) to compat.h are removed
* TODO, Kconfig, sysfs-class-net-batman-adv and sysfs-class-net-mesh are
added
* Makefile is rewritten to look like a stripped down version of
Makefile.kbuild
* All passages how to compile batman-adv outside of the kernel are removed
from README
* Squashed with patches which only fix another patch
All those changes are done for each patch (or at least ensured that no
changes will conflict with those points) on top of the last merge point.
This should ensure that we don't diverge too much from maint with the
in-kernel batman-adv.
Each patch is then applied on top of a current linux-next, tested if it
compiles, checked with sparse and checkpatch.pl --strict. When everything
looks fine, they get exported again using git-format-patch and send to
GregKH.
Only because a change is part of a synchronization point, it doesn't mean
that it will appear with the next linux kernel. As said before, all
bugfixes between GregKH-20100510 and GregKH-20100522 will be part of
2.6.35, but anything bigger will be part of 2.6.36.
* http://git.open-mesh.net/?p=ecsv/master-rebase.git;a=shortlog;h=rebase
My personal project. (With a little delay) I will try to get all changes in
trunk rebased on top of maint. As result we get only the essence of changes
in trunk which aren't already part of maint. This also means for example
that patches will look like they were made with sysfs in mind even when
they are originally created files in /proc. Even when I always ensure that
the files in master and rebase are 100% equal, the original author may not
be blamed when a single patch will try to eat your pet (or you could say
that patches in that branch will not be checked by their original authors
and I will only guarantee that when you apply all patches you will get the
same files as in trunk).
Nevertheless it is a great place to get and test feature patches on top of
maint without using the complete set of changes in master. Or to understand
what goes on in trunk compared to maint.
Of course you cannot use all patches in any order because they have
dependencies between each other. A the moment we have following patches
which should be quite easy to use together with any other patch:
* batman-adv: mark trunk as 0.3.0 alpha
* batman-adv: Add bonding functionality
* batman-adv: move queue counters into bat_priv
We have also patches which changes the packet compat version to 9 (all
gateway patches must be used in that order, otherwise they would not
apply):
* batman-adv: adding gateway functionality
* batman-adv: send DHCP requests directly to the chosen gw
* batman-adv: best gw DHCP filter 802.1Q support
* batman-adv: record route for ICMP messages
The last patch increases the compat version 10 and thus requires the
patches which justify the compat version 9 ("adding gateway functionality",
"record route for ICMP messages"):
* batman-adv: 32bit sequence number and TTL for broadcasts
This branch will jump around and it is not save to track it using a local
git branch.
This branch can be used together with
http://downloads.open-mesh.net/svn/batman/trunk/batctl/
Last but not least, thanks to everyone who has done the real work
* Andrea Gelmini
* Andrew Lunn
* Dan Carpenter
* Daniel Seither
* Linus Lüssing
* Marek Lindner
* Paul E. McKenney
* Simon Wunderlich
* Tejun Heo
and lets see what the next months will bring us.
Best regards,
Sven
Hi all,
I'm tring to make some tests on batman-adv with some stations,
but I'm in trouble since I'm not able to "hide" a node to another. In
other words I would like to create some personalized topologies to
to test batman against them.
To do this, first of all, I should block OGMs from a particular station.
I tried with ebtables in order to block all the packets with source MACa
(where MACa is the MAC address of the station I would prevent to
communicate with me), but I failed.
Does anyone know a working way to do what I described before?
Thank you so much!
Regards
--
Antonio Quartulli
Ognuno di noi, da solo, non vale nulla
Ernesto "Che" Guevara
Hi,
we've tried to fix the outstanding problem regarding the sysfs filesystem and
fixed some further smaller problems. I hope that it is right were we put the
ABI documentation.
Linus Lüssing (1):
Staging: batman-adv: Adding netfilter-bridge hooks
Marek Lindner (4):
Staging: batman-adv: remove redundant struct declaration
Staging: batman-adv: fix rogue packets on shutdown
Staging: batman-adv: convert all sysfs files to single value files
Documentation: ABI: Add information about batman-adv sysfs entries
Sven Eckelmann (5):
Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock
Staging: batman-adv: Don't call free_netdev twice
Staging: batman-adv: Move device for icmp injection to debugfs
Staging: batman-adv: Move tables from sysfs to debugfs
Staging: batman-adv: Don't allocate icmp packet with GFP_KERNEL
Best regards,
Sven
Hi,
here are the patches for 2.6.36 split from the old patchset.
Linus Lüssing (1):
Staging: batman-adv: Adding netfilter-bridge hooks
Marek Lindner (3):
Staging: batman-adv: remove redundant struct declaration
Staging: batman-adv: convert all sysfs files to single value files
Staging: batman-adv: Add information about batman-adv sysfs entries
Sven Eckelmann (2):
Staging: batman-adv: Move device for icmp injection to debugfs
Staging: batman-adv: Move tables from sysfs to debugfs
Best regards,
Sven
Hi,
here are the patches which fixes different bugs backported for 2.6.35
Marek Lindner (1):
Staging: batman-adv: fix rogue packets on shutdown
Sven Eckelmann (3):
Staging: batman-adv: Call unregister_netdev on failures to get rtnl lock
Staging: batman-adv: Don't call free_netdev twice
Staging: batman-adv: Don't allocate icmp packet with GFP_KERNEL
thanks,
Sven
Linux allows to call debugfs related functions even when it is not
compiled in. The return codes will always be failure return codes and we
would fail to load the batman-adv module even when debugfs isn't a hard
dependency.
We can simply return a success error code when the debugfs stub returned
a error code and the kernel was compiled without debugfs support.
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
batman-adv-kernelland/bat_debugfs.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/batman-adv-kernelland/bat_debugfs.c b/batman-adv-kernelland/bat_debugfs.c
index 9113601..bc1591f 100644
--- a/batman-adv-kernelland/bat_debugfs.c
+++ b/batman-adv-kernelland/bat_debugfs.c
@@ -141,7 +141,11 @@ rem_attr:
debugfs_remove_recursive(bat_priv->debug_dir);
bat_priv->debug_dir = NULL;
out:
+#ifdef CONFIG_DEBUG_FS
return -ENOMEM;
+#else
+ return 0;
+#endif /* CONFIG_DEBUG_FS */
}
void debugfs_del_meshif(struct net_device *dev)
--
1.7.1
From: Tejun Heo <tj(a)kernel.org>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj(a)kernel.org>
Guess-its-ok-by: Christoph Lameter <cl(a)linux-foundation.org>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn(a)hp.com>
Signed-off-by: Sven Eckelmann <sven.eckelmann(a)gmx.de>
---
batman-adv-kernelland/icmp_socket.c | 1 +
batman-adv-kernelland/main.h | 1 +
batman-adv-kernelland/soft-interface.c | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
index becbb5b..bad87fd 100644
--- a/batman-adv-kernelland/icmp_socket.c
+++ b/batman-adv-kernelland/icmp_socket.c
@@ -20,6 +20,7 @@
*/
#include <linux/debugfs.h>
+#include <linux/slab.h>
#include "main.h"
#include "icmp_socket.h"
#include "send.h"
diff --git a/batman-adv-kernelland/main.h b/batman-adv-kernelland/main.h
index ef2cbfd..4d7cc2a 100644
--- a/batman-adv-kernelland/main.h
+++ b/batman-adv-kernelland/main.h
@@ -121,6 +121,7 @@ extern int bat_debug_type(int type);
#include <linux/kthread.h> /* kernel threads */
#include <linux/pkt_sched.h> /* schedule types */
#include <linux/workqueue.h> /* workqueue */
+#include <linux/slab.h>
#include <net/sock.h> /* struct sock */
#include <linux/jiffies.h>
#include <linux/seq_file.h>
diff --git a/batman-adv-kernelland/soft-interface.c b/batman-adv-kernelland/soft-interface.c
index b51e2cf..e7a440e 100644
--- a/batman-adv-kernelland/soft-interface.c
+++ b/batman-adv-kernelland/soft-interface.c
@@ -27,6 +27,7 @@
#include "translation-table.h"
#include "types.h"
#include "hash.h"
+#include <linux/slab.h>
#include "gateway_client.h"
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
--
1.7.1
Hi,
thanks to Sven's patches we made the transition to debugfs rather quickly. All
batman tables (originator table / gateway table / translation tables) and the
vis data output have been relocated to debugfs. Even the former batman device
(used for layer2 icmp data) has been moved to debugfs which brings us an
important step closer to the multiple mesh support.
@Andrew: I attached the revised sysfs ABI files. Do you think it is feasible to
get these last patches into 2.6.35 ?
Cheers,
Marek