Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
---
README | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/README b/README
index a9ae038..7bcc9f4 100644
--- a/README
+++ b/README
@@ -83,9 +83,9 @@ All mesh wide settings can be found in batman's own interface
folder:
# ls /sys/class/net/bat0/mesh/
-# aggregated_ogms gw_bandwidth hop_penalty
-# bonding gw_mode orig_interval
-# fragmentation gw_sel_class vis_mode
+# aggregated_ogms fragmentation gw_sel_class vis_mode
+# ap_isolation gw_bandwidth hop_penalty
+# bonding gw_mode orig_interval
There is a special folder for debugging information:
@@ -219,15 +219,16 @@ 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 tt entry added / changed / deleted
-3 - Enable all messages
+2 - Enable messages related to route added / changed / deleted
+4 - Enable messages related to translation table operations
+7 - Enable all messages
The debug output can be changed at runtime using the file
/sys/class/net/bat0/mesh/log_level. e.g.
# echo 2 > /sys/class/net/bat0/mesh/log_level
-will enable debug messages for when routes or TTs change.
+will enable debug messages for when routes change.
BATCTL
--
1.7.5.3
The tt_local_reset_flags() is actually used for one use case only. It is not
generalised enough to be used indifferent situations. This patch make it general
enough in order to let other code use it whenever a flag flip is requested over
the whole hash table (passed as parameter).
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
---
This patch depends on:
batman-adv: create a common substructure for tt_global/local_entry
translation-table.c | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/translation-table.c b/translation-table.c
index 76134bc..5b60aba 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -1695,19 +1695,20 @@ void tt_free(struct bat_priv *bat_priv)
kfree(bat_priv->tt_buff);
}
-/* This function will reset the specified flags from all the entries in
- * the given hash table and will increment num_local_tt for each involved
- * entry */
-static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
+/* This function will flip to new_value (if not already) the specified flags for
+ * all the entries in the given hash table and returns the number of modified
+ * entries */
+static uint16_t tt_flip_flags(struct hashtable_t *hash, uint16_t flags,
+ uint8_t new_value)
{
uint32_t i;
- struct hashtable_t *hash = bat_priv->tt_local_hash;
+ uint16_t changed_num = 0;
struct hlist_head *head;
struct hlist_node *node;
struct tt_common_entry *tt_common_entry;
if (!hash)
- return;
+ goto out;
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@ -1715,14 +1716,18 @@ static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
rcu_read_lock();
hlist_for_each_entry_rcu(tt_common_entry, node,
head, hash_entry) {
- if (!(tt_common_entry->flags & flags))
+ if ((tt_common_entry->flags & flags) != new_value)
continue;
- tt_common_entry->flags &= ~flags;
- atomic_inc(&bat_priv->num_local_tt);
+ /* depending on 'new_value', enable or disable the flags
+ * pointed by 'flags' */
+ tt_common_entry->flags &=
+ (~flags | (new_value ? flags : NO_FLAGS));
+ changed_num++;
}
rcu_read_unlock();
}
-
+out:
+ return changed_num;
}
/* Purge out all the tt local entries marked with TT_CLIENT_PENDING */
@@ -1766,7 +1771,11 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv)
void tt_commit_changes(struct bat_priv *bat_priv)
{
- tt_local_reset_flags(bat_priv, TT_CLIENT_NEW);
+ uint16_t changed_num = tt_flip_flags(bat_priv->tt_local_hash,
+ TT_CLIENT_NEW, 0);
+ /* all the reset entries have now to be effectively counted as local
+ * entries */
+ atomic_add(changed_num, &bat_priv->num_local_tt);
tt_local_purge_pending_clients(bat_priv);
/* Increment the TTVN only once per OGM interval */
--
1.7.3.4
Hi all!
After nico commit [0] batman-adv stopped working in openwrt backfire (
the crc16 modules is still kmod-crc16 in openwrt stable )
the batman-adv module refuse to load without error message on stdout
but saying that crc16 is missing on dmesg
selecting manually kernel modules -> other modules -> kmod-crc16 it work again
[0] https://dev.openwrt.org/changeset/28657/packages/net/batman-adv/Makefile
This series of patches is a request for comments on the redesigned
bridge loop avoidance. The general concept is described in the wiki
[1]. I've already performed a few testcases [2] which worked fine in
my kvm environment. No crashes while running or unloading the
extension either.
The last patch in the series uses the cached address of the primary
interface (the originator address known through the mesh) to save some
code at various positions, there may be side effects I don't see
however (e.g. implicit checking whether the module was configured
correctly was removed).
Marek already pointed quite a few issues out, these changes are
reflected in the respective commit logs. These commit comments will
be removed in the final version.
Any comments and suggestions are appreciated.
Thanks
Simon
[1] http://www.open-mesh.org/wiki/batman-adv/Bridge-loop-avoidance-II
[2] http://www.open-mesh.org/wiki/batman-adv/Bridge-loop-avoidance-Testcases
Simon Wunderlich (11):
batman-adv: remove old bridge loop avoidance code
batman-adv: add basic bridge loop avoidance code
batman-adv: make bridge loop avoidance switchable
batman-adv: export claim tables through debugfs
batman-adv: allow multiple entries in tt_global_entries
batman-adv: don't let backbone gateways exchange tt entries
batman-adv: add broadcast duplicate check
batman-adv: drop STP over batman
batman-adv: form groups in the bridge loop avoidance
batman-adv: Update README and sysfs description
[RFC] batman-adv: get primaries address through bat_priv->own_orig
Makefile.kbuild | 1 +
README | 28 +-
bat_debugfs.c | 18 +-
bat_sysfs.c | 4 +-
bridge_loop_avoidance.c | 1509 +++++++++++++++++++++++++++++++++++++++++++++++
bridge_loop_avoidance.h | 34 ++
compat.c | 16 +-
compat.h | 3 +-
hard-interface.c | 8 +-
icmp_socket.c | 12 +-
main.c | 9 +-
main.h | 9 +-
originator.c | 3 +-
packet.h | 16 +
routing.c | 41 +-
soft-interface.c | 490 +---------------
soft-interface.h | 2 -
sysfs-class-net-mesh | 9 +
translation-table.c | 366 ++++++++----
types.h | 70 ++-
unicast.c | 9 +-
vis.c | 20 +-
22 files changed, 1965 insertions(+), 712 deletions(-)
create mode 100644 bridge_loop_avoidance.c
create mode 100644 bridge_loop_avoidance.h
--
1.7.7.1
Hello people,
as most of you may already know, last summer I've been working on the
B.A.T.M.A.N.-Adv GSoC project named "DAT: Distributed ARP Table". For who wants
to get deeper into the details of the project there are two links:
- The GSoC proposal [1]
- The DAT wikipage on open-mesh.org [2], with status and ideas description
Just to recap: DAT is a distributes hash table meant to store ARP entries for
fast lookup. In a normal scenario, whenever a node wants to communicate with
another one, it first needs to issue a broadcast ARP request in order to
retrieve its PHY/MAC address. In a sparse network a broadcast message could be
lost several times before reaching the real destination so creating high
latencies. With DAT, every ARP entries (a pair [IP addr, MAC addr]) is stored on
a "computed" set of nodes, therefore in case of ARP request theses nodes can
directly be contacted (in unicast) and the needed information can be quickly
fetched.
Cheers,
Antonio
[1] http://www.google-melange.com/gsoc/project/google/gsoc2011/ordex/4001
[2] http://www.open-mesh.org/wiki/batman-adv/DAT
Hi all,
i thought it was a good idea to move the functions "start_mesh" and
"stop_mesh" from /etc/init.d/batman-adv script to a new file in
openwrt style "/lib/batman-adv/config.sh".
With this improvment it possible to recycle this two function to
operate with an hotplug script so when network restart, all batman
interface will be reconfigured automatically and I just work to do
this.
In this mail you can find batman-adv initscript updated to work in
this way and the batman-adv library file that must be located in
/lib/batman-adv/.
Any comment are apprecciated
--
Filippo Sallemi
Hi Marek,
Consider this code from "net/batman-adv/bitarray.c":
int bit_get_packet(void *priv, unsigned long *seq_bits,
int32_t seq_num_diff, int set_mark)
{
...
if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE)
|| (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
bat_dbg(DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
bit_reset_window(seq_bits);
if (set_mark)
bit_mark(seq_bits, 0);
return 1;
}
-----------------------------------
The defines from "main.h":
#define TQ_LOCAL_WINDOW_SIZE 64
#define EXPECTED_SEQNO_RANGE 65536
So that if() statement will translate to:
-----------------------------------
if ((seq_num_diff >= 64)
|| (seq_num_diff < 65536)) {
-----------------------------------
and this will always evaluate to true.
Detected by "cppcheck":
"[net/batman-adv/bitarray.c:157]: (warning) Mutual exclusion over ||
always evaluates to true. Did you intend to use && instead?"
Cheers,
Thomas