Hi,
I would like to propose following patches for net-next-2.6/2.6.40. They
include minor cleanups of comments, a big rename patch s/hna/tt/, but
also a remove some duplicated code. The spinlock which protected the
list of possible interfaces for batman-adv was completely replaced by
rtnl_lock because we want to be in sync with the rest of the network
stack and the extra spinlock made everything more complex without giving
any additional feature (and rtnl_lock was already used everywhere).
Related to this patch is also a fix which should prevent a deadlock
between the sysfs code and the event listener. Also the reference
counting in find_router was fixed when an error was detected after the
refcounter was already increased. The only feature is the support for
multiple vlans in the bridge loop detection code.
I will submit a patch to remove the atomic_dec_not_zero from main.h
after Linus accepted the patch you already saw.
thanks,
Sven
The following changes since commit 32ae9b221e788413ce68feaae2ca39e406211a0a:
batman-adv: Make bat_priv->primary_if an rcu protected pointer (2011-05-01 22:49:03 +0200)
are available in the git repository at:
git://git.open-mesh.org/ecsv/linux-merge.git batman-adv/next
Antonio Quartulli (1):
batman-adv: rename everything from *hna* into *tt* (translation table)
Daniele Furlan (1):
batman-adv: remove duplicate code from function is_bidirectional_neigh()
Marek Lindner (3):
batman-adv: remove misplaced comment
batman-adv: multi vlan support for bridge loop detection
batman-adv: Fix refcount imbalance in find_router
Sven Eckelmann (3):
batman-adv: Remove unnecessary hardif_list_lock
batman-adv: Avoid deadlock between rtnl_lock and s_active
batman-adv: Remove multiline comments from line ending
Documentation/networking/batman-adv.txt | 11 +-
net/batman-adv/aggregation.c | 16 +-
net/batman-adv/aggregation.h | 4 +-
net/batman-adv/bat_debugfs.c | 4 +-
net/batman-adv/bat_sysfs.c | 16 +-
net/batman-adv/hard-interface.c | 36 +--
net/batman-adv/main.c | 20 +-
net/batman-adv/main.h | 42 ++--
net/batman-adv/originator.c | 10 +-
net/batman-adv/packet.h | 5 +-
net/batman-adv/routing.c | 162 ++++++-------
net/batman-adv/routing.h | 6 +-
net/batman-adv/send.c | 16 +-
net/batman-adv/send.h | 2 +-
net/batman-adv/soft-interface.c | 409 +++++++++++++++++++++---------
net/batman-adv/translation-table.c | 417 ++++++++++++++++---------------
net/batman-adv/translation-table.h | 24 +-
net/batman-adv/types.h | 49 +++--
net/batman-adv/unicast.c | 2 +-
net/batman-adv/vis.c | 18 +-
20 files changed, 712 insertions(+), 557 deletions(-)
Hi all,
as anticipated some weeks ago, I'm working on a modification of
B.A.T.M.A.N. routing metric in order to take into account link
bit-rate.
As already exposed, in my opinion, it is important to consider
bit-rate because there isn't any correlation between TQ and the
physical capacity.
I have called the new metric PCE (Physical Capacity Estimation), which
is defined for each path as the minimum value of (tq_local * bit-rate)
among all the link forming it.
After a quick and dirty modification of the code, I've done some test
on two simple topologies to verify whether there is an improvement or
not. From this preliminary test seems that the improvement is
remarkable.
In the attached report there is a better explanation of the
modification, and the results from the tests. Any comment will be
appreciated!!
Regards.
--
Daniele Furlan
It is slightly irritating that comments after a long line span over
multiple lines without any code. It is easier to put them before the
actual code and reduce the number of lines which the eye has to read.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
This patch makes batman-adv nearly checkpatch clean again - the other part
was submitted to the checkpatch maintainer... maybe he fixes it now
(informed him some months ago and got no reactions - maybe the patch helps
him).
main.h | 40 +++++++++++++++++++++-------------------
packet.h | 3 +--
soft-interface.c | 4 ++--
types.h | 10 +++++-----
4 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/main.h b/main.h
index 4832f32..3ca3941 100644
--- a/main.h
+++ b/main.h
@@ -34,16 +34,18 @@
#define TQ_MAX_VALUE 255
#define JITTER 20
-#define TTL 50 /* Time To Live of broadcast messages */
-#define PURGE_TIMEOUT 200 /* purge originators after time in seconds if no
- * valid packet comes in -> TODO: check
- * influence on TQ_LOCAL_WINDOW_SIZE */
+ /* Time To Live of broadcast messages */
+#define TTL 50
+
+/* purge originators after time in seconds if no valid packet comes in
+ * -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */
+#define PURGE_TIMEOUT 200
#define TT_LOCAL_TIMEOUT 3600 /* in seconds */
-#define TQ_LOCAL_WINDOW_SIZE 64 /* sliding packet range of received originator
- * messages in squence numbers (should be a
- * multiple of our word size) */
+/* sliding packet range of received originator messages in squence numbers
+ * (should be a multiple of our word size) */
+#define TQ_LOCAL_WINDOW_SIZE 64
#define TQ_GLOBAL_WINDOW_SIZE 5
#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1
@@ -55,21 +57,20 @@
#define VIS_INTERVAL 5000 /* 5 seconds */
-/* how much worse secondary interfaces may be to
- * to be considered as bonding candidates */
-
+/* how much worse secondary interfaces may be to be considered as bonding
+ * candidates */
#define BONDING_TQ_THRESHOLD 50
-#define MAX_AGGREGATION_BYTES 512 /* should not be bigger than 512 bytes or
- * change the size of
- * forw_packet->direct_link_flags */
+/* should not be bigger than 512 bytes or change the size of
+ * forw_packet->direct_link_flags */
+#define MAX_AGGREGATION_BYTES 512
#define MAX_AGGREGATION_MS 100
#define SOFTIF_NEIGH_TIMEOUT 180000 /* 3 minutes */
+/* don't reset again within 30 seconds */
#define RESET_PROTECTION_MS 30000
#define EXPECTED_SEQNO_RANGE 65536
-/* don't reset again within 30 seconds */
#define MESH_INACTIVE 0
#define MESH_ACTIVE 1
@@ -84,12 +85,13 @@
#ifdef pr_fmt
#undef pr_fmt
#endif
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt /* Append 'batman-adv: ' before
- * kernel messages */
+/* Append 'batman-adv: ' before kernel messages */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#define DBG_BATMAN 1 /* all messages related to routing / flooding /
- * broadcasting / etc */
-#define DBG_ROUTES 2 /* route or tt entry added / changed / deleted */
+/* all messages related to routing / flooding / broadcasting / etc */
+#define DBG_BATMAN 1
+/* route or tt entry added / changed / deleted */
+#define DBG_ROUTES 2
#define DBG_ALL 3
diff --git a/packet.h b/packet.h
index c225c3a..eda9965 100644
--- a/packet.h
+++ b/packet.h
@@ -128,8 +128,7 @@ struct vis_packet {
uint8_t entries; /* number of entries behind this struct */
uint32_t seqno; /* sequence number */
uint8_t ttl; /* TTL */
- uint8_t vis_orig[6]; /* originator that informs about its
- * neighbors */
+ uint8_t vis_orig[6]; /* originator that announces its neighbors */
uint8_t target_orig[6]; /* who should receive this packet */
uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
} __packed;
diff --git a/soft-interface.c b/soft-interface.c
index ae10ecc..c76a33e 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -789,8 +789,8 @@ static void interface_setup(struct net_device *dev)
* have not been initialized yet
*/
dev->mtu = ETH_DATA_LEN;
- dev->hard_header_len = BAT_HEADER_LEN; /* reserve more space in the
- * skbuff for our header */
+ /* reserve more space in the skbuff for our header */
+ dev->hard_header_len = BAT_HEADER_LEN;
/* generate random address */
random_ether_addr(dev_addr);
diff --git a/types.h b/types.h
index 6b6c32e..fab70e8 100644
--- a/types.h
+++ b/types.h
@@ -89,11 +89,11 @@ struct orig_node {
struct hlist_node hash_entry;
struct bat_priv *bat_priv;
unsigned long last_frag_packet;
- spinlock_t ogm_cnt_lock; /* protects: bcast_own, bcast_own_sum,
- * neigh_node->real_bits,
- * neigh_node->real_packet_count */
- spinlock_t bcast_seqno_lock; /* protects bcast_bits,
- * last_bcast_seqno */
+ /* ogm_cnt_lock protects: bcast_own, bcast_own_sum,
+ * neigh_node->real_bits, neigh_node->real_packet_count */
+ spinlock_t ogm_cnt_lock;
+ /* bcast_seqno_lock protects bcast_bits, last_bcast_seqno */
+ spinlock_t bcast_seqno_lock;
atomic_t bond_candidates;
struct list_head bond_list;
};
--
1.7.5.1
160dd1399c4d589c0c5678a759e8ac7a7eefe64e introduced a line over 80 and
can not be accepted according to the Linux Coding Style.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
translation-table.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index 2bd6a31..7b72966 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -505,7 +505,8 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
goto out;
}
- seq_printf(seq, "Globally announced TT entries received via the mesh %s\n",
+ seq_printf(seq,
+ "Globally announced TT entries received via the mesh %s\n",
net_dev->name);
spin_lock_bh(&bat_priv->tt_ghash_lock);
--
1.7.5.1
On Friday 06 May 2011 19:21:58 Jose Armando wrote:
> Sorry seven here's is what looking for I would like to build a firmware
> that work like mesh and I been told that Batman is the best I'm new one
> this linux open source but I want to learn and I want to build mesh
> firmware that work with this
> 1 open ssid
> 2 close ssid with wpa password
> 3 mesh ssid by MAC addresses so I can mesh 20 routers
> 4 used captival portal
> Used Opendns
So, do you want batman-adv or batmand or bmxd or bmx6? Why is one of the
previous ones better then... lets say olsr or babeld. Do you want mesh for the
backbone or for the actual clients? Do you want to use multiple interfaces?
Why don't you use already existing solutions? What kind of router do you use?
What do you mean by open ssid? How do you think is a ssid and wpa are related?
What is a "ssid by MAC addresses"? Do you know what IBSS is? Why is a dns
provider relevant? Are you able to build OpenWRT? Do you know what an OpenWRT
feed is? Do you know how to build packages through OpenWRT feeds and integrate
them in a OpenWRT image?
Kind regards,
Sven
On Friday 06 May 2011 19:58:46 Sebastián D. Criado wrote:
> El 06/05/11 14:39, Sven Eckelmann escribió:
> > On Friday 06 May 2011 19:21:58 Jose Armando wrote:
> >> Sorry seven here's is what looking for I would like to build a firmware
> >> that work like mesh and I been told that Batman is the best I'm new one
> >> this linux open source but I want to learn and I want to build mesh
> >> firmware that work with this
> >> 1 open ssid
> >> 2 close ssid with wpa password
> >> 3 mesh ssid by MAC addresses so I can mesh 20 routers
> >> 4 used captival portal
> >> Used Opendns
>
> Our development has everything he suggests.
>
> http://nightwing.lugro-mesh.org.ar/en/
>
> Indeed. He knows this because it has been communicating with us for
> assistance.
>
> http://lugro.org.ar/pipermail/nightwing/2011-February/000288.html
>
> I do not understand that says "i want to build" when it should say "im
> using"
>
> In deed, today he communicated with us to offer a donation of equipment.
Ok, so everything is already solved.
Kind regards,
Sven