* [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols
@ 2012-03-17 7:28 Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: refactor window_protected to avoid unnecessary return statement Marek Lindner
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Marek Lindner @ 2012-03-17 7:28 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
bat_iv_ogm.c | 9 ++++-----
originator.c | 1 +
types.h | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 85617c4..fa41307 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -43,7 +43,6 @@ static struct neigh_node *bat_iv_ogm_neigh_new(struct hard_iface *hard_iface,
goto out;
INIT_LIST_HEAD(&neigh_node->bonding_list);
- spin_lock_init(&neigh_node->tq_lock);
neigh_node->orig_node = orig_neigh;
neigh_node->if_incoming = hard_iface;
@@ -638,12 +637,12 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
if (is_duplicate)
continue;
- spin_lock_bh(&tmp_neigh_node->tq_lock);
+ spin_lock_bh(&tmp_neigh_node->lq_update_lock);
ring_buffer_set(tmp_neigh_node->tq_recv,
&tmp_neigh_node->tq_index, 0);
tmp_neigh_node->tq_avg =
ring_buffer_avg(tmp_neigh_node->tq_recv);
- spin_unlock_bh(&tmp_neigh_node->tq_lock);
+ spin_unlock_bh(&tmp_neigh_node->lq_update_lock);
}
if (!neigh_node) {
@@ -669,12 +668,12 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
orig_node->flags = batman_ogm_packet->flags;
neigh_node->last_seen = jiffies;
- spin_lock_bh(&neigh_node->tq_lock);
+ spin_lock_bh(&neigh_node->lq_update_lock);
ring_buffer_set(neigh_node->tq_recv,
&neigh_node->tq_index,
batman_ogm_packet->tq);
neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv);
- spin_unlock_bh(&neigh_node->tq_lock);
+ spin_unlock_bh(&neigh_node->lq_update_lock);
if (!is_duplicate) {
orig_node->last_ttl = batman_ogm_packet->header.ttl;
diff --git a/originator.c b/originator.c
index 4432d64..30889c9 100644
--- a/originator.c
+++ b/originator.c
@@ -99,6 +99,7 @@ struct neigh_node *neigh_node_new(struct hard_iface *hard_iface,
INIT_HLIST_NODE(&neigh_node->list);
memcpy(neigh_node->addr, neigh_addr, ETH_ALEN);
+ spin_lock_init(&neigh_node->lq_update_lock);
/* extra reference for return */
atomic_set(&neigh_node->refcount, 2);
diff --git a/types.h b/types.h
index 04d6cf5..15f538a 100644
--- a/types.h
+++ b/types.h
@@ -151,7 +151,7 @@ struct neigh_node {
struct rcu_head rcu;
struct orig_node *orig_node;
struct hard_iface *if_incoming;
- spinlock_t tq_lock; /* protects: tq_recv, tq_index */
+ spinlock_t lq_update_lock; /* protects: tq_recv, tq_index */
};
#ifdef CONFIG_BATMAN_ADV_BLA
--
1.7.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: refactor window_protected to avoid unnecessary return statement
2012-03-17 7:28 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
@ 2012-03-17 7:28 ` Marek Lindner
2012-03-20 13:07 ` Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: fix checkpatch string complaint Marek Lindner
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Marek Lindner @ 2012-03-17 7:28 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
Reported-by: David Laight <David.Laight@aculab.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
routing.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/routing.c b/routing.c
index 962a315..73aa20e 100644
--- a/routing.c
+++ b/routing.c
@@ -234,17 +234,14 @@ int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
{
if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
(seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
- if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) {
-
- *last_reset = jiffies;
- bat_dbg(DBG_BATMAN, bat_priv,
- "old packet received, start protection\n");
-
- return 0;
- } else {
+ if (!has_timed_out(*last_reset, RESET_PROTECTION_MS))
return 1;
- }
+
+ *last_reset = jiffies;
+ bat_dbg(DBG_BATMAN, bat_priv,
+ "old packet received, start protection\n");
}
+
return 0;
}
--
1.7.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: fix checkpatch string complaint
2012-03-17 7:28 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: refactor window_protected to avoid unnecessary return statement Marek Lindner
@ 2012-03-17 7:28 ` Marek Lindner
2012-03-20 13:08 ` Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: fix checkpatch opening parenthesis complaint Marek Lindner
2012-03-20 13:05 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
3 siblings, 1 reply; 8+ messages in thread
From: Marek Lindner @ 2012-03-17 7:28 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
Regression introduced by: f76d019194e0a88c57371df169ecc979690a04c2
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
bat_iv_ogm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index fa41307..994369d 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -1061,8 +1061,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
if (batman_ogm_packet->flags & NOT_BEST_NEXT_HOP) {
bat_dbg(DBG_BATMAN, bat_priv,
- "Drop packet: ignoring all packets not forwarded from "
- "the best next hop (sender: %pM)\n", ethhdr->h_source);
+ "Drop packet: ignoring all packets not forwarded from the best next hop (sender: %pM)\n",
+ ethhdr->h_source);
return;
}
--
1.7.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: fix checkpatch opening parenthesis complaint
2012-03-17 7:28 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: refactor window_protected to avoid unnecessary return statement Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: fix checkpatch string complaint Marek Lindner
@ 2012-03-17 7:28 ` Marek Lindner
2012-03-20 13:10 ` Marek Lindner
2012-03-20 13:05 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
3 siblings, 1 reply; 8+ messages in thread
From: Marek Lindner @ 2012-03-17 7:28 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Marek Lindner
Regression introduced by: 7c73d4c1d61b3db2f8b6bdd999ecebd231429082
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
bat_sysfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/bat_sysfs.c b/bat_sysfs.c
index 35c15e9..d0f8453 100644
--- a/bat_sysfs.c
+++ b/bat_sysfs.c
@@ -441,7 +441,7 @@ static BAT_ATTR(gw_mode, S_IRUGO | S_IWUSR, show_gw_mode, store_gw_mode);
BAT_ATTR_SIF_UINT(orig_interval, S_IRUGO | S_IWUSR, 2 * JITTER, INT_MAX, NULL);
BAT_ATTR_SIF_UINT(hop_penalty, S_IRUGO | S_IWUSR, 0, TQ_MAX_VALUE, NULL);
BAT_ATTR_SIF_UINT(gw_sel_class, S_IRUGO | S_IWUSR, 1, TQ_MAX_VALUE,
- post_gw_deselect);
+ post_gw_deselect);
static BAT_ATTR(gw_bandwidth, S_IRUGO | S_IWUSR, show_gw_bwidth,
store_gw_bwidth);
#ifdef CONFIG_BATMAN_ADV_DEBUG
--
1.7.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols
2012-03-17 7:28 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
` (2 preceding siblings ...)
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: fix checkpatch opening parenthesis complaint Marek Lindner
@ 2012-03-20 13:05 ` Marek Lindner
3 siblings, 0 replies; 8+ messages in thread
From: Marek Lindner @ 2012-03-20 13:05 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Saturday, March 17, 2012 08:28:32 Marek Lindner wrote:
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> ---
> bat_iv_ogm.c | 9 ++++-----
> originator.c | 1 +
> types.h | 2 +-
> 3 files changed, 6 insertions(+), 6 deletions(-)
Applied in revision 6cc8dda.
Regards,
Marek
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-03-20 13:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-17 7:28 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: refactor window_protected to avoid unnecessary return statement Marek Lindner
2012-03-20 13:07 ` Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: fix checkpatch string complaint Marek Lindner
2012-03-20 13:08 ` Marek Lindner
2012-03-17 7:28 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: fix checkpatch opening parenthesis complaint Marek Lindner
2012-03-20 13:10 ` Marek Lindner
2012-03-20 13:05 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: prepare lq_update_lock to be shared among different protocols Marek Lindner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.