Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Antonio Quartulli
On Tue, Apr 17, 2012 at 01:24:55 +0200, Martin Hundebøll wrote: @@ -488,6 +492,8 @@ bool dat_snoop_outgoing_arp_reply(struct bat_priv *bat_priv, arp_neigh_update(bat_priv, ip_src, hw_src); arp_neigh_update(bat_priv, ip_dst, hw_dst); + bat_priv-bat_stats.dat_reply_tx++; +

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Antonio Quartulli
On Tue, Apr 17, 2012 at 09:12:42AM +0200, Antonio Quartulli wrote: On Tue, Apr 17, 2012 at 01:24:55 +0200, Martin Hundebøll wrote: +static void bat_get_ethtool_stats(struct net_device *dev, + struct ethtool_stats *stats, u64 *data) +{ + struct bat_priv

[B.A.T.M.A.N.] [PATCH] net: cleanup unsigned to unsigned int

2012-04-17 Thread Sven Eckelmann
From: Eric Dumazet eric.duma...@gmail.com Use of unsigned int is preferred to bare unsigned in net tree. Signed-off-by: Eric Dumazet eric.duma...@gmail.com Signed-off-by: David S. Miller da...@davemloft.net Signed-off-by: Sven Eckelmann s...@narfation.org --- This one is already in net-next.

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Marek Lindner
On Tuesday, April 17, 2012 01:24:55 Martin Hundebøll wrote: Added additional counters in a bat_stats structure, which are exported through the ethtool api. The counters are specific to batman-adv and includes: forwarded packets management packets (OGMs at this point) translation table

Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: convert bat_priv-tt_crc from atomic_t to uint16_t

2012-04-17 Thread Marek Lindner
On Saturday, April 14, 2012 13:15:26 Antonio Quartulli wrote: In the code we neever need to atomically check and set the bat_priv-tt_crc field value. It is simply set and read once in different pieces of the code. Therefore this field can be safely be converted from atomic_t to uint16_t.

Re: [B.A.T.M.A.N.] [PATCH] net: cleanup unsigned to unsigned int

2012-04-17 Thread Marek Lindner
On Tuesday, April 17, 2012 09:45:42 Sven Eckelmann wrote: From: Eric Dumazet eric.duma...@gmail.com Use of unsigned int is preferred to bare unsigned in net tree. Applied in revision 18731af. Thanks, Marek

Re: [B.A.T.M.A.N.] Problem with multi-radio, multi-channel in batman-adv

2012-04-17 Thread Simon Wunderlich
Hey Puyou, On Mon, Apr 16, 2012 at 06:35:04PM +0800, puyou.lu wrote: Hi guys.   I’m trying to make a for nodes WMN using four devices with two wireless cards each. I would like to use three different channels to reduce the interference, like this:   [Node A] - channel 1 - [Node B] -

[B.A.T.M.A.N.] [PATCH 1/3] batman-adv: drop useless argument for arp_change_timeout()

2012-04-17 Thread Antonio Quartulli
The net_device structure already has a name field therefore we don't need to pass the name by using another parameter. Signed-off-by: Antonio Quartulli or...@autistici.org --- distributed-arp-table.c |4 ++-- distributed-arp-table.h |2 +- soft-interface.c|2 +- 3 files

[B.A.T.M.A.N.] [PATCH 2/3] batman-adv: introduce a boolean switch to enable/disable DAT

2012-04-17 Thread Antonio Quartulli
This patch introduces a boolean switch which enables D.A.T. (Distributed ARP Table) to be activated/deactivated at run-time. Signed-off-by: Antonio Quartulli or...@autistici.org --- bat_sysfs.c |7 + distributed-arp-table.c | 72

Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: introduce a boolean switch to enable/disable DAT

2012-04-17 Thread Marek Lindner
On Tuesday, April 17, 2012 12:24:53 Antonio Quartulli wrote: +static void arp_change_timeout(struct net_device *soft_iface, bool enable_dat) +{ + struct in_device *in_dev = in_dev_get(soft_iface); + if (!in_dev) { + pr_err(Unable to set ARP parameters for the batman

Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: introduce a boolean switch to enable/disable DAT

2012-04-17 Thread Marek Lindner
On Tuesday, April 17, 2012 12:24:53 Antonio Quartulli wrote: +static void arp_change_timeout(struct net_device *soft_iface, bool enable_dat) +{ + struct in_device *in_dev = in_dev_get(soft_iface); + if (!in_dev) { + pr_err(Unable to set ARP parameters for the batman

[B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...)

2012-04-17 Thread Antonio Quartulli
When the DAT component is not built, instead of having fake function like foo(...) we must use a static inline function in order to allow the compiler to check the number of the type of the passed arguments Signed-off-by: Antonio Quartulli or...@autistici.org --- distributed-arp-table.h | 53

Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: use static inline functions instead of foo(...)

2012-04-17 Thread Marek Lindner
On Tuesday, April 17, 2012 13:18:33 Antonio Quartulli wrote: When the DAT component is not built, instead of having fake function like foo(...) we must use a static inline function in order to allow the compiler to check the number of the type of the passed arguments Applied in revision

[B.A.T.M.A.N.] pull request: batman-adv 2012-04-17

2012-04-17 Thread Antonio Quartulli
Hello, here are a set of changes I would like to propose for next-next/3.5. Most of the patches are simple cleanups and small fixes. The only important change is patch 3 which changes the Originator Message sequence number starting value from 0 to a random generated value. Thank you,

[B.A.T.M.A.N.] [PATCH 01/11] batman-adv: move ogm initialization into the proper function

2012-04-17 Thread Antonio Quartulli
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Antonio Quartulli or...@autistici.org --- net/batman-adv/hard-interface.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/hard-interface.c

[B.A.T.M.A.N.] [PATCH 03/11] batman-adv: randomize initial seqno to avoid collision

2012-04-17 Thread Antonio Quartulli
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Antonio Quartulli or...@autistici.org --- net/batman-adv/bat_iv_ogm.c |5 + 1 file changed, 5 insertions(+) diff --git a/net/batman-adv/bat_iv_ogm.c

[B.A.T.M.A.N.] [PATCH 05/11] batman-adv: handle routing code initialization properly

2012-04-17 Thread Antonio Quartulli
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Antonio Quartulli or...@autistici.org --- net/batman-adv/bat_iv_ogm.c | 11 ++- net/batman-adv/hard-interface.c | 15 ++- net/batman-adv/types.h |

[B.A.T.M.A.N.] [PATCH 06/11] batman-adv: refactoring API: find generalized name for bat_ogm_init_primary callback

2012-04-17 Thread Antonio Quartulli
From: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Marek Lindner lindner_ma...@yahoo.de Signed-off-by: Antonio Quartulli or...@autistici.org --- net/batman-adv/bat_iv_ogm.c |4 ++-- net/batman-adv/hard-interface.c |2 +- net/batman-adv/main.c |2 +-

[B.A.T.M.A.N.] [PATCH 09/11] batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)

2012-04-17 Thread Antonio Quartulli
Instead of using sizeof(struct ethhdr) it is strongly recommended to use the kernel macro ETH_HLEN. This patch substitute each occurrence of the former expressione with the latter one. Signed-off-by: Antonio Quartulli or...@autistici.org --- net/batman-adv/bat_iv_ogm.c|7 +++

[B.A.T.M.A.N.] [PATCH 10/11] batman-adv: print OGM seq numbers as unsigned long

2012-04-17 Thread Antonio Quartulli
OGM sequence numbers are declared as uint32_t and so they have to printed using %u instead of %d in order to avoid wrong representations. Signed-off-by: Antonio Quartulli or...@autistici.org --- net/batman-adv/bat_iv_ogm.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[B.A.T.M.A.N.] [PATCH 11/11] batman-adv: skip the window protection test when the originator has no neighbours

2012-04-17 Thread Antonio Quartulli
When we receive an OGM from from a node for the first time, the last_real_seqno field of the orig_node structure has not been initialised yet. The value of this field is used to compute the current ogm-seqno window and therefore the protection mechanism will probably drop the packet due to an

[B.A.T.M.A.N.] Batman as a kernel module

2012-04-17 Thread Mitar
Hi! What are the reasons (except for performance) of Batman being a kernel module? Is there a way for running it in user-space? We have some servers where we get donated bandwidth, but as people are running also other stuff on those servers they do not really like adding kernel modules and

Re: [B.A.T.M.A.N.] Batman as a kernel module

2012-04-17 Thread Sven Eckelmann
On Tuesday, April 17, 2012 02:05:40 PM Mitar wrote: Would some compatibility layer be possible to have to run Batman in user-space? Are there any existing known? KVM Kind regards, Sven signature.asc Description: This is a digitally signed message part.

[B.A.T.M.A.N.] Determining on which node a client is connected to

2012-04-17 Thread Mitar
Hi! Is it possible to determine from central location (for example gateway) to which node a client is currently connected to? So from DHCP you can get MAC-IP translation, but how to get from MAC on which node client currently is? Mitar

[B.A.T.M.A.N.] batman-adv 2012.1.0 released

2012-04-17 Thread Marek Lindner
The B.A.T.M.A.N. team is delighted to announce its newest release, 2012.1.0, bringing mainly bug fixes and code cleanups. Also part of the release is a newly developed routing algorithm framework which allows switching between different routing algorithms. As the kernel module always depends

Re: [B.A.T.M.A.N.] Determining on which node a client is connected to

2012-04-17 Thread Marek Lindner
On Tuesday, April 17, 2012 14:15:49 Mitar wrote: Is it possible to determine from central location (for example gateway) to which node a client is currently connected to? So from DHCP you can get MAC-IP translation, but how to get from MAC on which node client currently is? Read the

Re: [B.A.T.M.A.N.] Determining on which node a client is connected to

2012-04-17 Thread Antonio Quartulli
On Tue, Apr 17, 2012 at 02:15:49PM +0200, Mitar wrote: Hi! Is it possible to determine from central location (for example gateway) to which node a client is currently connected to? Hello Mitar, if I correctly got your question, you want to know what the Global Translation Table of each node

Re: [B.A.T.M.A.N.] Batman as a kernel module

2012-04-17 Thread Antonio Quartulli
On Tue, Apr 17, 2012 at 02:05:40PM +0200, Mitar wrote: Hi! What are the reasons (except for performance) of Batman being a kernel module? Is there a way for running it in user-space? We have some servers where we get donated bandwidth, but as people are running also other stuff on those

[B.A.T.M.A.N.] [PATCH] batman-adv: fix types in README.external

2012-04-17 Thread Marek Lindner
Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- README.external |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.external b/README.external index 874ee7f..787172e 100644 --- a/README.external +++ b/README.external @@ -21,7 +21,7 @@ if you want to compile

[B.A.T.M.A.N.] [PATCH v2] batman-adv: fix typos in README.external

2012-04-17 Thread Marek Lindner
Signed-off-by: Marek Lindner lindner_ma...@yahoo.de --- Fixing typo in the subject! README.external |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.external b/README.external index 874ee7f..787172e 100644 --- a/README.external +++ b/README.external @@ -21,7

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Martin Hundebøll
Hi Antonio, Thank you for your comments. On 04/17/2012 09:12 AM, Antonio Quartulli wrote: On Tue, Apr 17, 2012 at 01:24:55 +0200, Martin Hundebøll wrote: @@ -488,6 +492,8 @@ bool dat_snoop_outgoing_arp_reply(struct bat_priv *bat_priv, arp_neigh_update(bat_priv, ip_src, hw_src);

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Martin Hundebøll
Hi Marek, On 04/17/2012 10:19 AM, Marek Lindner wrote: On Tuesday, April 17, 2012 01:24:55 Martin Hundebøll wrote: Added additional counters in a bat_stats structure, which are exported through the ethtool api. The counters are specific to batman-adv and includes: forwarded packets

Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Antonio Quartulli
On Tue, Apr 17, 2012 at 03:24:48PM +0200, Martin Hundebøll wrote: +struct bat_stats { + uint64_t forward; + uint64_t mgmt_tx; + uint64_t mgmt_rx; + uint64_t tt_request_tx; + uint64_t tt_request_rx; + uint64_t tt_response_tx; + uint64_t tt_response_rx; + uint64_t

[B.A.T.M.A.N.] Module crash when reading log and deleting interface

2012-04-17 Thread Martin Hundebøll
Hi, I can make the module crash by deleting eth0 from bat0, while reading the log with batctl log: root@OpenWrt:/# batctl ll all batman_adv: bat0: log_level: Changing from: 0 to: 31 root@OpenWrt:/# batctl log /dev/null root@OpenWrt:/# batctl if del eth0 batman_adv: bat0: Interface

[B.A.T.M.A.N.] [PATCHv2] batman-adv: Add get_ethtool_stats() support

2012-04-17 Thread Martin Hundebøll
Added additional counters in a bat_stats structure, which are exported through the ethtool api. The counters are specific to batman-adv and includes: forwarded packets management packets (OGMs at this point) translation table packets distributed arp table packets I would like you all to check

Re: [B.A.T.M.A.N.] Batman as a kernel module

2012-04-17 Thread Mitar
Hi! Thanks for both ideas. KVM sounds great. OK, so I have no more ideas against Batman. :-) And it got a go from Kostko. So this looks very good. :-) Mitar

[B.A.T.M.A.N.] Batman configuration and MTU

2012-04-17 Thread HeXiLeD
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have being doing some testing with several types of configurations with custom openwrt build and batman in oder to try to come with a basic default plug play ready to deploy firmware evolving the least changes possible other than the router's ip

[B.A.T.M.A.N.] [PATCH 0/5] Preparation for SPEEDY_JOIN/ROAM

2012-04-17 Thread Antonio Quartulli
Hello everybody, in preparation to my next patchset, which will enable clients to be detected from nodes in the network _before_ they are announced by means of the TT mechanism (more details will come within the companion email email of the related patchset), I'm sending this 4 patches that

[B.A.T.M.A.N.] [PATCH 1/5] batman-adv: don't delay OGM information announcement

2012-04-17 Thread Antonio Quartulli
In the current implementation the OGM is built and filled at the moment it is scheduled (1 originator interval before its sending). In this way, all the TT changes happening between OGM(seqno=X) and OGM(seqno=X+1) will be attached to OGM(seqno=X+2) (because when changes happened OGM(seqno=X+1) was

[B.A.T.M.A.N.] [PATCH 2/5] batman-adv: clear ADD+DEL (and viceversa) events in the same orig-interval

2012-04-17 Thread Antonio Quartulli
During an OGM-interval (time between two different OGM sendings) the same client could roam away and then roam back to us. In this case the node would add two events to the events list (that is going to be sent appended to the next OGM). A DEL one and an ADD one. Obviously they will only increase

[B.A.T.M.A.N.] [PATCH 3/5] batman-adv: let tt_global_entry_has_orig() return the orig_entry or NULL instead of 1 or 0 only

2012-04-17 Thread Antonio Quartulli
Instead of returning only 1 or 0 this function has to return the found orig_entry (if any). In this way, operations that have to to modify the found orig_entry structure will not need to reiterate over the list again to find the wanted node. Signed-off-by: Antonio Quartulli or...@autistici.org

[B.A.T.M.A.N.] [PATCH 4/5] batman-adv: update ttvn in case of client reannouncement

2012-04-17 Thread Antonio Quartulli
in various scenarios it would be possible that a node receives an ADD event for a client it already knows to belong to the advertiser. In this case the node has to update the global entry ttvn with the one carried by the OGM. Signed-off-by: Antonio Quartulli or...@autistici.org ---

[B.A.T.M.A.N.] [PATCH 5/5] batman-adv: beautify tt_global_add() argument list

2012-04-17 Thread Antonio Quartulli
Instead of adding a new bool argument each time it is needed, it is better (and simpler) to pass an 8bit flag argument which contains all the needed flags Signed-off-by: Antonio Quartulli or...@autistici.org --- routing.c |2 +- translation-table.c | 18 ++

Re: [B.A.T.M.A.N.] [PATCH 05/11] batman-adv: handle routing code initialization properly

2012-04-17 Thread David Miller
From: Antonio Quartulli or...@autistici.org Date: Tue, 17 Apr 2012 13:58:21 +0200 @@ -30,10 +30,11 @@ #include send.h #include bat_algo.h -static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) +static int bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) {

Re: [B.A.T.M.A.N.] [PATCH 03/11] batman-adv: randomize initial seqno to avoid collision

2012-04-17 Thread David Miller
From: Antonio Quartulli or...@autistici.org Date: Tue, 17 Apr 2012 13:58:19 +0200 @@ -33,6 +33,11 @@ static void bat_iv_ogm_iface_enable(struct hard_iface *hard_iface) { struct batman_ogm_packet *batman_ogm_packet; + unsigned long random_seqno; + + /* randomize initial

Re: [B.A.T.M.A.N.] [PATCH 10/11] batman-adv: print OGM seq numbers as unsigned long

2012-04-17 Thread David Miller
From: Antonio Quartulli or...@autistici.org Date: Tue, 17 Apr 2012 13:58:26 +0200 OGM sequence numbers are declared as uint32_t and so they have to printed using %u instead of %d in order to avoid wrong representations. Signed-off-by: Antonio Quartulli or...@autistici.org Fix this commit