public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once
@ 2016-05-10 14:31 Marek Lindner
  2016-05-10 14:57 ` Antonio Quartulli
  2016-05-11  7:29 ` Sven Eckelmann
  0 siblings, 2 replies; 5+ messages in thread
From: Marek Lindner @ 2016-05-10 14:31 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

The ELP interval and throughput override interface settings are initialized
with default settings on every time an interface is added to a mesh.
This patch prevents this behavior by moving the configuration init to the
interface detection routine which runs only once per interface.

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
---
v2:
   * update commit message

 net/batman-adv/bat_v.c          | 5 -----
 net/batman-adv/bat_v_elp.c      | 1 -
 net/batman-adv/hard-interface.c | 7 +++++++
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index c16cd44..3c5d251 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -70,11 +70,6 @@ static int batadv_v_iface_enable(struct batadv_hard_iface *hard_iface)
 	if (ret < 0)
 		batadv_v_elp_iface_disable(hard_iface);
 
-	/* enable link throughput auto-detection by setting the throughput
-	 * override to zero
-	 */
-	atomic_set(&hard_iface->bat_v.throughput_override, 0);
-
 	return ret;
 }
 
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 8909d1e..cf0262b 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -344,7 +344,6 @@ int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface)
 	/* randomize initial seqno to avoid collision */
 	get_random_bytes(&random_seqno, sizeof(random_seqno));
 	atomic_set(&hard_iface->bat_v.elp_seqno, random_seqno);
-	atomic_set(&hard_iface->bat_v.elp_interval, 500);
 
 	/* assume full-duplex by default */
 	hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX;
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index db2009d..dd6a5a2 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -683,6 +683,13 @@ batadv_hardif_add_interface(struct net_device *net_dev)
 	if (batadv_is_wifi_netdev(net_dev))
 		hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
 
+	/* enable link throughput auto-detection by setting the throughput
+	 * override to zero
+	 */
+	atomic_set(&hard_iface->bat_v.throughput_override, 0);
+
+	atomic_set(&hard_iface->bat_v.elp_interval, 500);
+
 	/* extra reference for return */
 	kref_init(&hard_iface->refcount);
 	kref_get(&hard_iface->refcount);
-- 
2.8.0.rc3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once
  2016-05-10 14:31 [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once Marek Lindner
@ 2016-05-10 14:57 ` Antonio Quartulli
  2016-05-10 21:14   ` Marek Lindner
  2016-05-11  7:29 ` Sven Eckelmann
  1 sibling, 1 reply; 5+ messages in thread
From: Antonio Quartulli @ 2016-05-10 14:57 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Marek Lindner

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

On Tue, May 10, 2016 at 10:31:59PM +0800, Marek Lindner wrote:
> The ELP interval and throughput override interface settings are initialized
> with default settings on every time an interface is added to a mesh.
> This patch prevents this behavior by moving the configuration init to the
> interface detection routine which runs only once per interface.
> 
> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>

Acked-by: Antonio Quartulli <a@unstable.cc>

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once
  2016-05-10 14:57 ` Antonio Quartulli
@ 2016-05-10 21:14   ` Marek Lindner
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2016-05-10 21:14 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

[-- Attachment #1: Type: text/plain, Size: 587 bytes --]

On Tuesday, May 10, 2016 22:57:05 Antonio Quartulli wrote:
> On Tue, May 10, 2016 at 10:31:59PM +0800, Marek Lindner wrote:
> > The ELP interval and throughput override interface settings are
> > initialized
> > with default settings on every time an interface is added to a mesh.
> > This patch prevents this behavior by moving the configuration init to the
> > interface detection routine which runs only once per interface.
> >
> > Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
> 
> Acked-by: Antonio Quartulli <a@unstable.cc>

Applied in revision 71e957c.

Cheers,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once
  2016-05-10 14:31 [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once Marek Lindner
  2016-05-10 14:57 ` Antonio Quartulli
@ 2016-05-11  7:29 ` Sven Eckelmann
  2016-05-11  7:40   ` Marek Lindner
  1 sibling, 1 reply; 5+ messages in thread
From: Sven Eckelmann @ 2016-05-11  7:29 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

[-- Attachment #1: Type: text/plain, Size: 2411 bytes --]

On Tuesday 10 May 2016 22:31:59 Marek Lindner wrote:
> The ELP interval and throughput override interface settings are initialized
> with default settings on every time an interface is added to a mesh.
> This patch prevents this behavior by moving the configuration init to the
> interface detection routine which runs only once per interface.
> 
> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
> ---
[...]
> index db2009d..dd6a5a2 100644
> --- a/net/batman-adv/hard-interface.c
> +++ b/net/batman-adv/hard-interface.c
> @@ -683,6 +683,13 @@ batadv_hardif_add_interface(struct net_device *net_dev)
>  	if (batadv_is_wifi_netdev(net_dev))
>  		hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
>  
> +	/* enable link throughput auto-detection by setting the throughput
> +	 * override to zero
> +	 */
> +	atomic_set(&hard_iface->bat_v.throughput_override, 0);
> +
> +	atomic_set(&hard_iface->bat_v.elp_interval, 500);
> +
>  	/* extra reference for return */
>  	kref_init(&hard_iface->refcount);
>  	kref_get(&hard_iface->refcount);
> 

This needs to check if BATMAN_V is enabled:

    /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:689:31: error: no member 'bat_v' in struct batadv_hard_iface
    /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:691:31: error: no member 'bat_v' in struct batadv_hard_iface
    /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c: In function 'batadv_hardif_add_interface':
    /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:689:24: error: 'struct batadv_hard_iface' has no member named 'bat_v'
      atomic_set(&hard_iface->bat_v.throughput_override, 0);
                            ^
    /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:691:24: error: 'struct batadv_hard_iface' has no member named 'bat_v'
      atomic_set(&hard_iface->bat_v.elp_interval, 500);
                            ^
    make[2]: *** [/home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.o] Error 1
    make[1]: *** [_module_/home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv] Error 2
    make: *** [all] Error 2

This report was brought to you by todays build test [1] - the leading provider
of "omg, batman-adv doesn't build cleanly"

Kind regards,
	Sven

[1] https://lists.open-mesh.org/pipermail/linux-merge/2016-May/003168.html

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once
  2016-05-11  7:29 ` Sven Eckelmann
@ 2016-05-11  7:40   ` Marek Lindner
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2016-05-11  7:40 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

[-- Attachment #1: Type: text/plain, Size: 1418 bytes --]

On Wednesday, May 11, 2016 09:29:22 Sven Eckelmann wrote:
> This needs to check if BATMAN_V is enabled:
> 
>     /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.
> c:689:31: error: no member 'bat_v' in struct batadv_hard_iface
> /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:6
> 91:31: error: no member 'bat_v' in struct batadv_hard_iface
> /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:
> In function 'batadv_hardif_add_interface':
> /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.c:6
> 89:24: error: 'struct batadv_hard_iface' has no member named 'bat_v'
> atomic_set(&hard_iface->bat_v.throughput_override, 0);
>                             ^
>     /home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.
> c:691:24: error: 'struct batadv_hard_iface' has no member named 'bat_v'
> atomic_set(&hard_iface->bat_v.elp_interval, 500);
>                             ^
>     make[2]: ***
> [/home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv/hard-interface.o]
> Error 1 make[1]: ***
> [_module_/home/build_test/build_env/tmp.Fco0ibFY6r/net/batman-adv] Error 2
> make: *** [all] Error 2

OMG. 


> This report was brought to you by todays build test [1] - the leading
> provider of "omg, batman-adv doesn't build cleanly"

YMMD! I propose that to be the quote of the month!  :D

Cheers,
Marek


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-11  7:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 14:31 [B.A.T.M.A.N.] [PATCH v2] batman-adv: init ELP tweaking options only once Marek Lindner
2016-05-10 14:57 ` Antonio Quartulli
2016-05-10 21:14   ` Marek Lindner
2016-05-11  7:29 ` Sven Eckelmann
2016-05-11  7:40   ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox