[batctl] master: batctl: Add section to explain gateway selection class for BATMAN_V (26b483c)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batctl
On branch : master
>---------------------------------------------------------------
commit 26b483ce543e5b4bf6869a66c0ef28ef7a00e367
Author: Ruben Barkow <github(a)r.z11.de>
Date: Tue Nov 27 15:00:39 2018 +0100
batctl: Add section to explain gateway selection class for BATMAN_V
Signed-off-by: Ruben Barkow <github(a)r.z11.de>
Acked-by: Antonio Quartulli <a(a)unstable.cc>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
26b483ce543e5b4bf6869a66c0ef28ef7a00e367
man/batctl.8 | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/man/batctl.8 b/man/batctl.8
index 2e3232f..ed8e71f 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -144,6 +144,9 @@ examples: 5000 \-> 5.0/1.0 MBit
If the node is a gateway client the parameter will decide which criteria to consider when the batman-adv module has to choose
between different internet connections announced by the aforementioned servers.
.RE
+.RS 7
+B.A.T.M.A.N. IV:
+.RE
.RS 17
default: 20 \-> late switch (TQ 20)
.RE
@@ -168,6 +171,20 @@ chooses the gateway with the best link quality but switches to another gateway a
least XX TQ better than the currently selected gateway (XX has to be a number between 3 and 256).
.RE
.RE
+.RS 7
+B.A.T.M.A.N. V:
+.RE
+.RS 17
+default: 5000 \-> late switch (5000 kbit/s throughput)
+.br
+example: 1500 \-> fast switch connection
+.RS 17
+switches to another gateway as soon as a better one is found which is at least
+1500 kbit/s faster throughput than the currently selected gateway. Throughput is
+determined by evaluating which is lower: the advertised throughput by the
+gateway or the maximum bandwidth across the entire path.
+.RE
+.RE
.br
.IP "\fBrouting_algo\fP|\fBra\fP [\fBalgorithm\fP]\fP"
If no parameter is given the current routing algorithm configuration as well as
4 years, 2 months
[linux-merge]linux integration; annotated tag, v4.20-rc4, created. v4.20-rc4
by postmaster@open-mesh.org
The annotated tag, v4.20-rc4 has been created
at e8bc1380f83ffb81f6c4faccf38beba81b905a57 (tag)
tagging 2e6e902d185027f8e3cb8b7305238f7e35d6a436 (commit)
replaces v4.20-rc3
tagged by Linus Torvalds
on Sun Nov 25 14:19:39 2018 -0800
- Shortlog ------------------------------------------------------------
Linux 4.20-rc4
-----BEGIN PGP SIGNATURE-----
iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAlv7H/seHHRvcnZhbGRz
QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGhasH/AvNibkzTAPQR7jE
r/R7NIaFUdPpaHYpLpoYIdSWkqpeWtN3q4eldJKWcpFCaE83EzDVu1PRw79rt/lm
JIYbZ2SZWbTB7d2TLEiEF2bFXr+OF8MVc1tSAsP5xTMvV6mIz7+i2xr9R0D4YrKY
ejd+ExF3HimuRf557Uey1MGsRIhedHsHjHbWjvR1MuKzvUv9nAL+1E2KJbfPXacp
LGXElCYcPXoKw+GxMS7C28idgLoEJoS/eVieRiMGsGlgEe/MuaNMU+GRLMde9lI0
c/G/4uumJTHVY7npOjuNt1+2FoLVt8oLlhPcB06R7FIwJN+TupLQifqBkIe2saT6
R6ExonQ=
=+/RR
-----END PGP SIGNATURE-----
Sven Eckelmann (2):
batman-adv: Use explicit tvlv padding for ELP packets
batman-adv: Expand merged fragment buffer for full packet
-----------------------------------------------------------------------
--
linux integration
4 years, 2 months
[linux-merge]linux integration; annotated tag, v4.20-rc3, created. v4.20-rc3
by postmaster@open-mesh.org
The annotated tag, v4.20-rc3 has been created
at b9f688725cc0236a778e942fe4da2edd706a33af (tag)
tagging 9ff01193a20d391e8dbce4403dd5ef87c7eaaca6 (commit)
replaces v4.20-rc2
tagged by Linus Torvalds
on Sun Nov 18 13:33:52 2018 -0800
- Shortlog ------------------------------------------------------------
Linux 4.20-rc3
-----BEGIN PGP SIGNATURE-----
iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAlvx2sAeHHRvcnZhbGRz
QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGycgIAIuxobwt0RRKa0zO
ROS+34JGoC2yU2P9VdEGWdtxS6ANMVQgKPBhWL6s+xR89Kd+V4xSdJLD1pNTxxqP
0DCva0np1/Q4juH+JbU50v/lykoLgteZ0P0LBRGf1y8p3WiLPv45IbnNsMDNYhB2
7a8rOmZYakRY9CPznRDw3X8cJt3sddKgFJHIOGz1OQJVWtCD0KPGcJmQNsbDSagY
Zx6Z5BKSIdjRqaAdN5gDa1Pft3WQo7TpaQGl80lSsgr5LcjmscXA3sClOCy+25Mo
FZLx0PcwP+Efq8RTGzNK51WSOMa6d37hvjDqUAdQBOR0KbyjRyXQwyQVw/MGbPJs
7J3Pzm0=
=56Mt
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
4 years, 2 months
[linux-merge]linux integration; annotated tag, batadv-next-for-davem-20181114, created. batadv-next-for-davem-20181114
by postmaster@open-mesh.org
The annotated tag, batadv-next-for-davem-20181114 has been created
at 8a228aa81c8c71498cfb8ba207da4e5158c99640 (tag)
tagging 016fd285682952b943641c074d1cc0d02b3e6889 (commit)
replaces v4.20-rc1
tagged by Simon Wunderlich
on Wed Nov 14 15:05:58 2018 +0100
- Shortlog ------------------------------------------------------------
This feature/cleanup patchset includes the following patches:
- Bump version strings, by Simon Wunderlich
- Fixup includes, by Sven Eckelmann (3 patches)
- Separate BATMAN_ADV_DEBUG from DEBUGFS, by Sven Eckelmann
- Fixup tracing log documentation, by Sven Eckelmann
- Use exclusive locks to secure netlink information dump transfers,
by Sven Eckelmann (8 patches)
- Move CRC16 dependency, by Sven Eckelmann
- Enable MCAST by default, by Linus Luessing
-----BEGIN PGP SIGNATURE-----
iQJKBAABCgA0FiEE1ilQI7G+y+fdhnrfoSvjmEKSnqEFAlvsK8YWHHN3QHNpbW9u
d3VuZGVybGljaC5kZQAKCRChK+OYQpKeoUr9EACZvVvgqVQC/kiAWyyXuTUvTy7q
SYc0nwmHeG5L/+ekHMsfs8DZ/wofEo6LcZDrSRv79bLjCOLbvSMThVLRH2p1r2sG
OLHqTEbofuqc79C0gXKcJwiuauomjKNty7NKbrf0g7SYhmgRFXJyDamjXt6+4kAS
HVSPsyFt3hI7wo3VIzm4pxXsrjV3wtKAN4RdkwE0i0NCSvJpFuCPMOi53tabjokR
aOb04vLK/SVg426PNS+0iD7oqP5WYKyZSDFD9HHCRj1AHTCxR+7E25nRYKS5J+t4
gCn6Q9sfrJWO2k816xBl2PysA/kVT3GChs4y14LMCaLDyH0Ny4XFeR5pgjpc62fD
JZe/rQwAQQ9IbN1dO9GTww88vMvELcSJhSP2W4q82qsHdn/h/ghVaLKl+zSUO4oS
OByG6BJk0Dz3KpMcCcHRL+VXGUSVmRuOCP2LqM+c0aK9s56qhJM/aR/g7FePq4lQ
HhOCCRP/bmx7F75OZRdxwOQbupQ7P1AA/P2dwjs1xzZ/BHEdmHipsmWs/z2/tKWn
+A9dvLqiF6Dy7VgFUgp7PSi0QyDrgFHNvE14o4ako7QD2o9NqgPsdSlAK68JD0o9
CR14Tb23mNRulWP0GZXjS/MbHmNT7tY+sAc4tSj2VO++ozd5Qox5Y1qPPnL1K8vL
yLjA9NtJzrT36rCPpA==
=9x4D
-----END PGP SIGNATURE-----
Linus Lüssing (1):
batman-adv: enable MCAST by default at compile time
Simon Wunderlich (1):
batman-adv: Start new development cycle
Sven Eckelmann (14):
batman-adv: Drop unused lockdep include
batman-adv: Add includes for deprecation warning
batman-adv: Improve includes for trace functionality
batman-adv: Allow to use BATMAN_ADV_DEBUG without BATMAN_ADV_DEBUGFS
batman-adv: Fix description for BATMAN_ADV_DEBUG
batman-adv: Add inconsistent gateway netlink dump detection
batman-adv: Add inconsistent hardif netlink dump detection
batman-adv: Store modification counter via hash helpers
batman-adv: Add inconsistent backbone netlink dump detection
batman-adv: Add inconsistent claim netlink dump detection
batman-adv: Add inconsistent dat netlink dump detection
batman-adv: Add inconsistent local TT netlink dump detection
batman-adv: Add inconsistent multicast netlink dump detection
batman-adv: Move CRC16 dependency to BATMAN_ADV_BLA
-----------------------------------------------------------------------
--
linux integration
4 years, 2 months
[batman-adv] master: batman-adv: Add compat for genl_dump_check_consistent (5f1eed5)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 5f1eed5f847d704173fda62c8703e5794398e073
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Oct 30 22:01:22 2018 +0100
batman-adv: Add compat for genl_dump_check_consistent
The commit 0a833c29d896 ("genetlink: fix genlmsg_nlhdr()") removed the
family parameter for genl_dump_check_consistent. It is actually not needed
because batman-adv doesn't use userspace headers and a dummy family with
hdrsize 0 can be used for these kernel versions.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
5f1eed5f847d704173fda62c8703e5794398e073
compat-include/{linux/fs.h => net/genetlink.h} | 29 +++++++++++++-------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/compat-include/linux/fs.h b/compat-include/net/genetlink.h
similarity index 60%
copy from compat-include/linux/fs.h
copy to compat-include/net/genetlink.h
index e0d6f7c..026500c 100644
--- a/compat-include/linux/fs.h
+++ b/compat-include/net/genetlink.h
@@ -19,28 +19,27 @@
* of the Linux kernel.
*/
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_
+#ifndef _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_
+#define _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_
#include <linux/version.h>
-#include_next <linux/fs.h>
+#include_next <net/genetlink.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
-static inline struct dentry *batadv_file_dentry(const struct file *file)
+static inline
+void batadv_genl_dump_check_consistent(struct netlink_callback *cb,
+ void *user_hdr)
{
- struct dentry *dentry = file->f_path.dentry;
+ struct genl_family genl_family = {
+ .hdrsize = 0,
+ };
-#ifdef DCACHE_OP_REAL
- if (unlikely(dentry->d_flags & DCACHE_OP_REAL))
- return dentry->d_op->d_real(dentry, file_inode(file));
-#endif
-
- return dentry;
+ genl_dump_check_consistent(cb, user_hdr, &genl_family);
}
-#define file_dentry batadv_file_dentry
+#define genl_dump_check_consistent batadv_genl_dump_check_consistent
-#endif /* < KERNEL_VERSION(4, 6, 0) */
+#endif /* < KERNEL_VERSION(4, 15, 0) */
-#endif /* _NET_BATMAN_ADV_COMPAT_LINUX_FS_H_ */
+#endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */
4 years, 2 months
[batman-adv] master: batman-adv: Drop unused lockdep include (23d66cb)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 23d66cb6744b183f7a76fd8e684f78b3c0ef6576
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Oct 21 11:30:28 2018 +0200
batman-adv: Drop unused lockdep include
The commit f36b93064420 ("batman-adv: Move OGM rebroadcast stats to
orig_ifinfo") removed all used functionality of the include linux/lockdep.h
from batadv_iv_ogm.c.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
23d66cb6744b183f7a76fd8e684f78b3c0ef6576
net/batman-adv/bat_iv_ogm.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index d222709..1d31ac8 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -34,7 +34,6 @@
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/list.h>
-#include <linux/lockdep.h>
#include <linux/netdevice.h>
#include <linux/netlink.h>
#include <linux/pkt_sched.h>
4 years, 2 months
[batman-adv] master: batman-adv: Add inconsistent hardif netlink dump detection (2a82d74)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 2a82d74a4af35654cdb1d1f700328746cf80a808
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Oct 30 22:01:24 2018 +0100
batman-adv: Add inconsistent hardif netlink dump detection
The netlink dump functionality transfers a large number of entries from the
kernel to userspace. It is rather likely that the transfer has to
interrupted and later continued. During that time, it can happen that
either new entries are added or removed. The userspace could than either
receive some entries multiple times or miss entries.
Commit 670dc2833d14 ("netlink: advertise incomplete dumps") introduced a
mechanism to inform userspace about this problem. Userspace can then decide
whether it is necessary or not to retry dumping the information again.
The netlink dump functions have to be switched to exclusive locks to avoid
changes while the current message is prepared. And an external generation
sequence counter is introduced which tracks all modifications of the list.
Reported-by: Matthias Schiffer <mschiffer(a)universe-factory.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
2a82d74a4af35654cdb1d1f700328746cf80a808
net/batman-adv/hard-interface.c | 3 +++
net/batman-adv/main.c | 1 +
net/batman-adv/main.h | 1 +
net/batman-adv/netlink.c | 24 ++++++++++++++----------
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 781c5b6..508f441 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -951,6 +951,7 @@ batadv_hardif_add_interface(struct net_device *net_dev)
batadv_check_known_mac_addr(hard_iface->net_dev);
kref_get(&hard_iface->refcount);
list_add_tail_rcu(&hard_iface->list, &batadv_hardif_list);
+ batadv_hardif_generation++;
return hard_iface;
@@ -993,6 +994,7 @@ void batadv_hardif_remove_interfaces(void)
list_for_each_entry_safe(hard_iface, hard_iface_tmp,
&batadv_hardif_list, list) {
list_del_rcu(&hard_iface->list);
+ batadv_hardif_generation++;
batadv_hardif_remove_interface(hard_iface);
}
rtnl_unlock();
@@ -1054,6 +1056,7 @@ static int batadv_hard_if_event(struct notifier_block *this,
case NETDEV_UNREGISTER:
case NETDEV_PRE_TYPE_CHANGE:
list_del_rcu(&hard_iface->list);
+ batadv_hardif_generation++;
batadv_hardif_remove_interface(hard_iface);
break;
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index c75e478..d1ed839 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -74,6 +74,7 @@
* list traversals just rcu-locked
*/
struct list_head batadv_hardif_list;
+unsigned int batadv_hardif_generation;
static int (*batadv_rx_handler[256])(struct sk_buff *skb,
struct batadv_hard_iface *recv_if);
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index b68a411..b572066 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -247,6 +247,7 @@ static inline int batadv_print_vid(unsigned short vid)
}
extern struct list_head batadv_hardif_list;
+extern unsigned int batadv_hardif_generation;
extern unsigned char batadv_broadcast_addr[];
extern struct workqueue_struct *batadv_event_workqueue;
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 0d9459b..2dc3304 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -29,11 +29,11 @@
#include <linux/if_ether.h>
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/netlink.h>
#include <linux/printk.h>
-#include <linux/rculist.h>
-#include <linux/rcupdate.h>
+#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
#include <linux/stddef.h>
#include <linux/types.h>
@@ -445,23 +445,27 @@ out:
* batadv_netlink_dump_hardif_entry() - Dump one hard interface into a message
* @msg: Netlink message to dump into
* @portid: Port making netlink request
- * @seq: Sequence number of netlink message
+ * @cb: Control block containing additional options
* @hard_iface: Hard interface to dump
*
* Return: error code, or 0 on success
*/
static int
-batadv_netlink_dump_hardif_entry(struct sk_buff *msg, u32 portid, u32 seq,
+batadv_netlink_dump_hardif_entry(struct sk_buff *msg, u32 portid,
+ struct netlink_callback *cb,
struct batadv_hard_iface *hard_iface)
{
struct net_device *net_dev = hard_iface->net_dev;
void *hdr;
- hdr = genlmsg_put(msg, portid, seq, &batadv_netlink_family, NLM_F_MULTI,
+ hdr = genlmsg_put(msg, portid, cb->nlh->nlmsg_seq,
+ &batadv_netlink_family, NLM_F_MULTI,
BATADV_CMD_GET_HARDIFS);
if (!hdr)
return -EMSGSIZE;
+ genl_dump_check_consistent(cb, hdr);
+
if (nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX,
net_dev->ifindex) ||
nla_put_string(msg, BATADV_ATTR_HARD_IFNAME,
@@ -498,7 +502,6 @@ batadv_netlink_dump_hardifs(struct sk_buff *msg, struct netlink_callback *cb)
struct batadv_hard_iface *hard_iface;
int ifindex;
int portid = NETLINK_CB(cb->skb).portid;
- int seq = cb->nlh->nlmsg_seq;
int skip = cb->args[0];
int i = 0;
@@ -516,23 +519,24 @@ batadv_netlink_dump_hardifs(struct sk_buff *msg, struct netlink_callback *cb)
return -ENODEV;
}
- rcu_read_lock();
+ rtnl_lock();
+ cb->seq = batadv_hardif_generation << 1 | 1;
- list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
+ list_for_each_entry(hard_iface, &batadv_hardif_list, list) {
if (hard_iface->soft_iface != soft_iface)
continue;
if (i++ < skip)
continue;
- if (batadv_netlink_dump_hardif_entry(msg, portid, seq,
+ if (batadv_netlink_dump_hardif_entry(msg, portid, cb,
hard_iface)) {
i--;
break;
}
}
- rcu_read_unlock();
+ rtnl_unlock();
dev_put(soft_iface);
4 years, 2 months
[batman-adv] master: batman-adv: Add inconsistent local TT netlink dump detection (45e3ad8)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 45e3ad80fd8078b18c9fda19c4747126d1e34472
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Tue Oct 30 22:01:29 2018 +0100
batman-adv: Add inconsistent local TT netlink dump detection
The netlink dump functionality transfers a large number of entries from the
kernel to userspace. It is rather likely that the transfer has to
interrupted and later continued. During that time, it can happen that
either new entries are added or removed. The userspace could than either
receive some entries multiple times or miss entries.
Commit 670dc2833d14 ("netlink: advertise incomplete dumps") introduced a
mechanism to inform userspace about this problem. Userspace can then decide
whether it is necessary or not to retry dumping the information again.
The netlink dump functions have to be switched to exclusive locks to avoid
changes while the current message is prepared. The already existing
generation sequence counter from the hash helper can be used for this
simple hash.
Reported-by: Matthias Schiffer <mschiffer(a)universe-factory.net>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
45e3ad80fd8078b18c9fda19c4747126d1e34472
net/batman-adv/translation-table.c | 41 +++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index d21624c..8dcd496 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -1145,14 +1145,15 @@ out:
* batadv_tt_local_dump_entry() - Dump one TT local entry into a message
* @msg :Netlink message to dump into
* @portid: Port making netlink request
- * @seq: Sequence number of netlink message
+ * @cb: Control block containing additional options
* @bat_priv: The bat priv with all the soft interface information
* @common: tt local & tt global common data
*
* Return: Error code, or 0 on success
*/
static int
-batadv_tt_local_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
+batadv_tt_local_dump_entry(struct sk_buff *msg, u32 portid,
+ struct netlink_callback *cb,
struct batadv_priv *bat_priv,
struct batadv_tt_common_entry *common)
{
@@ -1173,12 +1174,14 @@ batadv_tt_local_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
batadv_softif_vlan_put(vlan);
- hdr = genlmsg_put(msg, portid, seq, &batadv_netlink_family,
- NLM_F_MULTI,
+ hdr = genlmsg_put(msg, portid, cb->nlh->nlmsg_seq,
+ &batadv_netlink_family, NLM_F_MULTI,
BATADV_CMD_GET_TRANSTABLE_LOCAL);
if (!hdr)
return -ENOBUFS;
+ genl_dump_check_consistent(cb, hdr);
+
if (nla_put(msg, BATADV_ATTR_TT_ADDRESS, ETH_ALEN, common->addr) ||
nla_put_u32(msg, BATADV_ATTR_TT_CRC32, crc) ||
nla_put_u16(msg, BATADV_ATTR_TT_VID, common->vid) ||
@@ -1201,34 +1204,39 @@ batadv_tt_local_dump_entry(struct sk_buff *msg, u32 portid, u32 seq,
* batadv_tt_local_dump_bucket() - Dump one TT local bucket into a message
* @msg: Netlink message to dump into
* @portid: Port making netlink request
- * @seq: Sequence number of netlink message
+ * @cb: Control block containing additional options
* @bat_priv: The bat priv with all the soft interface information
- * @head: Pointer to the list containing the local tt entries
+ * @hash: hash to dump
+ * @bucket: bucket index to dump
* @idx_s: Number of entries to skip
*
* Return: Error code, or 0 on success
*/
static int
-batadv_tt_local_dump_bucket(struct sk_buff *msg, u32 portid, u32 seq,
+batadv_tt_local_dump_bucket(struct sk_buff *msg, u32 portid,
+ struct netlink_callback *cb,
struct batadv_priv *bat_priv,
- struct hlist_head *head, int *idx_s)
+ struct batadv_hashtable *hash, unsigned int bucket,
+ int *idx_s)
{
struct batadv_tt_common_entry *common;
int idx = 0;
- rcu_read_lock();
- hlist_for_each_entry_rcu(common, head, hash_entry) {
+ spin_lock_bh(&hash->list_locks[bucket]);
+ cb->seq = atomic_read(&hash->generation) << 1 | 1;
+
+ hlist_for_each_entry(common, &hash->table[bucket], hash_entry) {
if (idx++ < *idx_s)
continue;
- if (batadv_tt_local_dump_entry(msg, portid, seq, bat_priv,
+ if (batadv_tt_local_dump_entry(msg, portid, cb, bat_priv,
common)) {
- rcu_read_unlock();
+ spin_unlock_bh(&hash->list_locks[bucket]);
*idx_s = idx - 1;
return -EMSGSIZE;
}
}
- rcu_read_unlock();
+ spin_unlock_bh(&hash->list_locks[bucket]);
*idx_s = 0;
return 0;
@@ -1248,7 +1256,6 @@ int batadv_tt_local_dump(struct sk_buff *msg, struct netlink_callback *cb)
struct batadv_priv *bat_priv;
struct batadv_hard_iface *primary_if = NULL;
struct batadv_hashtable *hash;
- struct hlist_head *head;
int ret;
int ifindex;
int bucket = cb->args[0];
@@ -1276,10 +1283,8 @@ int batadv_tt_local_dump(struct sk_buff *msg, struct netlink_callback *cb)
hash = bat_priv->tt.local_hash;
while (bucket < hash->size) {
- head = &hash->table[bucket];
-
- if (batadv_tt_local_dump_bucket(msg, portid, cb->nlh->nlmsg_seq,
- bat_priv, head, &idx))
+ if (batadv_tt_local_dump_bucket(msg, portid, cb, bat_priv,
+ hash, bucket, &idx))
break;
bucket++;
4 years, 2 months
[batman-adv] master: batman-adv: Add includes for deprecation warning (42bc05f)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 42bc05f3837e538911fd82f78aaaa7f1ef05ae79
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Oct 21 11:30:29 2018 +0200
batman-adv: Add includes for deprecation warning
The commit fee04b6f72cf ("batman-adv: Mark debugfs functionality as
deprecated") introduced various messages to inform the user about the
deprecation of the debugfs based functionality. The messages also include
the context/task in which this problem was observed.
The datastructures and functions to access this information require special
headers. These should be included directly instead of depending on a more
complex and fragile include chain.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
42bc05f3837e538911fd82f78aaaa7f1ef05ae79
net/batman-adv/debugfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c
index 8b608a2..d4a7702 100644
--- a/net/batman-adv/debugfs.c
+++ b/net/batman-adv/debugfs.c
@@ -19,6 +19,7 @@
#include "debugfs.h"
#include "main.h"
+#include <asm/current.h>
#include <linux/dcache.h>
#include <linux/debugfs.h>
#include <linux/err.h>
@@ -27,6 +28,7 @@
#include <linux/fs.h>
#include <linux/netdevice.h>
#include <linux/printk.h>
+#include <linux/sched.h>
#include <linux/seq_file.h>
#include <linux/stat.h>
#include <linux/stddef.h>
4 years, 2 months
[batman-adv] master: batman-adv: Allow to use BATMAN_ADV_DEBUG without BATMAN_ADV_DEBUGFS (f9b8cd6)
by postmaster@open-mesh.org
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit f9b8cd69533400c12cbe6011a474893c744dede3
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Sun Oct 21 11:30:31 2018 +0200
batman-adv: Allow to use BATMAN_ADV_DEBUG without BATMAN_ADV_DEBUGFS
The BATMAN_ADV_DEBUGFS portion of batman-adv is marked as deprecated. Thus
all required functionality should be available without it. The debug log
was already modified to also output via the kernel tracing function but
still retained its BATMAN_ADV_DEBUGFS functionality.
Separate the entry point for the debug log from the debugfs portions to
make it possible to build with BATMAN_ADV_DEBUG and without
BATMAN_ADV_DEBUGFS.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
f9b8cd69533400c12cbe6011a474893c744dede3
compat.h | 5 -----
net/batman-adv/Kconfig | 2 +-
net/batman-adv/log.c | 60 +++++++++++++++++++++++++++-----------------------
3 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/compat.h b/compat.h
index 385b629..559df2f 100644
--- a/compat.h
+++ b/compat.h
@@ -30,11 +30,6 @@
#include "compat-autoconf.h"
-/* test for dependency CONFIG_BATMAN_ADV_DEBUG -> CONFIG_BATMAN_ADV_DEBUGFS */
-#if defined(CONFIG_BATMAN_ADV_DEBUG) && !defined(CONFIG_BATMAN_ADV_DEBUGFS)
-#error CONFIG_BATMAN_ADV_DEBUG=y requires CONFIG_BATMAN_ADV_DEBUGFS=y
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
/* wild hack for batadv_getlink_net only */
diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig
index 449ab2e..d3ab471 100644
--- a/net/batman-adv/Kconfig
+++ b/net/batman-adv/Kconfig
@@ -100,7 +100,7 @@ config BATMAN_ADV_DEBUGFS
config BATMAN_ADV_DEBUG
bool "B.A.T.M.A.N. debugging"
- depends on BATMAN_ADV_DEBUGFS
+ depends on BATMAN_ADV
help
This is an option for use by developers; most people should
say N here. This enables compilation of support for
diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c
index 6beb5f0..02e55b7 100644
--- a/net/batman-adv/log.c
+++ b/net/batman-adv/log.c
@@ -43,6 +43,8 @@
#include "debugfs.h"
#include "trace.h"
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
+
#define BATADV_LOG_BUFF_MASK (batadv_log_buff_len - 1)
static const int batadv_log_buff_len = BATADV_LOG_BUF_LEN;
@@ -92,33 +94,6 @@ static int batadv_fdebug_log(struct batadv_priv_debug_log *debug_log,
return 0;
}
-/**
- * batadv_debug_log() - Add debug log entry
- * @bat_priv: the bat priv with all the soft interface information
- * @fmt: format string
- *
- * Return: 0 on success or negative error number in case of failure
- */
-int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
-{
- struct va_format vaf;
- va_list args;
-
- va_start(args, fmt);
-
- vaf.fmt = fmt;
- vaf.va = &args;
-
- batadv_fdebug_log(bat_priv->debug_log, "[%10u] %pV",
- jiffies_to_msecs(jiffies), &vaf);
-
- trace_batadv_dbg(bat_priv, &vaf);
-
- va_end(args);
-
- return 0;
-}
-
static int batadv_log_open(struct inode *inode, struct file *file)
{
if (!try_module_get(THIS_MODULE))
@@ -259,3 +234,34 @@ void batadv_debug_log_cleanup(struct batadv_priv *bat_priv)
kfree(bat_priv->debug_log);
bat_priv->debug_log = NULL;
}
+
+#endif /* CONFIG_BATMAN_ADV_DEBUGFS */
+
+/**
+ * batadv_debug_log() - Add debug log entry
+ * @bat_priv: the bat priv with all the soft interface information
+ * @fmt: format string
+ *
+ * Return: 0 on success or negative error number in case of failure
+ */
+int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+#ifdef CONFIG_BATMAN_ADV_DEBUGFS
+ batadv_fdebug_log(bat_priv->debug_log, "[%10u] %pV",
+ jiffies_to_msecs(jiffies), &vaf);
+#endif
+
+ trace_batadv_dbg(bat_priv, &vaf);
+
+ va_end(args);
+
+ return 0;
+}
4 years, 2 months