All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCHv5 1/2] batctl: adding multicast debug level
@ 2016-05-13 16:35 Linus Lüssing
  2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output Linus Lüssing
  2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table Linus Lüssing
  0 siblings, 2 replies; 6+ messages in thread
From: Linus Lüssing @ 2016-05-13 16:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

From: Linus Lüssing <linus.luessing@web.de>

This patch adds the multicast debug level to check for own
multicast flag changes for instance.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---

Changes in v5:
* none

Changes in v4:
* rebase to current master (no conflicts)

Changes in v3:
* none

Changes in v2:
* added a sentence about 'mcast' log level to manpage

 README       |    1 +
 man/batctl.8 |    6 +++---
 sys.c        |    5 +++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/README b/README
index f87c551..b5de8a6 100644
--- a/README
+++ b/README
@@ -390,6 +390,7 @@ $  batctl loglevel
 [ ] messages related to bridge loop avoidance (bla)
 [ ] messages related to arp snooping and distributed arp table (dat)
 [ ] messages related to network coding (nc)
+[ ] messages related to multicast (mcast)
 
 batctl nc_nodes
 ===============
diff --git a/man/batctl.8 b/man/batctl.8
index e804a08..f8955d0 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -98,9 +98,9 @@ level. Level 'none' disables all verbose logging. Level 'batman' enables message
 Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to
 translation table operations. Level 'bla' enables messages related to the bridge loop avoidance. Level 'dat' enables
 messages related to ARP snooping and the Distributed Arp Table. Level 'nc' enables messages related to network coding.
-Level 'all' enables all messages. The messages are sent to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it.
-Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options
-won't be available.
+Level 'mcast' enables messages related to multicast optimizations. Level 'all' enables all messages. The messages
+are sent to the batman-adv debug log. Use \fBbatctl log\fP to retrieve it. Make sure to have debugging output enabled
+when compiling the module otherwise the output as well as the loglevel options won't be available.
 .br
 .IP "\fBlog\fP|\fBl\fP [\fB\-n\fP]\fP"
 batctl will read the batman-adv debug log which has to be compiled into the kernel module. If "\-n" is given batctl will not
diff --git a/sys.c b/sys.c
index afa8533..ca837f6 100644
--- a/sys.c
+++ b/sys.c
@@ -277,6 +277,7 @@ static void log_level_usage(void)
 	fprintf(stderr, " \t bla     Messages related to bridge loop avoidance\n");
 	fprintf(stderr, " \t dat     Messages related to arp snooping and distributed arp table\n");
 	fprintf(stderr, " \t nc      Messages related to network coding\n");
+	fprintf(stderr, " \t mcast   Messages related to multicast\n");
 }
 
 int handle_loglevel(char *mesh_iface, int argc, char **argv)
@@ -321,6 +322,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
 				log_level |= BIT(4);
 			else if (strcmp(argv[i], "nc") == 0)
 				log_level |= BIT(5);
+			else if (strcmp(argv[i], "mcast") == 0)
+				log_level |= BIT(6);
 			else {
 				log_level_usage();
 				goto out;
@@ -354,6 +357,8 @@ int handle_loglevel(char *mesh_iface, int argc, char **argv)
 	       "messages related to arp snooping and distributed arp table", "dat");
 	printf("[%c] %s (%s)\n", (log_level & BIT(5)) ? 'x' : ' ',
 	       "messages related to network coding", "nc");
+	printf("[%c] %s (%s)\n", (log_level & BIT(6)) ? 'x' : ' ',
+	       "messages related to multicast", "mcast");
 
 out:
 	free(path_buff);
-- 
1.7.10.4


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

* [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output
  2016-05-13 16:35 [B.A.T.M.A.N.] [PATCHv5 1/2] batctl: adding multicast debug level Linus Lüssing
@ 2016-05-13 16:35 ` Linus Lüssing
  2016-05-17  9:24   ` Marek Lindner
  2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table Linus Lüssing
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Lüssing @ 2016-05-13 16:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

We recently switched to the atomic variants set_bit() / clear_bit()
/ test_bit() for originator capabilities.

Unfortunately, this was missed for the new multicast debugfs
entry, resulting in an empty multicast flags table.

Fixing this by using test_bit().

Fixes: f1f0fbb2c956 ("batman-adv: Add debugfs table for mcast flags")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
 net/batman-adv/multicast.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index abb12f1..2dd5aec 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -1205,12 +1205,12 @@ int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset)
 
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
-			if (!(orig_node->capa_initialized &
-			      BATADV_ORIG_CAPA_HAS_MCAST))
+			if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				      &orig_node->capa_initialized))
 				continue;
 
-			if (!(orig_node->capabilities &
-			      BATADV_ORIG_CAPA_HAS_MCAST)) {
+			if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				      &orig_node->capabilities)) {
 				seq_printf(seq, "%pM -\n", orig_node->orig);
 				continue;
 			}
-- 
1.7.10.4


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

* [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table
  2016-05-13 16:35 [B.A.T.M.A.N.] [PATCHv5 1/2] batctl: adding multicast debug level Linus Lüssing
  2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output Linus Lüssing
@ 2016-05-13 16:35 ` Linus Lüssing
  2016-05-17  9:14   ` Marek Lindner
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Lüssing @ 2016-05-13 16:35 UTC (permalink / raw)
  To: b.a.t.m.a.n

From: Linus Lüssing <linus.luessing@web.de>

This patch adds an option to retrieve the per originator multicast
flags table.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---

Changes in v5:
* fixed README description of mcast_flags (copy & paste error from DAT)

Changes in v4:
* rebase to current master (no conflicts)

Changes in v3:
* updated mcast_flags example in README file

Changes in v2:
* header_lines for 'mcast_flags' increased from 2 to 6
* Example updated to more verbose, 6 lines debugfs header output
* (kept order for the noted manpage section as it wasn't alphabetically
   orderd in the first place - instead keeping the previous "logical"
   order - 'mcast' after 'nc')

 README       |   34 ++++++++++++++++++++++++++++++++++
 debug.c      |    6 ++++++
 debug.h      |    1 +
 functions.c  |    1 +
 man/batctl.8 |    3 +++
 5 files changed, 45 insertions(+)

diff --git a/README b/README
index b5de8a6..6df669a 100644
--- a/README
+++ b/README
@@ -426,6 +426,40 @@ display or modify the multicast mode setting
 
 Usage: batctl multicast_mode|mm [0|1]
 
+batctl mcast_flags
+=================
+
+display local and remote multicast flags
+
+Usage batctl mcast_flags|mf
+
+Example:
+
+Multicast flags (own flags: [U46])
+* Bridged [U]                           U
+* No IGMP/MLD Querier [4/6]:            ./.
+* Shadowing IGMP/MLD Querier [4/6]:     4/6
+-------------------------------------------
+       Originator Flags
+02:04:64:a4:39:c1 [U..]
+02:04:64:a4:39:c2 [U..]
+02:04:64:a4:39:c3 [...]
+
+where:
+- Originator: the MAC address of the originating (primary interface)
+		batman-adv node
+- Flags: multicast flags of the according node
+- U: wants all unsnoopable multicast traffic, meaning other nodes need to always
+	forward any multicast traffic destined to ff02::1 or 224.0.0.0/24 to it
+- 4: wants all IPv4 multicast traffic, meaning other nodes need to always
+	forward any IPv4 multicast traffic to it
+- 6: wants all IPv6 multicast traffic, meaning other nodes need to always
+	forward any IPv6 multicast traffic to it
+
+If a node does not have multicast optimizations available (e.g. old batman-adv
+version or optimizations not compiled in), therefore not announcing any
+multicast tvlv/flags, a '-' will be displayed instead of '[...]'.
+
 batctl aggregation
 ==================
 
diff --git a/debug.c b/debug.c
index 3db3ed9..5b280cb 100644
--- a/debug.c
+++ b/debug.c
@@ -84,6 +84,12 @@ const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM] = {
 		.debugfs_name = "nc_nodes",
 		.header_lines = 0,
 	},
+	{
+		.opt_long = "mcast_flags",
+		.opt_short = "mf",
+		.debugfs_name = "mcast_flags",
+		.header_lines = 6,
+	},
 };
 
 static void debug_table_usage(int debug_table)
diff --git a/debug.h b/debug.h
index df65f50..46e8c3c 100644
--- a/debug.h
+++ b/debug.h
@@ -40,6 +40,7 @@ enum batctl_debug_tables {
 	BATCTL_TABLE_BLA_BACKBONES,
 	BATCTL_TABLE_DAT,
 	BATCTL_TABLE_NETWORK_CODING_NODES,
+	BATCTL_TABLE_MCAST_FLAGS,
 	BATCTL_TABLE_NUM,
 };
 
diff --git a/functions.c b/functions.c
index be8f8b0..97a6dbd 100644
--- a/functions.c
+++ b/functions.c
@@ -68,6 +68,7 @@ const char *fs_compile_out_param[] = {
 	batctl_debug_tables[BATCTL_TABLE_BLA_BACKBONES].debugfs_name,
 	batctl_debug_tables[BATCTL_TABLE_DAT].debugfs_name,
 	batctl_debug_tables[BATCTL_TABLE_NETWORK_CODING_NODES].debugfs_name,
+	batctl_debug_tables[BATCTL_TABLE_MCAST_FLAGS].debugfs_name,
 	NULL,
 };
 
diff --git a/man/batctl.8 b/man/batctl.8
index f8955d0..05f68d3 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -236,6 +236,9 @@ List of debug tables:
 .RS 10
 \- nc_nodes|nn (compile time option)
 .RE
+.RS 10
+\- mcast_flags|mf (compile time option)
+.RE
 .RE
 .br
 .IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
-- 
1.7.10.4


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

* Re: [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table
  2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table Linus Lüssing
@ 2016-05-17  9:14   ` Marek Lindner
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2016-05-17  9:14 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

On Friday, May 13, 2016 18:35:42 Linus Lüssing wrote:
> From: Linus Lüssing <linus.luessing@web.de>
> 
> This patch adds an option to retrieve the per originator multicast
> flags table.
> 
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
> 
> Changes in v5:
> * fixed README description of mcast_flags (copy & paste error from DAT)
> 
> Changes in v4:
> * rebase to current master (no conflicts)
> 
> Changes in v3:
> * updated mcast_flags example in README file
> 
> Changes in v2:
> * header_lines for 'mcast_flags' increased from 2 to 6
> * Example updated to more verbose, 6 lines debugfs header output
> * (kept order for the noted manpage section as it wasn't alphabetically
>    orderd in the first place - instead keeping the previous "logical"
>    order - 'mcast' after 'nc')
> 
>  README       |   34 ++++++++++++++++++++++++++++++++++
>  debug.c      |    6 ++++++
>  debug.h      |    1 +
>  functions.c  |    1 +
>  man/batctl.8 |    3 +++
>  5 files changed, 45 insertions(+)

Applied in revision 2f6b65f.

Thanks,
Marek

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

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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output
  2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output Linus Lüssing
@ 2016-05-17  9:24   ` Marek Lindner
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Lindner @ 2016-05-17  9:24 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

On Friday, May 13, 2016 18:35:41 Linus Lüssing wrote:
> We recently switched to the atomic variants set_bit() / clear_bit()
> / test_bit() for originator capabilities.
> 
> Unfortunately, this was missed for the new multicast debugfs
> entry, resulting in an empty multicast flags table.
> 
> Fixing this by using test_bit().
> 
> Fixes: f1f0fbb2c956 ("batman-adv: Add debugfs table for mcast flags")
> Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> ---
>  net/batman-adv/multicast.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied in revision 8151e97.

Thanks,
Marek

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

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

* [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output
@ 2016-05-13 16:24 Linus Lüssing
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Lüssing @ 2016-05-13 16:24 UTC (permalink / raw)
  To: b.a.t.m.a.n

We recently switched to the atomic variants set_bit() / clear_bit()
/ test_bit() for originator capabilities.

Unfortunately, this was missed for the new multicast debugfs
entry, resulting in an empty multicast flags table.

Fixing this by using test_bit().

Fixes: f1f0fbb2c956 ("batman-adv: Add debugfs table for mcast flags")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
 net/batman-adv/multicast.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index abb12f1..2dd5aec 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -1205,12 +1205,12 @@ int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset)
 
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
-			if (!(orig_node->capa_initialized &
-			      BATADV_ORIG_CAPA_HAS_MCAST))
+			if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				      &orig_node->capa_initialized))
 				continue;
 
-			if (!(orig_node->capabilities &
-			      BATADV_ORIG_CAPA_HAS_MCAST)) {
+			if (!test_bit(BATADV_ORIG_CAPA_HAS_MCAST,
+				      &orig_node->capabilities)) {
 				seq_printf(seq, "%pM -\n", orig_node->orig);
 				continue;
 			}
-- 
1.7.10.4


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

end of thread, other threads:[~2016-05-17  9:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13 16:35 [B.A.T.M.A.N.] [PATCHv5 1/2] batctl: adding multicast debug level Linus Lüssing
2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output Linus Lüssing
2016-05-17  9:24   ` Marek Lindner
2016-05-13 16:35 ` [B.A.T.M.A.N.] [PATCHv5 2/2] batctl: adding mcast flags debugfs table Linus Lüssing
2016-05-17  9:14   ` Marek Lindner
  -- strict thread matches above, loose matches on Subject: below --
2016-05-13 16:24 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix mcast_flags debugfs output Linus Lüssing

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.