Hi,
I want to test the new batman V with throughput based metric, but I
could not find out how to compile batman-adv against cfg80211 from linux
backports.
At the moment first I am compiling cfg80211 and ath10k from the
backports tree.
After that I manually copy the created Modules.symvers from backports
build dir to the batman-adv folder
and running make with KBUILD_EXTRA_SYMBOLS, because otherwise I am
getting a warning that the
cfg80211_get_station symbol is missing.
Then batman-adv compiles fine.
After loading the module I am getting an error with
batadv_v_elp_throughput_metric_update :
[ 150.332710] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
[ 150.341079] pgd = 80004000
[ 150.343900] [00000000] *pgd=00000000
[ 150.347735] Internal error: Oops: 80000007 [#1] SMP ARM
[ 150.347768] Modules linked in: batman_adv(O) bluetooth 6lowpan_iphc
arc4 sky2 ath10k_pci(O) ath10k_core(O) ath(O) mac80211(O) ftdi_sio
usbserial cfg80211(O) compat(O)
[ 150.347779] CPU: 0 PID: 21 Comm: kworker/u4:1 Tainted: G O
3.14.48+yocto+g36eba1d #1
[ 150.347836] Workqueue: bat_events
batadv_v_elp_throughput_metric_update [batman_adv]
[ 150.347841] task: 9c0c5f80 ti: 9c1e4000 task.ti: 9c1e4000
[ 150.347848] PC is at 0x0
[ 150.347851] LR is at 0x0
[ 150.347857] pc : [<00000000>] lr : [<00000000>] psr: 20070013
[ 150.347857] sp : 9c1e5f08 ip : 0000001e fp : 9c004400
[ 150.347861] r10: 9c1e4008 r9 : 00000000 r8 : 9c004400
[ 150.347865] r7 : 00000000 r6 : 9de20500 r5 : 00000002 r4 : 9c1bc980
[ 150.347868] r3 : 96a0ee38 r2 : 00000001 r1 : 00000000 r0 : 96a0ee00
[ 150.347874] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM
Segment kernel
[ 150.347878] Control: 10c53c7d Table: 2697804a DAC: 00000015
[ 150.347882] Process kworker/u4:1 (pid: 21, stack limit = 0x9c1e4238)
[ 150.347886] Stack: (0x9c1e5f08 to 0x9c1e6000)
Regards Hannes
This patchset adds netns/netlink support to batctl. It complements the batman-adv
netns/netlink support v9 as sent today. This series is an update from
the v8 series sent on May 23rd with the following changes:
* fix segfault when reading algo_name for originator table header
* import newest version of debugfs.[ch] from alfred
* add patches to translate client mac addresses via netlink
Cheers,
Simon
Andrew Lunn (1):
batctl: Use netlink to replace some of debugfs
Simon Wunderlich (1):
batctl: add netlink dump function for backbone tables
Sven Eckelmann (3):
batctl: Import alfred version of debugfs.*
batctl: Split translate_mac from debugfs backend
batctl: Translate mac addresses via netlink
batman_adv.h | 94 +++++
debug.c | 23 +-
debug.h | 4 +-
debugfs.c | 17 +-
debugfs.h | 4 +-
functions.c | 61 ++-
functions.h | 5 +-
netlink.c | 1328 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
netlink.h | 25 +-
packet.h | 36 --
10 files changed, 1534 insertions(+), 63 deletions(-)
--
2.8.1
The batman-adv module can automatically be loaded when operations over the
rtnl link are triggered. This requires only the correct rtnl link name in
the module header.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
v3:
- rebased on top of current master to fix conflicts with newest patches
v2:
- rebased on top of current master to fix conflicts with newest patches
net/batman-adv/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index fe4c5e2..f61479b 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -638,3 +638,4 @@ MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);
MODULE_DESCRIPTION(BATADV_DRIVER_DESC);
MODULE_SUPPORTED_DEVICE(BATADV_DRIVER_DEVICE);
MODULE_VERSION(BATADV_SOURCE_VERSION);
+MODULE_ALIAS_RTNL_LINK("batadv");
--
2.8.1
This cover letter only tries to recap the changes applied from the previous
version. Please check the patch for major details.
Changes from v1:
- rebased on top of latest master (some patches from the previous patchset were
merged already)
- accidental change to the GW table header moved to right patch
- remove bat_ prefix from API names
- API subobjects redefined as proper struct instead of anonymous ones to fix
kernel-doc complaints
- bonus kernel-doc added
- missing include files added
Changes from v2:
- minimum default value of gw_sel_class restored to 1
Changes from v3:
- move "batman-adv: split routing API data structure in subobjects" as patch 1
- check if algo_ops->gw.get_best_gw_node was implemented before calling it
- add patch to disable GW mode knobs if API have not been implemented (6/6)
Cheers,
Antonio Quartulli (6):
batman-adv: split routing API data structure in subobjects
batman-adv: make the GW selection class algorithm specific
batman-adv: statically print gateway table header
batman-adv: make GW election code protocol specific
batman-adv: B.A.T.M.A.N. V - implement GW selection logic
batman-adv: disable sysfs knobs when GW-mode is not implemented
net/batman-adv/bat_algo.c | 14 +-
net/batman-adv/bat_iv_ogm.c | 252 +++++++++++++++++++++++++++++++--
net/batman-adv/bat_v.c | 280 +++++++++++++++++++++++++++++++++++--
net/batman-adv/bat_v_elp.c | 2 +-
net/batman-adv/bat_v_ogm.c | 2 +-
net/batman-adv/gateway_client.c | 223 ++++-------------------------
net/batman-adv/gateway_client.h | 7 +
net/batman-adv/gateway_common.c | 5 +-
net/batman-adv/hard-interface.c | 16 +--
net/batman-adv/netlink.c | 2 +-
net/batman-adv/originator.c | 49 +++----
net/batman-adv/routing.c | 8 +-
net/batman-adv/sysfs.c | 64 ++++++++-
net/batman-adv/translation-table.c | 6 +-
net/batman-adv/types.h | 137 +++++++++++-------
15 files changed, 744 insertions(+), 323 deletions(-)
--
2.8.3
Some fields in the hard-interface data structure are specific to the
B.A.T.M.A.N. V protocol and have to be initialized only when such
protocol is compiled in.
Instead of having a #ifdef block in the middle of the hard-interface.c
code it is better to have an algorithm private function that hides the
precompiler logic in its own header file (like other functions).
Fixes: ffd2f27908e5 ("batman-adv: Only init ELP tweaking options when BATMAN_V is enabled")
Signed-off-by: Antonio Quartulli <a(a)unstable.cc>
---
Changes from v1:
- move bat_algo.h include line to the right location
Changes from v2:
- rebased on top of newest master to fix compile error.
Changes from v3:
- add missing "#include <linux/atomic.h>"
net/batman-adv/bat_v.c | 15 +++++++++++++++
net/batman-adv/bat_v.h | 5 +++++
net/batman-adv/hard-interface.c | 10 ++--------
3 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index e4a91cd..7231440 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -18,6 +18,7 @@
#include "bat_v.h"
#include "main.h"
+#include <linux/atomic.h>
#include <linux/bug.h>
#include <linux/cache.h>
#include <linux/init.h>
@@ -334,6 +335,20 @@ static struct batadv_algo_ops batadv_batman_v __read_mostly = {
};
/**
+ * batadv_v_hardif_init - initialize the algorithm specific fields in the
+ * hard-interface object
+ * @hard_iface: the hard-interface to initialize
+ */
+void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface)
+{
+ /* enable link throughput auto-detection by setting the throughput
+ * override to zero
+ */
+ atomic_set(&hard_iface->bat_v.throughput_override, 0);
+ atomic_set(&hard_iface->bat_v.elp_interval, 500);
+}
+
+/**
* batadv_v_mesh_init - initialize the B.A.T.M.A.N. V private resources for a
* mesh
* @bat_priv: the object representing the mesh interface to initialise
diff --git a/net/batman-adv/bat_v.h b/net/batman-adv/bat_v.h
index 52dd6cf..83b7763 100644
--- a/net/batman-adv/bat_v.h
+++ b/net/batman-adv/bat_v.h
@@ -23,6 +23,7 @@
#ifdef CONFIG_BATMAN_ADV_BATMAN_V
int batadv_v_init(void);
+void batadv_v_hardif_init(struct batadv_hard_iface *hardif);
int batadv_v_mesh_init(struct batadv_priv *bat_priv);
void batadv_v_mesh_free(struct batadv_priv *bat_priv);
@@ -33,6 +34,10 @@ static inline int batadv_v_init(void)
return 0;
}
+static inline void batadv_v_hardif_init(struct batadv_hard_iface *hardif)
+{
+}
+
static inline int batadv_v_mesh_init(struct batadv_priv *bat_priv)
{
return 0;
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 6689656..70841c1 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -37,6 +37,7 @@
#include <linux/spinlock.h>
#include <linux/workqueue.h>
+#include "bat_v.h"
#include "bridge_loop_avoidance.h"
#include "debugfs.h"
#include "distributed-arp-table.h"
@@ -684,14 +685,7 @@ batadv_hardif_add_interface(struct net_device *net_dev)
if (batadv_is_wifi_netdev(net_dev))
hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
-#ifdef CONFIG_BATMAN_ADV_BATMAN_V
- /* enable link throughput auto-detection by setting the throughput
- * override to zero
- */
- atomic_set(&hard_iface->bat_v.throughput_override, 0);
-
- atomic_set(&hard_iface->bat_v.elp_interval, 500);
-#endif
+ batadv_v_hardif_init(hard_iface);
/* extra reference for return */
kref_init(&hard_iface->refcount);
--
2.8.3
The batman-adv module can automatically be loaded when operations over the
rtnl link are triggered. This requires only the correct rtnl link name in
the module header.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
v2:
- rebased on top of current master
net/batman-adv/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index fe4c5e2..f61479b 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -638,3 +638,4 @@ MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);
MODULE_DESCRIPTION(BATADV_DRIVER_DESC);
MODULE_SUPPORTED_DEVICE(BATADV_DRIVER_DEVICE);
MODULE_VERSION(BATADV_SOURCE_VERSION);
+MODULE_ALIAS_RTNL_LINK("batadv");
--
2.8.1
From: Simon Wunderlich <sw(a)simonwunderlich.de>
The BATADV_CMD_TP_METER_CANCEL netlink cmd can for example fail when no
valid soft_iface can be found. This error should not only detected but
also be reported back to the caller.
Fixes: 98d7a766b645 ("batman-adv: throughput meter implementation")
Signed-off-by: Simon Wunderlich <sw(a)simonwunderlich.de>
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
net/batman-adv/netlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 56e63ce..c25bbb8 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -350,7 +350,7 @@ batadv_netlink_tp_meter_cancel(struct sk_buff *skb, struct genl_info *info)
struct batadv_priv *bat_priv;
int ifindex;
u8 *dst;
- int ret;
+ int ret = 0;
if (!info->attrs[BATADV_ATTR_MESH_IFINDEX])
return -EINVAL;
@@ -377,7 +377,7 @@ out:
if (soft_iface)
dev_put(soft_iface);
- return 0;
+ return ret;
}
static struct genl_ops batadv_netlink_ops[] = {
--
2.8.1