All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] pull request for net-next: batman-adv 2017-05-24
@ 2018-05-24 12:02 ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Hi David,

here is a our feature/cleanup pull request of batman-adv to go into net-next.

Please pull or let me know of any problem!

Thank you,
      Simon

The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:

  Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)

are available in the git repository at:

  git://git.open-mesh.org/linux-merge.git tags/batadv-next-for-davem-20180524

for you to fetch changes up to 18cfb44cf1845d11d50f4733e039acb8b377c8eb:

  batman-adv: enable B.A.T.M.A.N. V compilation by default (2018-05-14 09:31:17 +0200)

----------------------------------------------------------------
This feature/cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - Disable batman-adv debugfs by default, by Sven Eckelmann

 - Improve handling mesh nodes with multicast optimizations disabled,
   by Linus Luessing

 - Avoid bool in structs, by Sven Eckelmann

 - Allocate less memory when debugfs is disabled, by Sven Eckelmann

 - Fix batadv_interface_tx return data type, by Luc Van Oostenryck

 - improve link speed handling for virtual interfaces, by Marek Lindner

 - Enable BATMAN V algorithm by default, by Marek Lindner

----------------------------------------------------------------
Linus Lüssing (1):
      batman-adv: Avoid old nodes disabling multicast optimizations completely

Luc Van Oostenryck (1):
      batman-adv: fix batadv_interface_tx()'s return type

Marek Lindner (2):
      batman-adv: disable ethtool link speed detection when auto negotiation off
      batman-adv: enable B.A.T.M.A.N. V compilation by default

Simon Wunderlich (1):
      batman-adv: Start new development cycle

Sven Eckelmann (3):
      batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
      batman-adv: Avoid bool in structures
      batman-adv: Remove unused dentry without DEBUGFS

 net/batman-adv/Kconfig          |  6 +++---
 net/batman-adv/bat_v_elp.c      | 15 ++++++++++++++-
 net/batman-adv/main.h           |  2 +-
 net/batman-adv/multicast.c      | 29 ++++++-----------------------
 net/batman-adv/soft-interface.c |  5 ++---
 net/batman-adv/types.h          | 23 +++++++++++++----------
 6 files changed, 39 insertions(+), 41 deletions(-)

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

* [B.A.T.M.A.N.] [PATCH 0/8] pull request for net-next: batman-adv 2017-05-24
@ 2018-05-24 12:02 ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Hi David,

here is a our feature/cleanup pull request of batman-adv to go into net-next.

Please pull or let me know of any problem!

Thank you,
      Simon

The following changes since commit 60cc43fc888428bb2f18f08997432d426a243338:

  Linux 4.17-rc1 (2018-04-15 18:24:20 -0700)

are available in the git repository at:

  git://git.open-mesh.org/linux-merge.git tags/batadv-next-for-davem-20180524

for you to fetch changes up to 18cfb44cf1845d11d50f4733e039acb8b377c8eb:

  batman-adv: enable B.A.T.M.A.N. V compilation by default (2018-05-14 09:31:17 +0200)

----------------------------------------------------------------
This feature/cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - Disable batman-adv debugfs by default, by Sven Eckelmann

 - Improve handling mesh nodes with multicast optimizations disabled,
   by Linus Luessing

 - Avoid bool in structs, by Sven Eckelmann

 - Allocate less memory when debugfs is disabled, by Sven Eckelmann

 - Fix batadv_interface_tx return data type, by Luc Van Oostenryck

 - improve link speed handling for virtual interfaces, by Marek Lindner

 - Enable BATMAN V algorithm by default, by Marek Lindner

----------------------------------------------------------------
Linus Lüssing (1):
      batman-adv: Avoid old nodes disabling multicast optimizations completely

Luc Van Oostenryck (1):
      batman-adv: fix batadv_interface_tx()'s return type

Marek Lindner (2):
      batman-adv: disable ethtool link speed detection when auto negotiation off
      batman-adv: enable B.A.T.M.A.N. V compilation by default

Simon Wunderlich (1):
      batman-adv: Start new development cycle

Sven Eckelmann (3):
      batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
      batman-adv: Avoid bool in structures
      batman-adv: Remove unused dentry without DEBUGFS

 net/batman-adv/Kconfig          |  6 +++---
 net/batman-adv/bat_v_elp.c      | 15 ++++++++++++++-
 net/batman-adv/main.h           |  2 +-
 net/batman-adv/multicast.c      | 29 ++++++-----------------------
 net/batman-adv/soft-interface.c |  5 ++---
 net/batman-adv/types.h          | 23 +++++++++++++----------
 6 files changed, 39 insertions(+), 41 deletions(-)

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

* [PATCH 1/8] batman-adv: Start new development cycle
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 057a28a9fe88..8da3c9336111 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -25,7 +25,7 @@
 #define BATADV_DRIVER_DEVICE "batman-adv"
 
 #ifndef BATADV_SOURCE_VERSION
-#define BATADV_SOURCE_VERSION "2018.1"
+#define BATADV_SOURCE_VERSION "2018.2"
 #endif
 
 /* B.A.T.M.A.N. parameters */
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 1/8] batman-adv: Start new development cycle
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/main.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 057a28a9fe88..8da3c9336111 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -25,7 +25,7 @@
 #define BATADV_DRIVER_DEVICE "batman-adv"
 
 #ifndef BATADV_SOURCE_VERSION
-#define BATADV_SOURCE_VERSION "2018.1"
+#define BATADV_SOURCE_VERSION "2018.2"
 #endif
 
 /* B.A.T.M.A.N. parameters */
-- 
2.11.0


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

* [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

All tools which were known to the batman-adv development team are
supporting the batman-adv netlink interface since a while. Also debugfs is
not supported for batman-adv interfaces in any non-default netns. Thus
disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
most systems. It is still possible to enable it in case it is still
required in a specific setup.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index e4e2e02b7380..bee034a95208 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
 	bool "batman-adv debugfs entries"
 	depends on BATMAN_ADV
 	depends on DEBUG_FS
-	default y
+	default n
 	help
 	  Enable this to export routing related debug tables via debugfs.
 	  The information for each soft-interface and used hard-interface can be
 	  found under batman_adv/
 
-	  If unsure, say Y.
+	  If unsure, say N.
 
 config BATMAN_ADV_DEBUG
 	bool "B.A.T.M.A.N. debugging"
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

All tools which were known to the batman-adv development team are
supporting the batman-adv netlink interface since a while. Also debugfs is
not supported for batman-adv interfaces in any non-default netns. Thus
disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
most systems. It is still possible to enable it in case it is still
required in a specific setup.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index e4e2e02b7380..bee034a95208 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
 	bool "batman-adv debugfs entries"
 	depends on BATMAN_ADV
 	depends on DEBUG_FS
-	default y
+	default n
 	help
 	  Enable this to export routing related debug tables via debugfs.
 	  The information for each soft-interface and used hard-interface can be
 	  found under batman_adv/
 
-	  If unsure, say Y.
+	  If unsure, say N.
 
 config BATMAN_ADV_DEBUG
 	bool "B.A.T.M.A.N. debugging"
-- 
2.11.0


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

* [PATCH 3/8] batman-adv: Avoid old nodes disabling multicast optimizations completely
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Linus Lüssing, Sven Eckelmann,
	Simon Wunderlich

From: Linus Lüssing <linus.luessing@c0d3.blue>

Instead of disabling multicast optimizations mesh-wide once a node with
no multicast optimizations capabilities joins the mesh, do the
following:

Just insert such nodes into the WANT_ALL_IPV4/IPV6 lists. This is
sufficient to avoid multicast packet loss to such unsupportive nodes.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/multicast.c      | 29 ++++++-----------------------
 net/batman-adv/soft-interface.c |  1 -
 net/batman-adv/types.h          |  3 ---
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index a11d3d89f012..36fd7b06c7cc 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -815,9 +815,6 @@ static int batadv_mcast_forw_mode_check(struct batadv_priv *bat_priv,
 	if (!atomic_read(&bat_priv->multicast_mode))
 		return -EINVAL;
 
-	if (atomic_read(&bat_priv->mcast.num_disabled))
-		return -EINVAL;
-
 	switch (ntohs(ethhdr->h_proto)) {
 	case ETH_P_IP:
 		return batadv_mcast_forw_mode_check_ipv4(bat_priv, skb,
@@ -1183,33 +1180,23 @@ static void batadv_mcast_tvlv_ogm_handler(struct batadv_priv *bat_priv,
 {
 	bool orig_mcast_enabled = !(flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND);
 	u8 mcast_flags = BATADV_NO_FLAGS;
-	bool orig_initialized;
 
 	if (orig_mcast_enabled && tvlv_value &&
 	    tvlv_value_len >= sizeof(mcast_flags))
 		mcast_flags = *(u8 *)tvlv_value;
 
+	if (!orig_mcast_enabled) {
+		mcast_flags |= BATADV_MCAST_WANT_ALL_IPV4;
+		mcast_flags |= BATADV_MCAST_WANT_ALL_IPV6;
+	}
+
 	spin_lock_bh(&orig->mcast_handler_lock);
-	orig_initialized = test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
-				    &orig->capa_initialized);
 
-	/* If mcast support is turned on decrease the disabled mcast node
-	 * counter only if we had increased it for this node before. If this
-	 * is a completely new orig_node no need to decrease the counter.
-	 */
 	if (orig_mcast_enabled &&
 	    !test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities)) {
-		if (orig_initialized)
-			atomic_dec(&bat_priv->mcast.num_disabled);
 		set_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities);
-	/* If mcast support is being switched off or if this is an initial
-	 * OGM without mcast support then increase the disabled mcast
-	 * node counter.
-	 */
 	} else if (!orig_mcast_enabled &&
-		   (test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) ||
-		    !orig_initialized)) {
-		atomic_inc(&bat_priv->mcast.num_disabled);
+		   test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities)) {
 		clear_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities);
 	}
 
@@ -1595,10 +1582,6 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 
 	spin_lock_bh(&orig->mcast_handler_lock);
 
-	if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) &&
-	    test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capa_initialized))
-		atomic_dec(&bat_priv->mcast.num_disabled);
-
 	batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
 	batadv_mcast_want_ipv4_update(bat_priv, orig, BATADV_NO_FLAGS);
 	batadv_mcast_want_ipv6_update(bat_priv, orig, BATADV_NO_FLAGS);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index edeffcb9f3a2..67065e35de51 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -796,7 +796,6 @@ static int batadv_softif_init_late(struct net_device *dev)
 	bat_priv->mcast.querier_ipv6.shadowing = false;
 	bat_priv->mcast.flags = BATADV_NO_FLAGS;
 	atomic_set(&bat_priv->multicast_mode, 1);
-	atomic_set(&bat_priv->mcast.num_disabled, 0);
 	atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0);
 	atomic_set(&bat_priv->mcast.num_want_all_ipv4, 0);
 	atomic_set(&bat_priv->mcast.num_want_all_ipv6, 0);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 476b052ad982..0174f79e955a 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1212,9 +1212,6 @@ struct batadv_priv_mcast {
 	/** @bridged: whether the soft interface has a bridge on top */
 	bool bridged;
 
-	/** @num_disabled: number of nodes that have no mcast tvlv */
-	atomic_t num_disabled;
-
 	/**
 	 * @num_want_all_unsnoopables: number of nodes wanting unsnoopable IP
 	 *  traffic
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 3/8] batman-adv: Avoid old nodes disabling multicast optimizations completely
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Linus Lüssing, Sven Eckelmann,
	Simon Wunderlich

From: Linus Lüssing <linus.luessing@c0d3.blue>

Instead of disabling multicast optimizations mesh-wide once a node with
no multicast optimizations capabilities joins the mesh, do the
following:

Just insert such nodes into the WANT_ALL_IPV4/IPV6 lists. This is
sufficient to avoid multicast packet loss to such unsupportive nodes.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/multicast.c      | 29 ++++++-----------------------
 net/batman-adv/soft-interface.c |  1 -
 net/batman-adv/types.h          |  3 ---
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index a11d3d89f012..36fd7b06c7cc 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -815,9 +815,6 @@ static int batadv_mcast_forw_mode_check(struct batadv_priv *bat_priv,
 	if (!atomic_read(&bat_priv->multicast_mode))
 		return -EINVAL;
 
-	if (atomic_read(&bat_priv->mcast.num_disabled))
-		return -EINVAL;
-
 	switch (ntohs(ethhdr->h_proto)) {
 	case ETH_P_IP:
 		return batadv_mcast_forw_mode_check_ipv4(bat_priv, skb,
@@ -1183,33 +1180,23 @@ static void batadv_mcast_tvlv_ogm_handler(struct batadv_priv *bat_priv,
 {
 	bool orig_mcast_enabled = !(flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND);
 	u8 mcast_flags = BATADV_NO_FLAGS;
-	bool orig_initialized;
 
 	if (orig_mcast_enabled && tvlv_value &&
 	    tvlv_value_len >= sizeof(mcast_flags))
 		mcast_flags = *(u8 *)tvlv_value;
 
+	if (!orig_mcast_enabled) {
+		mcast_flags |= BATADV_MCAST_WANT_ALL_IPV4;
+		mcast_flags |= BATADV_MCAST_WANT_ALL_IPV6;
+	}
+
 	spin_lock_bh(&orig->mcast_handler_lock);
-	orig_initialized = test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
-				    &orig->capa_initialized);
 
-	/* If mcast support is turned on decrease the disabled mcast node
-	 * counter only if we had increased it for this node before. If this
-	 * is a completely new orig_node no need to decrease the counter.
-	 */
 	if (orig_mcast_enabled &&
 	    !test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities)) {
-		if (orig_initialized)
-			atomic_dec(&bat_priv->mcast.num_disabled);
 		set_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities);
-	/* If mcast support is being switched off or if this is an initial
-	 * OGM without mcast support then increase the disabled mcast
-	 * node counter.
-	 */
 	} else if (!orig_mcast_enabled &&
-		   (test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) ||
-		    !orig_initialized)) {
-		atomic_inc(&bat_priv->mcast.num_disabled);
+		   test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities)) {
 		clear_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities);
 	}
 
@@ -1595,10 +1582,6 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 
 	spin_lock_bh(&orig->mcast_handler_lock);
 
-	if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capabilities) &&
-	    test_bit(BATADV_ORIG_CAPA_HAS_MCAST, &orig->capa_initialized))
-		atomic_dec(&bat_priv->mcast.num_disabled);
-
 	batadv_mcast_want_unsnoop_update(bat_priv, orig, BATADV_NO_FLAGS);
 	batadv_mcast_want_ipv4_update(bat_priv, orig, BATADV_NO_FLAGS);
 	batadv_mcast_want_ipv6_update(bat_priv, orig, BATADV_NO_FLAGS);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index edeffcb9f3a2..67065e35de51 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -796,7 +796,6 @@ static int batadv_softif_init_late(struct net_device *dev)
 	bat_priv->mcast.querier_ipv6.shadowing = false;
 	bat_priv->mcast.flags = BATADV_NO_FLAGS;
 	atomic_set(&bat_priv->multicast_mode, 1);
-	atomic_set(&bat_priv->mcast.num_disabled, 0);
 	atomic_set(&bat_priv->mcast.num_want_all_unsnoopables, 0);
 	atomic_set(&bat_priv->mcast.num_want_all_ipv4, 0);
 	atomic_set(&bat_priv->mcast.num_want_all_ipv6, 0);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 476b052ad982..0174f79e955a 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1212,9 +1212,6 @@ struct batadv_priv_mcast {
 	/** @bridged: whether the soft interface has a bridge on top */
 	bool bridged;
 
-	/** @num_disabled: number of nodes that have no mcast tvlv */
-	atomic_t num_disabled;
-
 	/**
 	 * @num_want_all_unsnoopables: number of nodes wanting unsnoopable IP
 	 *  traffic
-- 
2.11.0


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

* [PATCH 4/8] batman-adv: Avoid bool in structures
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

Using the bool type for structure member is considered inappropriate [1]
for the kernel. Its size is not well defined (but usually 1 byte but maybe
also 4 byte).

[1] https://lkml.org/lkml/2017/11/21/384

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/types.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 0174f79e955a..3b3fc146b30d 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1160,13 +1160,13 @@ struct batadv_priv_dat {
  */
 struct batadv_mcast_querier_state {
 	/** @exists: whether a querier exists in the mesh */
-	bool exists;
+	unsigned char exists:1;
 
 	/**
 	 * @shadowing: if a querier exists, whether it is potentially shadowing
 	 *  multicast listeners (i.e. querier is behind our own bridge segment)
 	 */
-	bool shadowing;
+	unsigned char shadowing:1;
 };
 
 /**
@@ -1207,10 +1207,10 @@ struct batadv_priv_mcast {
 	u8 flags;
 
 	/** @enabled: whether the multicast tvlv is currently enabled */
-	bool enabled;
+	unsigned char enabled:1;
 
 	/** @bridged: whether the soft interface has a bridge on top */
-	bool bridged;
+	unsigned char bridged:1;
 
 	/**
 	 * @num_want_all_unsnoopables: number of nodes wanting unsnoopable IP
@@ -1389,7 +1389,7 @@ struct batadv_tp_vars {
 	atomic_t dup_acks;
 
 	/** @fast_recovery: true if in Fast Recovery mode */
-	bool fast_recovery;
+	unsigned char fast_recovery:1;
 
 	/** @recover: last sent seqno when entering Fast Recovery */
 	u32 recover;
@@ -2046,10 +2046,10 @@ struct batadv_skb_cb {
 	 * @decoded: Marks a skb as decoded, which is checked when searching for
 	 *  coding opportunities in network-coding.c
 	 */
-	bool decoded;
+	unsigned char decoded:1;
 
 	/** @num_bcasts: Counter for broadcast packet retransmissions */
-	unsigned int num_bcasts;
+	unsigned char num_bcasts;
 };
 
 /**
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 4/8] batman-adv: Avoid bool in structures
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

Using the bool type for structure member is considered inappropriate [1]
for the kernel. Its size is not well defined (but usually 1 byte but maybe
also 4 byte).

[1] https://lkml.org/lkml/2017/11/21/384

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/types.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 0174f79e955a..3b3fc146b30d 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -1160,13 +1160,13 @@ struct batadv_priv_dat {
  */
 struct batadv_mcast_querier_state {
 	/** @exists: whether a querier exists in the mesh */
-	bool exists;
+	unsigned char exists:1;
 
 	/**
 	 * @shadowing: if a querier exists, whether it is potentially shadowing
 	 *  multicast listeners (i.e. querier is behind our own bridge segment)
 	 */
-	bool shadowing;
+	unsigned char shadowing:1;
 };
 
 /**
@@ -1207,10 +1207,10 @@ struct batadv_priv_mcast {
 	u8 flags;
 
 	/** @enabled: whether the multicast tvlv is currently enabled */
-	bool enabled;
+	unsigned char enabled:1;
 
 	/** @bridged: whether the soft interface has a bridge on top */
-	bool bridged;
+	unsigned char bridged:1;
 
 	/**
 	 * @num_want_all_unsnoopables: number of nodes wanting unsnoopable IP
@@ -1389,7 +1389,7 @@ struct batadv_tp_vars {
 	atomic_t dup_acks;
 
 	/** @fast_recovery: true if in Fast Recovery mode */
-	bool fast_recovery;
+	unsigned char fast_recovery:1;
 
 	/** @recover: last sent seqno when entering Fast Recovery */
 	u32 recover;
@@ -2046,10 +2046,10 @@ struct batadv_skb_cb {
 	 * @decoded: Marks a skb as decoded, which is checked when searching for
 	 *  coding opportunities in network-coding.c
 	 */
-	bool decoded;
+	unsigned char decoded:1;
 
 	/** @num_bcasts: Counter for broadcast packet retransmissions */
-	unsigned int num_bcasts;
+	unsigned char num_bcasts;
 };
 
 /**
-- 
2.11.0


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

* [PATCH 5/8] batman-adv: Remove unused dentry without DEBUGFS
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

The debug_dir variable in the main structures is only accessed when
CONFIG_BATMAN_ADV_DEBUGFS is enabled. It can be dropped to potentially save
some bytes of memory.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/types.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 3b3fc146b30d..360357f83f20 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -215,10 +215,12 @@ struct batadv_hard_iface {
 	struct batadv_hard_iface_bat_v bat_v;
 #endif
 
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
 	/**
 	 * @debug_dir: dentry for nc subdir in batman-adv directory in debugfs
 	 */
 	struct dentry *debug_dir;
+#endif
 
 	/**
 	 * @neigh_list: list of unique single hop neighbors via this interface
@@ -1242,10 +1244,12 @@ struct batadv_priv_nc {
 	/** @work: work queue callback item for cleanup */
 	struct delayed_work work;
 
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
 	/**
 	 * @debug_dir: dentry for nc subdir in batman-adv directory in debugfs
 	 */
 	struct dentry *debug_dir;
+#endif
 
 	/**
 	 * @min_tq: only consider neighbors for encoding if neigh_tq > min_tq
@@ -1598,8 +1602,10 @@ struct batadv_priv {
 	/** @mesh_obj: kobject for sysfs mesh subdirectory */
 	struct kobject *mesh_obj;
 
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
 	/** @debug_dir: dentry for debugfs batman-adv subdirectory */
 	struct dentry *debug_dir;
+#endif
 
 	/** @forw_bat_list: list of aggregated OGMs that will be forwarded */
 	struct hlist_head forw_bat_list;
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 5/8] batman-adv: Remove unused dentry without DEBUGFS
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann, Simon Wunderlich

From: Sven Eckelmann <sven@narfation.org>

The debug_dir variable in the main structures is only accessed when
CONFIG_BATMAN_ADV_DEBUGFS is enabled. It can be dropped to potentially save
some bytes of memory.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/types.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 3b3fc146b30d..360357f83f20 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -215,10 +215,12 @@ struct batadv_hard_iface {
 	struct batadv_hard_iface_bat_v bat_v;
 #endif
 
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
 	/**
 	 * @debug_dir: dentry for nc subdir in batman-adv directory in debugfs
 	 */
 	struct dentry *debug_dir;
+#endif
 
 	/**
 	 * @neigh_list: list of unique single hop neighbors via this interface
@@ -1242,10 +1244,12 @@ struct batadv_priv_nc {
 	/** @work: work queue callback item for cleanup */
 	struct delayed_work work;
 
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
 	/**
 	 * @debug_dir: dentry for nc subdir in batman-adv directory in debugfs
 	 */
 	struct dentry *debug_dir;
+#endif
 
 	/**
 	 * @min_tq: only consider neighbors for encoding if neigh_tq > min_tq
@@ -1598,8 +1602,10 @@ struct batadv_priv {
 	/** @mesh_obj: kobject for sysfs mesh subdirectory */
 	struct kobject *mesh_obj;
 
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
 	/** @debug_dir: dentry for debugfs batman-adv subdirectory */
 	struct dentry *debug_dir;
+#endif
 
 	/** @forw_bat_list: list of aggregated OGMs that will be forwarded */
 	struct hlist_head forw_bat_list;
-- 
2.11.0


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

* [PATCH 6/8] batman-adv: fix batadv_interface_tx()'s return type
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Luc Van Oostenryck, Sven Eckelmann,
	Simon Wunderlich

From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
[sven@narfation.org: fixed alignment]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/soft-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 67065e35de51..1485263a348b 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -188,8 +188,8 @@ static void batadv_interface_set_rx_mode(struct net_device *dev)
 {
 }
 
-static int batadv_interface_tx(struct sk_buff *skb,
-			       struct net_device *soft_iface)
+static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
+				       struct net_device *soft_iface)
 {
 	struct ethhdr *ethhdr;
 	struct batadv_priv *bat_priv = netdev_priv(soft_iface);
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 6/8] batman-adv: fix batadv_interface_tx()'s return type
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Luc Van Oostenryck, Sven Eckelmann,
	Simon Wunderlich

From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
[sven@narfation.org: fixed alignment]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/soft-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 67065e35de51..1485263a348b 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -188,8 +188,8 @@ static void batadv_interface_set_rx_mode(struct net_device *dev)
 {
 }
 
-static int batadv_interface_tx(struct sk_buff *skb,
-			       struct net_device *soft_iface)
+static netdev_tx_t batadv_interface_tx(struct sk_buff *skb,
+				       struct net_device *soft_iface)
 {
 	struct ethhdr *ethhdr;
 	struct batadv_priv *bat_priv = netdev_priv(soft_iface);
-- 
2.11.0


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

* [PATCH 7/8] batman-adv: disable ethtool link speed detection when auto negotiation off
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:02   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Marek Lindner, Sven Eckelmann, Simon Wunderlich

From: Marek Lindner <mareklindner@neomailbox.ch>

Virtual interface drivers such as tun / tap interfaces, VLAN, etc tend
to initialize the interface throughput with some value for the sake of
having a throughput number to export via ethtool. This exported
throughput leaves batman-adv to conclude the interface throughput is
genuine (reflecting reality), thus no measurements are necessary.

Based on the observation that those interface types also tend to set
the link auto-negotiation to 'off', batman-adv shall check this
setting to differentiate between genuine link throughput information
and placeholders installed by virtual interfaces.

The "default throughput" setting exported via sysfs still allows to
configure the batman-adv throughput for the interface, thus disabling
the measurements.

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/bat_v_elp.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 28687493599f..71c20c1d4002 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -127,7 +127,20 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
 	rtnl_lock();
 	ret = __ethtool_get_link_ksettings(hard_iface->net_dev, &link_settings);
 	rtnl_unlock();
-	if (ret == 0) {
+
+	/* Virtual interface drivers such as tun / tap interfaces, VLAN, etc
+	 * tend to initialize the interface throughput with some value for the
+	 * sake of having a throughput number to export via ethtool. This
+	 * exported throughput leaves batman-adv to conclude the interface
+	 * throughput is genuine (reflecting reality), thus no measurements
+	 * are necessary.
+	 *
+	 * Based on the observation that those interface types also tend to set
+	 * the link auto-negotiation to 'off', batman-adv shall check this
+	 * setting to differentiate between genuine link throughput information
+	 * and placeholders installed by virtual interfaces.
+	 */
+	if (ret == 0 && link_settings.base.autoneg == AUTONEG_ENABLE) {
 		/* link characteristics might change over time */
 		if (link_settings.base.duplex == DUPLEX_FULL)
 			hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX;
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 7/8] batman-adv: disable ethtool link speed detection when auto negotiation off
@ 2018-05-24 12:02   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:02 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Marek Lindner, Sven Eckelmann, Simon Wunderlich

From: Marek Lindner <mareklindner@neomailbox.ch>

Virtual interface drivers such as tun / tap interfaces, VLAN, etc tend
to initialize the interface throughput with some value for the sake of
having a throughput number to export via ethtool. This exported
throughput leaves batman-adv to conclude the interface throughput is
genuine (reflecting reality), thus no measurements are necessary.

Based on the observation that those interface types also tend to set
the link auto-negotiation to 'off', batman-adv shall check this
setting to differentiate between genuine link throughput information
and placeholders installed by virtual interfaces.

The "default throughput" setting exported via sysfs still allows to
configure the batman-adv throughput for the interface, thus disabling
the measurements.

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/bat_v_elp.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index 28687493599f..71c20c1d4002 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -127,7 +127,20 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
 	rtnl_lock();
 	ret = __ethtool_get_link_ksettings(hard_iface->net_dev, &link_settings);
 	rtnl_unlock();
-	if (ret == 0) {
+
+	/* Virtual interface drivers such as tun / tap interfaces, VLAN, etc
+	 * tend to initialize the interface throughput with some value for the
+	 * sake of having a throughput number to export via ethtool. This
+	 * exported throughput leaves batman-adv to conclude the interface
+	 * throughput is genuine (reflecting reality), thus no measurements
+	 * are necessary.
+	 *
+	 * Based on the observation that those interface types also tend to set
+	 * the link auto-negotiation to 'off', batman-adv shall check this
+	 * setting to differentiate between genuine link throughput information
+	 * and placeholders installed by virtual interfaces.
+	 */
+	if (ret == 0 && link_settings.base.autoneg == AUTONEG_ENABLE) {
 		/* link characteristics might change over time */
 		if (link_settings.base.duplex == DUPLEX_FULL)
 			hard_iface->bat_v.flags |= BATADV_FULL_DUPLEX;
-- 
2.11.0


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

* [PATCH 8/8] batman-adv: enable B.A.T.M.A.N. V compilation by default
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:03   ` Simon Wunderlich
  -1 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:03 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Marek Lindner, Sven Eckelmann, Simon Wunderlich

From: Marek Lindner <mareklindner@neomailbox.ch>

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index bee034a95208..de8034d80623 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -35,7 +35,7 @@ config BATMAN_ADV
 config BATMAN_ADV_BATMAN_V
 	bool "B.A.T.M.A.N. V protocol (experimental)"
 	depends on BATMAN_ADV && !(CFG80211=m && BATMAN_ADV=y)
-	default n
+	default y
 	help
 	  This option enables the B.A.T.M.A.N. V protocol, the successor
 	  of the currently used B.A.T.M.A.N. IV protocol. The main
-- 
2.11.0

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

* [B.A.T.M.A.N.] [PATCH 8/8] batman-adv: enable B.A.T.M.A.N. V compilation by default
@ 2018-05-24 12:03   ` Simon Wunderlich
  0 siblings, 0 replies; 36+ messages in thread
From: Simon Wunderlich @ 2018-05-24 12:03 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Marek Lindner, Sven Eckelmann, Simon Wunderlich

From: Marek Lindner <mareklindner@neomailbox.ch>

Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index bee034a95208..de8034d80623 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -35,7 +35,7 @@ config BATMAN_ADV
 config BATMAN_ADV_BATMAN_V
 	bool "B.A.T.M.A.N. V protocol (experimental)"
 	depends on BATMAN_ADV && !(CFG80211=m && BATMAN_ADV=y)
-	default n
+	default y
 	help
 	  This option enables the B.A.T.M.A.N. V protocol, the successor
 	  of the currently used B.A.T.M.A.N. IV protocol. The main
-- 
2.11.0


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

* Re: [PATCH 8/8] batman-adv: enable B.A.T.M.A.N. V compilation by default
  2018-05-24 12:03   ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 12:09     ` Joe Perches
  -1 siblings, 0 replies; 36+ messages in thread
From: Joe Perches @ 2018-05-24 12:09 UTC (permalink / raw)
  To: Simon Wunderlich, davem
  Cc: netdev, b.a.t.m.a.n, Marek Lindner, Sven Eckelmann

On Thu, 2018-05-24 at 14:03 +0200, Simon Wunderlich wrote:
> From: Marek Lindner <mareklindner@neomailbox.ch>
> 
> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
> Acked-by: Antonio Quartulli <a@unstable.cc>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>  net/batman-adv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
> index bee034a95208..de8034d80623 100644
> --- a/net/batman-adv/Kconfig
> +++ b/net/batman-adv/Kconfig
> @@ -35,7 +35,7 @@ config BATMAN_ADV
>  config BATMAN_ADV_BATMAN_V
>  	bool "B.A.T.M.A.N. V protocol (experimental)"
>  	depends on BATMAN_ADV && !(CFG80211=m && BATMAN_ADV=y)
> -	default n
> +	default y

Why should anything experimental be enabled by default?

>  	help
>  	  This option enables the B.A.T.M.A.N. V protocol, the successor
>  	  of the currently used B.A.T.M.A.N. IV protocol. The main

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

* Re: [B.A.T.M.A.N.] [PATCH 8/8] batman-adv: enable B.A.T.M.A.N. V compilation by default
@ 2018-05-24 12:09     ` Joe Perches
  0 siblings, 0 replies; 36+ messages in thread
From: Joe Perches @ 2018-05-24 12:09 UTC (permalink / raw)
  To: Simon Wunderlich, davem
  Cc: netdev, b.a.t.m.a.n, Marek Lindner, Sven Eckelmann

On Thu, 2018-05-24 at 14:03 +0200, Simon Wunderlich wrote:
> From: Marek Lindner <mareklindner@neomailbox.ch>
> 
> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
> Acked-by: Antonio Quartulli <a@unstable.cc>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>  net/batman-adv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
> index bee034a95208..de8034d80623 100644
> --- a/net/batman-adv/Kconfig
> +++ b/net/batman-adv/Kconfig
> @@ -35,7 +35,7 @@ config BATMAN_ADV
>  config BATMAN_ADV_BATMAN_V
>  	bool "B.A.T.M.A.N. V protocol (experimental)"
>  	depends on BATMAN_ADV && !(CFG80211=m && BATMAN_ADV=y)
> -	default n
> +	default y

Why should anything experimental be enabled by default?

>  	help
>  	  This option enables the B.A.T.M.A.N. V protocol, the successor
>  	  of the currently used B.A.T.M.A.N. IV protocol. The main

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

* Re: [PATCH 0/8] pull request for net-next: batman-adv 2017-05-24
  2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-24 15:03   ` David Miller
  -1 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2018-05-24 15:03 UTC (permalink / raw)
  To: sw; +Cc: netdev, b.a.t.m.a.n

From: Simon Wunderlich <sw@simonwunderlich.de>
Date: Thu, 24 May 2018 14:02:52 +0200

> here is a our feature/cleanup pull request of batman-adv to go into net-next.
> 
> Please pull or let me know of any problem!

Pulled.

You should really remove the EXPERIMENTAL tag from the V
protocol support if you want it to be on by default.  Maybe
even remove the Kconfig knob entirely.

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

* Re: [B.A.T.M.A.N.] [PATCH 0/8] pull request for net-next: batman-adv 2017-05-24
@ 2018-05-24 15:03   ` David Miller
  0 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2018-05-24 15:03 UTC (permalink / raw)
  To: sw; +Cc: netdev, b.a.t.m.a.n

From: Simon Wunderlich <sw@simonwunderlich.de>
Date: Thu, 24 May 2018 14:02:52 +0200

> here is a our feature/cleanup pull request of batman-adv to go into net-next.
> 
> Please pull or let me know of any problem!

Pulled.

You should really remove the EXPERIMENTAL tag from the V
protocol support if you want it to be on by default.  Maybe
even remove the Kconfig knob entirely.

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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
@ 2018-05-25 10:33     ` Sergei Shtylyov
  -1 siblings, 0 replies; 36+ messages in thread
From: Sergei Shtylyov @ 2018-05-25 10:33 UTC (permalink / raw)
  To: Simon Wunderlich, davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann

Hello!

On 5/24/2018 3:02 PM, Simon Wunderlich wrote:

> From: Sven Eckelmann <sven@narfation.org>
> 
> All tools which were known to the batman-adv development team are
> supporting the batman-adv netlink interface since a while. Also debugfs is
> not supported for batman-adv interfaces in any non-default netns. Thus
> disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
> most systems. It is still possible to enable it in case it is still
> required in a specific setup.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>   net/batman-adv/Kconfig | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
> index e4e2e02b7380..bee034a95208 100644
> --- a/net/batman-adv/Kconfig
> +++ b/net/batman-adv/Kconfig
> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>   	bool "batman-adv debugfs entries"
>   	depends on BATMAN_ADV
>   	depends on DEBUG_FS
> -	default y
> +	default n

    N is the default default. :-) You don't need this line.

[...]

MBR, Sergei

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 10:33     ` Sergei Shtylyov
  0 siblings, 0 replies; 36+ messages in thread
From: Sergei Shtylyov @ 2018-05-25 10:33 UTC (permalink / raw)
  To: Simon Wunderlich, davem; +Cc: netdev, b.a.t.m.a.n, Sven Eckelmann

Hello!

On 5/24/2018 3:02 PM, Simon Wunderlich wrote:

> From: Sven Eckelmann <sven@narfation.org>
> 
> All tools which were known to the batman-adv development team are
> supporting the batman-adv netlink interface since a while. Also debugfs is
> not supported for batman-adv interfaces in any non-default netns. Thus
> disabling CONFIG_BATMAN_ADV_DEBUGFS by default should not cause problems on
> most systems. It is still possible to enable it in case it is still
> required in a specific setup.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>   net/batman-adv/Kconfig | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
> index e4e2e02b7380..bee034a95208 100644
> --- a/net/batman-adv/Kconfig
> +++ b/net/batman-adv/Kconfig
> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>   	bool "batman-adv debugfs entries"
>   	depends on BATMAN_ADV
>   	depends on DEBUG_FS
> -	default y
> +	default n

    N is the default default. :-) You don't need this line.

[...]

MBR, Sergei

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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-25 10:33     ` [B.A.T.M.A.N.] " Sergei Shtylyov
@ 2018-05-25 10:50       ` Sven Eckelmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Sven Eckelmann @ 2018-05-25 10:50 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n

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

On Freitag, 25. Mai 2018 13:33:59 CEST Sergei Shtylyov wrote:
[...]
> > --- a/net/batman-adv/Kconfig
> > +++ b/net/batman-adv/Kconfig
> > @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> > bool "batman-adv debugfs entries"
> > depends on BATMAN_ADV
> > depends on DEBUG_FS
> > -       default y
> > +       default n
> 
>     N is the default default. :-) You don't need this line.

Hm, looks like this would have to be changed in a lot of places (~782 
according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
next). Do you want to fix it everywhere? Might be good to get this integrated 
in checkpatch.pl when this will become a new policy.

Kind regards,
	Sven

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

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 10:50       ` Sven Eckelmann
  0 siblings, 0 replies; 36+ messages in thread
From: Sven Eckelmann @ 2018-05-25 10:50 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n

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

On Freitag, 25. Mai 2018 13:33:59 CEST Sergei Shtylyov wrote:
[...]
> > --- a/net/batman-adv/Kconfig
> > +++ b/net/batman-adv/Kconfig
> > @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> > bool "batman-adv debugfs entries"
> > depends on BATMAN_ADV
> > depends on DEBUG_FS
> > -       default y
> > +       default n
> 
>     N is the default default. :-) You don't need this line.

Hm, looks like this would have to be changed in a lot of places (~782 
according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
next). Do you want to fix it everywhere? Might be good to get this integrated 
in checkpatch.pl when this will become a new policy.

Kind regards,
	Sven

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

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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-25 10:50       ` [B.A.T.M.A.N.] " Sven Eckelmann
@ 2018-05-25 11:13         ` Sergei Shtylyov
  -1 siblings, 0 replies; 36+ messages in thread
From: Sergei Shtylyov @ 2018-05-25 11:13 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: Joe Perches, netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q

On 5/25/2018 1:50 PM, Sven Eckelmann wrote:

> [...]
>>> --- a/net/batman-adv/Kconfig
>>> +++ b/net/batman-adv/Kconfig
>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>> bool "batman-adv debugfs entries"
>>> depends on BATMAN_ADV
>>> depends on DEBUG_FS
>>> -       default y
>>> +       default n
>>
>>      N is the default default. :-) You don't need this line.
> 
> Hm, looks like this would have to be changed in a lot of places (~782
> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> next). Do you want to fix it everywhere?

    No, but we can at least not add the new ones...

> Might be good to get this integrated
> in checkpatch.pl when this will become a new policy.

    Adding Joe Perches. Joe, can you add a check for "default n"?

> Kind regards,
> 	Sven

MBR, Sergei

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 11:13         ` Sergei Shtylyov
  0 siblings, 0 replies; 36+ messages in thread
From: Sergei Shtylyov @ 2018-05-25 11:13 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n, Joe Perches

On 5/25/2018 1:50 PM, Sven Eckelmann wrote:

> [...]
>>> --- a/net/batman-adv/Kconfig
>>> +++ b/net/batman-adv/Kconfig
>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>> bool "batman-adv debugfs entries"
>>> depends on BATMAN_ADV
>>> depends on DEBUG_FS
>>> -       default y
>>> +       default n
>>
>>      N is the default default. :-) You don't need this line.
> 
> Hm, looks like this would have to be changed in a lot of places (~782
> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> next). Do you want to fix it everywhere?

    No, but we can at least not add the new ones...

> Might be good to get this integrated
> in checkpatch.pl when this will become a new policy.

    Adding Joe Perches. Joe, can you add a check for "default n"?

> Kind regards,
> 	Sven

MBR, Sergei

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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-25 11:13         ` [B.A.T.M.A.N.] " Sergei Shtylyov
@ 2018-05-25 11:15             ` Sven Eckelmann
  -1 siblings, 0 replies; 36+ messages in thread
From: Sven Eckelmann @ 2018-05-25 11:15 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Joe Perches, netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q

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

On Freitag, 25. Mai 2018 14:13:40 CEST Sergei Shtylyov wrote:
> > [...]
> >>> --- a/net/batman-adv/Kconfig
> >>> +++ b/net/batman-adv/Kconfig
> >>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> >>> bool "batman-adv debugfs entries"
> >>> depends on BATMAN_ADV
> >>> depends on DEBUG_FS
> >>> -       default y
> >>> +       default n
> >>
> >> N is the default default. :-) You don't need this line.
> >
> > Hm, looks like this would have to be changed in a lot of places (~782
> > according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> > next). Do you want to fix it everywhere?
> 
>     No, but we can at least not add the new ones...

But the patch was added to net-next yesterday.

Kind regards,
	Sven

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

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 11:15             ` Sven Eckelmann
  0 siblings, 0 replies; 36+ messages in thread
From: Sven Eckelmann @ 2018-05-25 11:15 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n, Joe Perches

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

On Freitag, 25. Mai 2018 14:13:40 CEST Sergei Shtylyov wrote:
> > [...]
> >>> --- a/net/batman-adv/Kconfig
> >>> +++ b/net/batman-adv/Kconfig
> >>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> >>> bool "batman-adv debugfs entries"
> >>> depends on BATMAN_ADV
> >>> depends on DEBUG_FS
> >>> -       default y
> >>> +       default n
> >>
> >> N is the default default. :-) You don't need this line.
> >
> > Hm, looks like this would have to be changed in a lot of places (~782
> > according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> > next). Do you want to fix it everywhere?
> 
>     No, but we can at least not add the new ones...

But the patch was added to net-next yesterday.

Kind regards,
	Sven

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

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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-25 11:15             ` [B.A.T.M.A.N.] " Sven Eckelmann
@ 2018-05-25 15:56               ` Sergei Shtylyov
  -1 siblings, 0 replies; 36+ messages in thread
From: Sergei Shtylyov @ 2018-05-25 15:56 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: Joe Perches, netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q

On 05/25/2018 02:15 PM, Sven Eckelmann wrote:

>>> [...]
>>>>> --- a/net/batman-adv/Kconfig
>>>>> +++ b/net/batman-adv/Kconfig
>>>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>>>> bool "batman-adv debugfs entries"
>>>>> depends on BATMAN_ADV
>>>>> depends on DEBUG_FS
>>>>> -       default y
>>>>> +       default n
>>>>
>>>> N is the default default. :-) You don't need this line.
>>>
>>> Hm, looks like this would have to be changed in a lot of places (~782
>>> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
>>> next). Do you want to fix it everywhere?
>>
>>     No, but we can at least not add the new ones...
> 
> But the patch was added to net-next yesterday.

   DaveM is still too fast for me. :-)

> Kind regards,
> 	Sven

MBR, Sergei

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 15:56               ` Sergei Shtylyov
  0 siblings, 0 replies; 36+ messages in thread
From: Sergei Shtylyov @ 2018-05-25 15:56 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n, Joe Perches

On 05/25/2018 02:15 PM, Sven Eckelmann wrote:

>>> [...]
>>>>> --- a/net/batman-adv/Kconfig
>>>>> +++ b/net/batman-adv/Kconfig
>>>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>>>> bool "batman-adv debugfs entries"
>>>>> depends on BATMAN_ADV
>>>>> depends on DEBUG_FS
>>>>> -       default y
>>>>> +       default n
>>>>
>>>> N is the default default. :-) You don't need this line.
>>>
>>> Hm, looks like this would have to be changed in a lot of places (~782
>>> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
>>> next). Do you want to fix it everywhere?
>>
>>     No, but we can at least not add the new ones...
> 
> But the patch was added to net-next yesterday.

   DaveM is still too fast for me. :-)

> Kind regards,
> 	Sven

MBR, Sergei

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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-25 11:13         ` [B.A.T.M.A.N.] " Sergei Shtylyov
@ 2018-05-25 18:20           ` Joe Perches
  -1 siblings, 0 replies; 36+ messages in thread
From: Joe Perches @ 2018-05-25 18:20 UTC (permalink / raw)
  To: Sergei Shtylyov, Sven Eckelmann, Andrew Morton
  Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n

On Fri, 2018-05-25 at 14:13 +0300, Sergei Shtylyov wrote:
> On 5/25/2018 1:50 PM, Sven Eckelmann wrote:
> 
> > [...]
> > > > --- a/net/batman-adv/Kconfig
> > > > +++ b/net/batman-adv/Kconfig
> > > > @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> > > > bool "batman-adv debugfs entries"
> > > > depends on BATMAN_ADV
> > > > depends on DEBUG_FS
> > > > -       default y
> > > > +       default n
> > > 
> > >      N is the default default. :-) You don't need this line.
> > 
> > Hm, looks like this would have to be changed in a lot of places (~782
> > according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> > next). Do you want to fix it everywhere?
> 
>     No, but we can at least not add the new ones...
> 
> > Might be good to get this integrated
> > in checkpatch.pl when this will become a new policy.
> 
>     Adding Joe Perches. Joe, can you add a check for "default n"?

OK.

This also improves the Kconfig boolean->bool test above
as it's broken for multiple section Kconfig files with
help texts.
---
 scripts/checkpatch.pl | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index baddac9379f0..1f980be4950b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2888,9 +2888,22 @@ sub process {
 
 # discourage the use of boolean for type definition attributes of Kconfig options
 		if ($realfile =~ /Kconfig/ &&
-		    $line =~ /^\+\s*\bboolean\b/) {
-			WARN("CONFIG_TYPE_BOOLEAN",
-			     "Use of boolean is deprecated, please use bool instead.\n" . $herecurr);
+		    $rawline =~ /^\+\s*\bboolean\b/) {
+			if (WARN("CONFIG_TYPE_BOOLEAN",
+				 "Use of boolean is deprecated, please use bool instead.\n" . $herecurr) &&
+			    $fix) {
+				$fixed[$fixlinenr] =~ s/\bboolean\b/bool/;
+			}
+		}
+
+# discourage the use of 'default n' in Kconfig files as that's the default
+		if ($realfile =~ /Kconfig/ &&
+		    $rawline =~ /^\+\s*default\s+n\s*$/) {
+			if (WARN("CONFIG_DEFAULT_N",
+				 "Unnecessary Use of 'default n'\n" . $herecurr) &&
+			    $fix) {
+				fix_delete_line($fixlinenr, $rawline);
+			}
 		}
 
 		if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 18:20           ` Joe Perches
  0 siblings, 0 replies; 36+ messages in thread
From: Joe Perches @ 2018-05-25 18:20 UTC (permalink / raw)
  To: Sergei Shtylyov, Sven Eckelmann, Andrew Morton
  Cc: Simon Wunderlich, davem, netdev, b.a.t.m.a.n

On Fri, 2018-05-25 at 14:13 +0300, Sergei Shtylyov wrote:
> On 5/25/2018 1:50 PM, Sven Eckelmann wrote:
> 
> > [...]
> > > > --- a/net/batman-adv/Kconfig
> > > > +++ b/net/batman-adv/Kconfig
> > > > @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
> > > > bool "batman-adv debugfs entries"
> > > > depends on BATMAN_ADV
> > > > depends on DEBUG_FS
> > > > -       default y
> > > > +       default n
> > > 
> > >      N is the default default. :-) You don't need this line.
> > 
> > Hm, looks like this would have to be changed in a lot of places (~782
> > according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
> > next). Do you want to fix it everywhere?
> 
>     No, but we can at least not add the new ones...
> 
> > Might be good to get this integrated
> > in checkpatch.pl when this will become a new policy.
> 
>     Adding Joe Perches. Joe, can you add a check for "default n"?

OK.

This also improves the Kconfig boolean->bool test above
as it's broken for multiple section Kconfig files with
help texts.
---
 scripts/checkpatch.pl | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index baddac9379f0..1f980be4950b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2888,9 +2888,22 @@ sub process {
 
 # discourage the use of boolean for type definition attributes of Kconfig options
 		if ($realfile =~ /Kconfig/ &&
-		    $line =~ /^\+\s*\bboolean\b/) {
-			WARN("CONFIG_TYPE_BOOLEAN",
-			     "Use of boolean is deprecated, please use bool instead.\n" . $herecurr);
+		    $rawline =~ /^\+\s*\bboolean\b/) {
+			if (WARN("CONFIG_TYPE_BOOLEAN",
+				 "Use of boolean is deprecated, please use bool instead.\n" . $herecurr) &&
+			    $fix) {
+				$fixed[$fixlinenr] =~ s/\bboolean\b/bool/;
+			}
+		}
+
+# discourage the use of 'default n' in Kconfig files as that's the default
+		if ($realfile =~ /Kconfig/ &&
+		    $rawline =~ /^\+\s*default\s+n\s*$/) {
+			if (WARN("CONFIG_DEFAULT_N",
+				 "Unnecessary Use of 'default n'\n" . $herecurr) &&
+			    $fix) {
+				fix_delete_line($fixlinenr, $rawline);
+			}
 		}
 
 		if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&


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

* Re: [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
  2018-05-25 15:56               ` [B.A.T.M.A.N.] " Sergei Shtylyov
@ 2018-05-25 18:39                 ` David Miller
  -1 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2018-05-25 18:39 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: sven, sw, netdev, b.a.t.m.a.n, joe

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 25 May 2018 18:56:09 +0300

> On 05/25/2018 02:15 PM, Sven Eckelmann wrote:
> 
>>>> [...]
>>>>>> --- a/net/batman-adv/Kconfig
>>>>>> +++ b/net/batman-adv/Kconfig
>>>>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>>>>> bool "batman-adv debugfs entries"
>>>>>> depends on BATMAN_ADV
>>>>>> depends on DEBUG_FS
>>>>>> -       default y
>>>>>> +       default n
>>>>>
>>>>> N is the default default. :-) You don't need this line.
>>>>
>>>> Hm, looks like this would have to be changed in a lot of places (~782
>>>> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
>>>> next). Do you want to fix it everywhere?
>>>
>>>     No, but we can at least not add the new ones...
>> 
>> But the patch was added to net-next yesterday.
> 
>    DaveM is still too fast for me. :-)

No worries, just let's get a patch to remove the line.

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

* Re: [B.A.T.M.A.N.] [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default
@ 2018-05-25 18:39                 ` David Miller
  0 siblings, 0 replies; 36+ messages in thread
From: David Miller @ 2018-05-25 18:39 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: sven, sw, netdev, b.a.t.m.a.n, joe

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 25 May 2018 18:56:09 +0300

> On 05/25/2018 02:15 PM, Sven Eckelmann wrote:
> 
>>>> [...]
>>>>>> --- a/net/batman-adv/Kconfig
>>>>>> +++ b/net/batman-adv/Kconfig
>>>>>> @@ -94,13 +94,13 @@ config BATMAN_ADV_DEBUGFS
>>>>>> bool "batman-adv debugfs entries"
>>>>>> depends on BATMAN_ADV
>>>>>> depends on DEBUG_FS
>>>>>> -       default y
>>>>>> +       default n
>>>>>
>>>>> N is the default default. :-) You don't need this line.
>>>>
>>>> Hm, looks like this would have to be changed in a lot of places (~782
>>>> according to `git grep 'default n$'|wc -l` in my slightly outdated linux-
>>>> next). Do you want to fix it everywhere?
>>>
>>>     No, but we can at least not add the new ones...
>> 
>> But the patch was added to net-next yesterday.
> 
>    DaveM is still too fast for me. :-)

No worries, just let's get a patch to remove the line.

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

end of thread, other threads:[~2018-05-25 18:39 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24 12:02 [PATCH 0/8] pull request for net-next: batman-adv 2017-05-24 Simon Wunderlich
2018-05-24 12:02 ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:02 ` [PATCH 1/8] batman-adv: Start new development cycle Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:02 ` [PATCH 2/8] batman-adv: Disable CONFIG_BATMAN_ADV_DEBUGFS by default Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-25 10:33   ` Sergei Shtylyov
2018-05-25 10:33     ` [B.A.T.M.A.N.] " Sergei Shtylyov
2018-05-25 10:50     ` Sven Eckelmann
2018-05-25 10:50       ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-05-25 11:13       ` Sergei Shtylyov
2018-05-25 11:13         ` [B.A.T.M.A.N.] " Sergei Shtylyov
     [not found]         ` <6fd70d33-11f7-33dd-3b11-e5031fe46466-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2018-05-25 11:15           ` Sven Eckelmann
2018-05-25 11:15             ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-05-25 15:56             ` Sergei Shtylyov
2018-05-25 15:56               ` [B.A.T.M.A.N.] " Sergei Shtylyov
2018-05-25 18:39               ` David Miller
2018-05-25 18:39                 ` [B.A.T.M.A.N.] " David Miller
2018-05-25 18:20         ` Joe Perches
2018-05-25 18:20           ` [B.A.T.M.A.N.] " Joe Perches
2018-05-24 12:02 ` [PATCH 3/8] batman-adv: Avoid old nodes disabling multicast optimizations completely Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:02 ` [PATCH 4/8] batman-adv: Avoid bool in structures Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:02 ` [PATCH 5/8] batman-adv: Remove unused dentry without DEBUGFS Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:02 ` [PATCH 6/8] batman-adv: fix batadv_interface_tx()'s return type Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:02 ` [PATCH 7/8] batman-adv: disable ethtool link speed detection when auto negotiation off Simon Wunderlich
2018-05-24 12:02   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:03 ` [PATCH 8/8] batman-adv: enable B.A.T.M.A.N. V compilation by default Simon Wunderlich
2018-05-24 12:03   ` [B.A.T.M.A.N.] " Simon Wunderlich
2018-05-24 12:09   ` Joe Perches
2018-05-24 12:09     ` [B.A.T.M.A.N.] " Joe Perches
2018-05-24 15:03 ` [PATCH 0/8] pull request for net-next: batman-adv 2017-05-24 David Miller
2018-05-24 15:03   ` [B.A.T.M.A.N.] " David Miller

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.