All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 03/10] batman-adv: add generic netlink query API to replace debugfs files
Date: Fri, 29 Apr 2016 21:15:03 +0200	[thread overview]
Message-ID: <10673163.SjRvAOM3uS@sven-edge> (raw)
In-Reply-To: <1461875848-11720-4-git-send-email-andrew@lunn.ch>


[-- Attachment #1.1: Type: text/plain, Size: 4914 bytes --]

=2D-nextPart14769187.XhPCp6XRqi
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

On Thursday 28 April 2016 22:37:21 Andrew Lunn wrote:
> From: Matthias Schiffer <mschiffer@universe-factory.net>
> 
> debugfs is currently severely broken virtually everywhere in the kernel
> where files are dynamically added and removed (see
> http://lkml.iu.edu/hypermail/linux/kernel/1506.1/02196.html for some
> details). In addition to that, debugfs is not namespace-aware.
> 
> Also, the debugfs interface will try to fix the whole list of originators/
> TT entries into a single buffer. The situation has improved in recent
> kernels,as the seq_file infrastructure will fall back to vmalloc now when
> kmalloc fails. Still, converting all information to text and potentially
> retrying multiple times until the buffer is big enough is very inefficient.
> 
> This commit adds generic infrastructur for the netlink interface to
> batman-adv and implements the following command:
> 
> * BATADV_CMD_GET_ROUTING_ALGOS: will return the list of supported routing
>   algorithms
> * BATADV_CMD_GET_MESH_INFO: will return basic information about a
>   batman-adv softif (name, index and MAC address for both the softif and
>   the primary hardif; routing algorithm; batman-adv version)
> * BATADV_CMD_GET_HARDIFS: will return the list of hardifs (including
>   index, name and MAC address) of all hardifs for a given softif
> 
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
> ---
>  Makefile                        |   1 +
>  include/uapi/linux/batman_adv.h |  49 ++++++++
>  net/batman-adv/Makefile         |   1 +
>  net/batman-adv/main.c           |  48 ++++++++
>  net/batman-adv/main.h           |   1 +
>  net/batman-adv/netlink.c        | 251
> ++++++++++++++++++++++++++++++++++++++++ net/batman-adv/netlink.h        | 
> 36 ++++++
>  7 files changed, 387 insertions(+)
>  create mode 100644 include/uapi/linux/batman_adv.h
>  create mode 100644 net/batman-adv/netlink.c
>  create mode 100644 net/batman-adv/netlink.h

You can find the missing includes in the attached patch

Kind regards,
	Sven
=2D-nextPart14769187.XhPCp6XRqi
Content-Disposition: attachment; filename="0007-missing-includes-3.patch"
Content-Transfer-Encoding: 7Bit
Content-Type: text/x-patch; charset="UTF-8"; name="0007-missing-includes-3.patch"

From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 29 Apr 2016 20:43:27 +0200
Subject: [PATCH] missing includes 3
=2D--
 net/batman-adv/main.c    |  3 +++
 net/batman-adv/main.h    |  1 +
 net/batman-adv/netlink.c | 13 +++++++++++--
 net/batman-adv/netlink.h |  5 +++++
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 05fc597..7b5f585 100644
=2D-- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -35,6 +35,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/netdevice.h>
+#include <linux/netlink.h>
 #include <linux/pkt_sched.h>
 #include <linux/rculist.h>
 #include <linux/rcupdate.h>
@@ -46,6 +47,8 @@
 #include <linux/string.h>
 #include <linux/workqueue.h>
 #include <net/dsfield.h>
+#include <net/genetlink.h>
+#include <net/netlink.h>
 #include <net/rtnetlink.h>
 #include <uapi/linux/batman_adv.h>
 
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index eddbb59..3b770df 100644
=2D-- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -191,6 +191,7 @@ enum batadv_uev_type {
 #include "types.h"
 
 struct batadv_ogm_packet;
+struct netlink_callback;
 struct seq_file;
 struct sk_buff;
 
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 6682f78..e302de3 100644
=2D-- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -18,14 +18,23 @@
 #include "main.h"
 #include "netlink.h"
 
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/if_ether.h>
+#include <linux/init.h>
 #include <linux/netdevice.h>
+#include <linux/netlink.h>
+#include <linux/printk.h>
+#include <linux/rculist.h>
+#include <linux/rcupdate.h>
+#include <linux/skbuff.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
 #include <net/sock.h>
 #include <uapi/linux/batman_adv.h>
 
 #include "hard-interface.h"
=2D#include "originator.h"
 #include "soft-interface.h"
=2D#include "translation-table.h"
 
 struct genl_family batadv_netlink_family = {
 	.id = GENL_ID_GENERATE,
diff --git a/net/batman-adv/netlink.h b/net/batman-adv/netlink.h
index 31022d4..ae0eeb9 100644
=2D-- a/net/batman-adv/netlink.h
+++ b/net/batman-adv/netlink.h
@@ -18,7 +18,12 @@
 #ifndef _NET_BATMAN_ADV_NETLINK_H_
 #define _NET_BATMAN_ADV_NETLINK_H_
 
+#include <linux/compiler.h>
+#include <linux/genetlink.h>
 #include <net/genetlink.h>
+#include <net/netlink.h>
+
+struct nlmsghdr;
 
 void batadv_netlink_register(void);
 void batadv_netlink_unregister(void);

=2D-nextPart14769187.XhPCp6XRqi--
This is a multi-part message in MIME format.

[-- Attachment #1.2: Type: text/plain, Size: 2022 bytes --]

On Thursday 28 April 2016 22:37:21 Andrew Lunn wrote:
> From: Matthias Schiffer <mschiffer@universe-factory.net>
> 
> debugfs is currently severely broken virtually everywhere in the kernel
> where files are dynamically added and removed (see
> http://lkml.iu.edu/hypermail/linux/kernel/1506.1/02196.html for some
> details). In addition to that, debugfs is not namespace-aware.
> 
> Also, the debugfs interface will try to fix the whole list of originators/
> TT entries into a single buffer. The situation has improved in recent
> kernels,as the seq_file infrastructure will fall back to vmalloc now when
> kmalloc fails. Still, converting all information to text and potentially
> retrying multiple times until the buffer is big enough is very inefficient.
> 
> This commit adds generic infrastructur for the netlink interface to
> batman-adv and implements the following command:
> 
> * BATADV_CMD_GET_ROUTING_ALGOS: will return the list of supported routing
>   algorithms
> * BATADV_CMD_GET_MESH_INFO: will return basic information about a
>   batman-adv softif (name, index and MAC address for both the softif and
>   the primary hardif; routing algorithm; batman-adv version)
> * BATADV_CMD_GET_HARDIFS: will return the list of hardifs (including
>   index, name and MAC address) of all hardifs for a given softif
> 
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
> ---
>  Makefile                        |   1 +
>  include/uapi/linux/batman_adv.h |  49 ++++++++
>  net/batman-adv/Makefile         |   1 +
>  net/batman-adv/main.c           |  48 ++++++++
>  net/batman-adv/main.h           |   1 +
>  net/batman-adv/netlink.c        | 251
> ++++++++++++++++++++++++++++++++++++++++ net/batman-adv/netlink.h        | 
> 36 ++++++
>  7 files changed, 387 insertions(+)
>  create mode 100644 include/uapi/linux/batman_adv.h
>  create mode 100644 net/batman-adv/netlink.c
>  create mode 100644 net/batman-adv/netlink.h

You can find the missing includes in the attached patch

Kind regards,
	Sven

[-- Attachment #1.3: 0007-missing-includes-3.patch --]
[-- Type: text/x-patch, Size: 2466 bytes --]

From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 29 Apr 2016 20:43:27 +0200
Subject: [PATCH] missing includes 3
---
 net/batman-adv/main.c    |  3 +++
 net/batman-adv/main.h    |  1 +
 net/batman-adv/netlink.c | 13 +++++++++++--
 net/batman-adv/netlink.h |  5 +++++
 4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 05fc597..7b5f585 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -35,6 +35,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/netdevice.h>
+#include <linux/netlink.h>
 #include <linux/pkt_sched.h>
 #include <linux/rculist.h>
 #include <linux/rcupdate.h>
@@ -46,6 +47,8 @@
 #include <linux/string.h>
 #include <linux/workqueue.h>
 #include <net/dsfield.h>
+#include <net/genetlink.h>
+#include <net/netlink.h>
 #include <net/rtnetlink.h>
 #include <uapi/linux/batman_adv.h>
 
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index eddbb59..3b770df 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -191,6 +191,7 @@ enum batadv_uev_type {
 #include "types.h"
 
 struct batadv_ogm_packet;
+struct netlink_callback;
 struct seq_file;
 struct sk_buff;
 
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 6682f78..e302de3 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -18,14 +18,23 @@
 #include "main.h"
 #include "netlink.h"
 
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/if_ether.h>
+#include <linux/init.h>
 #include <linux/netdevice.h>
+#include <linux/netlink.h>
+#include <linux/printk.h>
+#include <linux/rculist.h>
+#include <linux/rcupdate.h>
+#include <linux/skbuff.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
 #include <net/sock.h>
 #include <uapi/linux/batman_adv.h>
 
 #include "hard-interface.h"
-#include "originator.h"
 #include "soft-interface.h"
-#include "translation-table.h"
 
 struct genl_family batadv_netlink_family = {
 	.id = GENL_ID_GENERATE,
diff --git a/net/batman-adv/netlink.h b/net/batman-adv/netlink.h
index 31022d4..ae0eeb9 100644
--- a/net/batman-adv/netlink.h
+++ b/net/batman-adv/netlink.h
@@ -18,7 +18,12 @@
 #ifndef _NET_BATMAN_ADV_NETLINK_H_
 #define _NET_BATMAN_ADV_NETLINK_H_
 
+#include <linux/compiler.h>
+#include <linux/genetlink.h>
 #include <net/genetlink.h>
+#include <net/netlink.h>
+
+struct nlmsghdr;
 
 void batadv_netlink_register(void);
 void batadv_netlink_unregister(void);

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

  parent reply	other threads:[~2016-04-29 19:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 20:37 [B.A.T.M.A.N.] [PATCH 00/10] netns and netlink support Andrew Lunn
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 01/10] batman-adv: Handle parent interfaces in a different netns Andrew Lunn
2016-04-29  5:52   ` Sven Eckelmann
2016-04-29 12:14     ` Andrew Lunn
2016-04-29 12:59       ` Sven Eckelmann
2016-04-29 19:51         ` Sven Eckelmann
2016-04-29 19:14   ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 02/10] batman-adv: Suppress debugfs entries for netns's Andrew Lunn
2016-04-29 18:07   ` Sven Eckelmann
2016-04-29 18:53     ` Andrew Lunn
2016-04-29 19:14   ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 03/10] batman-adv: add generic netlink query API to replace debugfs files Andrew Lunn
2016-04-29 18:11   ` Sven Eckelmann
2016-04-29 19:15   ` Sven Eckelmann [this message]
2016-04-29 19:55   ` Sven Eckelmann
2016-04-29 20:15     ` Sven Eckelmann
2016-04-29 20:26     ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 04/10] batman-adv: netlink: add translation table query Andrew Lunn
2016-04-29 19:15   ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 05/10] batman-adv: netlink: add originator and neighbor table queries Andrew Lunn
2016-04-29 19:15   ` Sven Eckelmann
2016-04-29 21:05   ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 06/10] batman-adv: add B.A.T.M.A.N. IV bat_{orig, neigh}_dump implementations Andrew Lunn
2016-04-29 19:15   ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 07/10] batman-adv: add B.A.T.M.A.N. V " Andrew Lunn
2016-04-29 19:15   ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 08/10] batman-adv: Indicate netlink socket can be used with netns Andrew Lunn
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 09/10] batman-adv: add B.A.T.M.A.N. Dump gateways via netlink Andrew Lunn
2016-04-29 19:15   ` Sven Eckelmann
2016-04-29 20:36     ` Sven Eckelmann
2016-04-28 20:37 ` [B.A.T.M.A.N.] [PATCH 10/10] batman-adv: add B.A.T.M.A.N. Dump BLA claims " Andrew Lunn
2016-04-29 19:15   ` Sven Eckelmann
2016-04-29 21:07   ` Sven Eckelmann
2016-04-29 21:56     ` Andrew Lunn
2016-04-28 20:46 ` [B.A.T.M.A.N.] [PATCH 00/10] netns and netlink support Andrew Lunn
2016-04-29  6:19   ` Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10673163.SjRvAOM3uS@sven-edge \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.